- Posts: 8
- Thank you received: 0
Invalid argument for foreach() cart.php line 1491
13 years 10 months ago #74551
by tommytom
Invalid argument for foreach() cart.php line 1491 was created 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
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.
13 years 10 months ago #74563
by Xavier
Replied by Xavier on topic Re: Invalid argument for foreach() cart.php line 1491
Hi,
Can you try to replace:
By:
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.
13 years 10 months ago #74570
by tommytom
Replied by tommytom on topic Re: Invalid argument for foreach() cart.php line 1491
Thanks Xavier for answering fast,
That worked well. I no longer have the message now.
-Tom
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.176 seconds