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

#   Warning message

##

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

Less More

- Posts: 4
- Thank you received: 1
-
-

13 years 11 months ago [\#76616](#76616) by [blokland](/forum/user/7625-blokland "View blokland's Profile")  *[Warning message](/forum/3-bug-report/75815-warning-message#76616 "Goodday,  After updating to 2.0 (essential) I have a warning message at the frontend of some articles/products. the warning says:  Warning: Invalid argument supplied for foreach() in /home/sites/www.bloklandvw.nl/web/components/com&#95;hikashop/views/product/view.html.php on line 1407  Here is a to a page with this problem..  Can you help me solve this problem...  Thanks..")* was created by *[blokland](/forum/user/7625-blokland "View blokland's Profile")*

Goodday,

After updating to 2.0 (essential) I have a warning message at the frontend of some articles/products.
the warning says:

**Warning: Invalid argument supplied for foreach() in /home/sites/www.bloklandvw.nl/web/components/com\_hikashop/views/product/view.html.php on line 1407**

Here is a [ link](http://www.bloklandvw.nl/index.php/fietsen/product/310-highlander-omafiets-gray-28)
to a page with this problem..

Can you help me solve this problem...

Thanks..

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC83NTgxNS13YXJuaW5nLW1lc3NhZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 11 months ago -  13 years 11 months ago [\#76736](#76736) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Warning message](/forum/3-bug-report/75815-warning-message#76736 "Goodday,  After updating to 2.0 (essential) I have a warning message at the frontend of some articles/products. the warning says:  Warning: Invalid argument supplied for foreach() in /home/sites/www.bloklandvw.nl/web/components/com&#95;hikashop/views/product/view.html.php on line 1407  Here is a to a page with this problem..  Can you help me solve this problem...  Thanks..")*

Hi,

Can you add a var_dump($element-&gt;variants); before the foreach and tell us what is the result ?

Try to add a: Code:

if(!is_array($element-&gt;variants)) $element-&gt;variants = (array)$element-&gt;variants;

After: Code:

if(!empty($element-&gt;variants)){

near the line 1348.

Last edit: 13 years 11 months ago by [Xavier](/forum/user/4105-xavier "View Xavier's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC83NTgxNS13YXJuaW5nLW1lc3NhZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

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

Less More

- Posts: 4
- Thank you received: 1
-
-

13 years 11 months ago [\#76930](#76930) by [blokland](/forum/user/7625-blokland "View blokland's Profile")  Replied by *[blokland](/forum/user/7625-blokland "View blokland's Profile")* on topic *[Warning message](/forum/3-bug-report/75815-warning-message#76930 "Goodday,  After updating to 2.0 (essential) I have a warning message at the frontend of some articles/products. the warning says:  Warning: Invalid argument supplied for foreach() in /home/sites/www.bloklandvw.nl/web/components/com&#95;hikashop/views/product/view.html.php on line 1407  Here is a to a page with this problem..  Can you help me solve this problem...  Thanks..")*

I added the line in view.html.php but after that the website crashes..
So I removed it.

I have attached the file, so you can take a look at it..

Thank you..

Sietse

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC83NTgxNS13YXJuaW5nLW1lc3NhZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 11 months ago [\#77002](#77002) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Warning message](/forum/3-bug-report/75815-warning-message#77002 "Goodday,  After updating to 2.0 (essential) I have a warning message at the frontend of some articles/products. the warning says:  Warning: Invalid argument supplied for foreach() in /home/sites/www.bloklandvw.nl/web/components/com&#95;hikashop/views/product/view.html.php on line 1407  Here is a to a page with this problem..  Can you help me solve this problem...  Thanks..")*

Hi,

The error is based on "$element-&gt;characteristics" not on the variants, my apologize.

Can you try to replace the code: Code:

foreach($element-&gt;characteristics as $k2 =&gt; $characteristic2){ if(!empty($variant-&gt;characteristics)){ foreach($variant-&gt;characteristics as $k3 =&gt; $characteristic3){ if($k2==$k3){ $temp[$k3]=$characteristic3; break; } } } }

To: Code:

if(is_array($element-&gt;characteristics){ foreach($element-&gt;characteristics as $k2 =&gt; $characteristic2){ if(!empty($variant-&gt;characteristics)){ foreach($variant-&gt;characteristics as $k3 =&gt; $characteristic3){ if($k2==$k3){ $temp[$k3]=$characteristic3; break; } } } } }

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC83NTgxNS13YXJuaW5nLW1lc3NhZ2U/dG1wbD1tYXJrZG93bg==) 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.049 seconds

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