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

#   On checkout. Error for a Free Product

##

- **[xsbucks](/forum/user/22196-xsbucks "View xsbucks's Profile")**
- [![xsbucks's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/22196-xsbucks "View xsbucks's Profile") Topic Author
- [ Offline](/forum/user/22196-xsbucks)

Less More

- Posts: 61
- Thank you received: 2
-
-

13 years 2 months ago -  13 years 2 months ago [\#121680](#121680) by [xsbucks](/forum/user/22196-xsbucks "View xsbucks's Profile")  *[On checkout. Error for a Free Product](/forum/29-payment-methods/861645-on-checkout-error-for-a-free-product#121680 "Warning: Invalid argument supplied for foreach() in /home/&#42;&#42;&#42;&#42;&#42;&#42;/public&#95;html/&#42;&#42;&#42;&#42;&#42;&#42;/plugins/hikashop/userpoints/userpoints.php on line 437")* was created by *[xsbucks](/forum/user/22196-xsbucks "View xsbucks's Profile")*

Warning: Invalid argument supplied for foreach() in /home/******/public_html/******/plugins/hikashop/userpoints/userpoints.php on line 437

Last edit: 13 years 2 months ago by [xsbucks](/forum/user/22196-xsbucks "View xsbucks's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI5LXBheW1lbnQtbWV0aG9kcy84NjE2NDUtb24tY2hlY2tvdXQtZXJyb3ItZm9yLWEtZnJlZS1wcm9kdWN0P3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

13 years 2 months ago [\#121731](#121731) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[On checkout. Error for a Free Product](/forum/29-payment-methods/861645-on-checkout-error-for-a-free-product#121731 "Warning: Invalid argument supplied for foreach() in /home/&#42;&#42;&#42;&#42;&#42;&#42;/public&#95;html/&#42;&#42;&#42;&#42;&#42;&#42;/plugins/hikashop/userpoints/userpoints.php on line 437")*

Hi,

Thanks for the report.
We have already submit a patch for this PHP notice but we modified too much elements in order to create a new package.

Please replace Code:

if( (in_array($order-&gt;order_status, $confirmed) &#124;&#124; (empty($order-&gt;order_status) &amp;&amp; in_array($created, $confirmed))) &amp;&amp; (empty($order-&gt;old-&gt;order_status) &#124;&#124; !in_array($order-&gt;old-&gt;order_status, $confirmed)) ) { foreach($this-&gt;fullOrder-&gt;order_payment_params-&gt;userpoints-&gt;earn_points as $mode =&gt; $p) {

By Code:

if( !empty($this-&gt;fullOrder-&gt;order_payment_params-&gt;userpoints-&gt;earn_points) &amp;&amp; (in_array($order-&gt;order_status, $confirmed) &#124;&#124; (empty($order-&gt;order_status) &amp;&amp; in_array($created, $confirmed))) &amp;&amp; (empty($order-&gt;old-&gt;order_status) &#124;&#124; !in_array($order-&gt;old-&gt;order_status, $confirmed)) ) { foreach($this-&gt;fullOrder-&gt;order_payment_params-&gt;userpoints-&gt;earn_points as $mode =&gt; $p) {

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

The following user(s) said Thank You: [xsbucks](/forum/user/22196-xsbucks "View xsbucks's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI5LXBheW1lbnQtbWV0aG9kcy84NjE2NDUtb24tY2hlY2tvdXQtZXJyb3ItZm9yLWEtZnJlZS1wcm9kdWN0P3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[xsbucks](/forum/user/22196-xsbucks "View xsbucks's Profile")**
- [![xsbucks's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/22196-xsbucks "View xsbucks's Profile") Topic Author
- [ Offline](/forum/user/22196-xsbucks)

Less More

- Posts: 61
- Thank you received: 2
-
-

13 years 2 months ago [\#121763](#121763) by [xsbucks](/forum/user/22196-xsbucks "View xsbucks's Profile")  Replied by *[xsbucks](/forum/user/22196-xsbucks "View xsbucks's Profile")* on topic *[On checkout. Error for a Free Product](/forum/29-payment-methods/861645-on-checkout-error-for-a-free-product#121763 "Warning: Invalid argument supplied for foreach() in /home/&#42;&#42;&#42;&#42;&#42;&#42;/public&#95;html/&#42;&#42;&#42;&#42;&#42;&#42;/plugins/hikashop/userpoints/userpoints.php on line 437")*

Worked perfect
Thanks Jerome

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI5LXBheW1lbnQtbWV0aG9kcy84NjE2NDUtb24tY2hlY2tvdXQtZXJyb3ItZm9yLWEtZnJlZS1wcm9kdWN0P3RtcGw9bWFya2Rvd24=) or [Create an account](/register) 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.056 seconds

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