aquiss Posted June 10, 2020 Share Posted June 10, 2020 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? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 10, 2020 Share Posted June 10, 2020 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)... 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.