Hello,
I am new to OpenCart and i'm trying to help a friend setup his shop.
Can someone tell me how i can fix this error?
Warning: Invalid argument supplied for foreach() in /path/catalog/controller/extension/module/octabproducts.php on line 530Warning
I am using Opencart 3.0.2.0
Thanks
I am new to OpenCart and i'm trying to help a friend setup his shop.
Can someone tell me how i can fix this error?
Warning: Invalid argument supplied for foreach() in /path/catalog/controller/extension/module/octabproducts.php on line 530Warning
I am using Opencart 3.0.2.0
Thanks
octabproducts is most likely not a default OC Module.
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
As above it's caused by an extension but also you should not use this version.
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
Yes it's caused by octabproducts that come with the theme Autima that i bought some years ago and that worked very well on another website.
Maybe my friend shouldn't use the 3.0.2 version but the theme is compatible only with 3.0.2 and 3.0.3 as i am aware. The only option is to fix this theme not to change it or OC version so if someone can give me a hint i apreaciate it
527 public function getFirstProduts($products) {
528 $trdProduct = array();
529 $count = 0;
530 foreach($products as $product) {
531 if($count < 1) {
532 $product_id = $product['product_id'];
533 $trdProduct[] = $product;
534 }
535 $count++;
541 public function getOtherExcpFirstProducts($products) {
542 $excpTrdProducts = array();
543
544 $count = 0;
545 foreach($products as $product) {
546 if($count > 1) {
547 $excpTrdProducts[] = $product;
548 }
549 $count++;
530 and 545 are the lines that return the error
Maybe my friend shouldn't use the 3.0.2 version but the theme is compatible only with 3.0.2 and 3.0.3 as i am aware. The only option is to fix this theme not to change it or OC version so if someone can give me a hint i apreaciate it
527 public function getFirstProduts($products) {
528 $trdProduct = array();
529 $count = 0;
530 foreach($products as $product) {
531 if($count < 1) {
532 $product_id = $product['product_id'];
533 $trdProduct[] = $product;
534 }
535 $count++;
541 public function getOtherExcpFirstProducts($products) {
542 $excpTrdProducts = array();
543
544 $count = 0;
545 foreach($products as $product) {
546 if($count > 1) {
547 $excpTrdProducts[] = $product;
548 }
549 $count++;
530 and 545 are the lines that return the error
DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.
https://www.youtube.com/watch?v=zXIxDoCRc84
Hi, it suggests you to check argument supplied for foreach()
Code: Select all
if (is_array($products) || is_object($products)) {
foreach($products as $product) {
...
}
}
Business Web Development | Content Creation | Analytics and Reporting | SEO
Who is online
Users browsing this forum: Bing [Bot], labeshops and 27 guests