Jump to content

Client Side Warning - No Payment Methods


aquiss

Recommended Posts

I've had a good hunt of the community forums for any examples, but don't seem to be able to find anything.

Does anyone have any code, hook etc to display a message on the client homepage when there are no active payment methods setup?

Link to comment
Share on other sites

4 hours ago, aquiss said:

Does anyone have any code, hook etc to display a message on the client homepage when there are no active payment methods setup?

to determine in a hook if the client currently had no payment methods, it should just be...

	$client = Menu::context('client');
	$paymethods = $client->payMethods->count();

and that will give you a value that you can use in an IF statement to determine what you want to do and then what method you want to use to display the notification etc, e.g homepage bootstrap alert, homepage panel etc..

e.g if it's a bootstrap alert, then it's basically the last half of the hook below, using the $paymethods definition, tweaking the if statement (with no need for in_array)...

2IL48JW.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated