Change of getpayments() in v1.5.2

  • Posts: 292
  • Thank you received: 5
  • Hikashop Business
13 years 5 months ago #20236

In getPayments() of payment.php the else section below has been added to queue the no payments found message.

if(!empty($usable_methods)){
ksort($usable_methods);
}else{
$app =& JFactory::getApplication();
$app->enqueueMessage('No payment methods found');
}

There are a couple of issues with this:

(a) getpayments() is getting called 3 times - not tracked down where each call is coming from with the result that I get 3 messages.

(b) In my payment plug-ins I have the following code
$user = hikashop::loadUser(true);
if (!$user) return false;
which was working OK, but now has the unfortunate effect of raising those error messages if the user is not logged in.

In the shop I am currently looking at I don't think this matters, but would have to check elsewhere as to why I originally put this condition in. Shall I remove the condition for now?

Please Log in or Create an account to join the conversation.

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
13 years 5 months ago #20248

a/ adding:
$usable_methods=false;
after the message will avoid having it several times. We'll add that to next release.

b/ the return false; has no effect on the display of the message. The message is only displayed when no payment methods are found, ie. when $usable_methods is empty.
Looking at your code, that check doesn't seem useful indeed.

Please Log in or Create an account to join the conversation.

Time to create page: 0.056 seconds
Powered by Kunena Forum