[Skip to main content](#vessel-content)

#   Change of getpayments() in v1.5.2

##

- **[brainforge](/forum/user/423-brainforge "View brainforge's Profile")**
- [![brainforge's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar423.jpg)](/forum/user/423-brainforge "View brainforge's Profile") Topic Author
- [ Offline](/forum/user/423-brainforge)

Less More

- Posts: 298
- Thank you received: 5
-
-
-
- [](https://brainforge.co.uk)
-

15 years 4 months ago [\#20236](#20236) by [brainforge](/forum/user/423-brainforge "View brainforge's Profile")  *[Change of getpayments() in v1.5.2](/forum/3-bug-report/20236-change-of-getpayments-in-v1-5-2#20236 "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?")* was created by *[brainforge](/forum/user/423-brainforge "View brainforge's Profile")*

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

if(!empty($usable_methods)){ ksort($usable_methods); }else{ $app =&amp; JFactory::getApplication(); $app-&gt;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;

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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC8yMDIzNi1jaGFuZ2Utb2YtZ2V0cGF5bWVudHMtaW4tdjEtNS0yP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86555
- Thank you received: 14304
-
-

15 years 4 months ago [\#20248](#20248) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Change of getpayments() in v1.5.2](/forum/3-bug-report/20236-change-of-getpayments-in-v1-5-2#20248 "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?")*

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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC8yMDIzNi1jaGFuZ2Utb2YtZ2V0cGF5bWVudHMtaW4tdjEtNS0yP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.048 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
