Skip to main content

Invalid argument for foreach() cart.php line 1491

More
13 years 10 months ago #74551 by tommytom
Hello, I have this message when displaying the payment method page

Warning: Invalid argument supplied for foreach() in /home/********/administrator/components/com_hikashop/classes/cart.php on line 1491

Apparently, the variable $subs has not been initialized or is not an array.

Can you please check it ?

Thanks for your help.
-Tom

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

More
13 years 10 months ago #74563 by Xavier
Hi,

Can you try to replace:
Code:
foreach($subs as $value){ if(isset($value->recurring) && $value->recurring == '1'){ $durations[$i] = $value->duration; $recurring++; } $i++; }

By:
Code:
if(isset($subs) && !empty($subs)){ foreach($subs as $value){ if(isset($value->recurring) && $value->recurring == '1'){ $durations[$i] = $value->duration; $recurring++; } $i++; } }
The following user(s) said Thank You: tommytom

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

More
13 years 10 months ago #74570 by tommytom
Thanks Xavier for answering fast,
That worked well. I no longer have the message now.
-Tom

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

Time to create page: 0.159 seconds
Powered by Kunena Forum