Change of getpayments() in v1.5.2
- brainforge
-
Topic Author
- Offline
Less
More
15 years 2 months ago #20236
by brainforge
Change of getpayments() in v1.5.2 was created by brainforge
In getPayments() of payment.php the else section below has been added to queue the no payments found message.
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
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?
Code:
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
Code:
$user = hikashop::loadUser(true);
if (!$user) return false;
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.
15 years 2 months ago #20248
by nicolas
Replied by nicolas on topic Re: Change of getpayments() in v1.5.2
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.
$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.162 seconds