I am encountering a problem with OC 2.3.0.2 in the category view. When there are too many products for one page, I get a link to page 2, 3 etc. That works fine. However, when I'm viewing page 2 of the category, then click the link to return to page 1, I get the following errors displayed at the top of the browser.
Warning: A non-numeric value encountered in .../catalog/controller/product/category.php on line 174
Warning: A non-numeric value encountered in .../catalog/controller/product/category.php on line 363
Warning: A non-numeric value encountered in .../catalog/controller/product/category.php on line 363
Warning: A non-numeric value encountered in .../catalog/controller/product/category.php on line 363
Warning: A non-numeric value encountered in .../catalog/controller/product/category.php on line 371
Warning: A non-numeric value encountered in .../catalog/controller/product/category.php on line 375
The relevant lines from the category.php file are below.
Line 174 => 'start' => ($page - 1) * $limit,
Line 363 => $data['results'] = sprintf($this->language->get('text_pagination'), ($product_total) ? (($page - 1) * $limit) + 1 : 0, ((($page - 1) * $limit) > ($product_total - $limit)) ? $product_total : ((($page - 1) * $limit) + $limit), $product_total, ceil($product_total / $limit));
Line 371 => $this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'] . '&page='. ($page - 1), true), 'prev');
}
Line 375 => $this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'] . '&page='. ($page + 1), true), 'next');
}
I'm more than a little out of my depth with this one. Any suggestions as to what may be causing the error, or ideas on how to correct it would be really appreciated!
Thanks folks.
Code: Select all
Line 174 => 'start' => ($page - 1) * $limit,
you show. Something must therefore have been changed and/or added in your
Code: Select all
controller/product/category.php
My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
I now get the same error messages, but with different line numbers giving the same errors.
174 => 'start' => ($page - 1) * $limit,
349 => $data['results'] = sprintf($this->language->get('text_pagination'), ($product_total) ? (($page - 1) * $limit) + 1 : 0, ((($page - 1) * $limit) > ($product_total - $limit)) ? $product_total : ((($page - 1) * $limit) + $limit), $product_total, ceil($product_total / $limit));
357 => $this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'] . '&page='. ($page - 1), true), 'prev');
361 => $this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'] . '&page='. ($page + 1), true), 'next');
I had hoped that after uploading a new file from a fresh download (prompted by your comments) that the issue would resolve, but only the line numbers have changed.
Got an urgent question that’s keeping you up at night? There might just be a magical inbox ready to help: khnaz35@gmail.com
Enjoy nature
Opencart 1.5.6.5/OC Bootstrap Pro/VQMOD lover, user and geek.
Affordable Service £££ - Opencart Installs, Fixing, Development and Upgrades
Plus Ecommerce, Marketing, Mailing List Management and More
FREE Guidance and Advice at https://www.ecommerce-help.co.uk
https://github.com/opencart/opencart/pull/7785/files
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
xxvirusxx wrote: ↑Sat Aug 29, 2020 5:34 pmYou need to add (int) on some locations..
https://github.com/opencart/opencart/pull/7785/files
Some locations mean? Same lines where he had warning
Got an urgent question that’s keeping you up at night? There might just be a magical inbox ready to help: khnaz35@gmail.com
Enjoy nature
If you click on that link you will see files names....and where...
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
Thanks for clarifying, he must be able to solved it now
Got an urgent question that’s keeping you up at night? There might just be a magical inbox ready to help: khnaz35@gmail.com
Enjoy nature
Users browsing this forum: No registered users and 70 guests