Please can someone help on this OC3 error. Version 3.0.3.6
2021-01-25 13:33:31 - PHP Warning: Division by zero in /home/customer/www/kenwoodchefrestore.co.uk/public_html/shop/catalog/controller/product/manufacturer.php on line 311
311 $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));
Thank you
2021-01-25 13:33:31 - PHP Warning: Division by zero in /home/customer/www/kenwoodchefrestore.co.uk/public_html/shop/catalog/controller/product/manufacturer.php on line 311
311 $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));
Thank you
Thank you but I have no idea, I cant apply the logic?
If I look at: upload/catalog/controller/product/manufacturer.php
if (isset($this->request->get['page'])) {
$page = $this->request->get['page'];
$page = (int)$this->request->get['page'];
} else {
$page = 1;
How would I apply this to my code please?
Thank you.
If I look at: upload/catalog/controller/product/manufacturer.php
if (isset($this->request->get['page'])) {
$page = $this->request->get['page'];
$page = (int)$this->request->get['page'];
} else {
$page = 1;
How would I apply this to my code please?
Thank you.
By changing
to
Code: Select all
$page = $this->request->get['page'];
Code: Select all
$page = (int)$this->request->get['page'];
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
I am still getting this OC3 error after the change.
2021-01-27 5:52:35 - PHP Warning: Division by zero in /home/customer/www/kenwoodchefrestore.co.uk/public_html/shop/catalog/controller/product/manufacturer.php on line 311
311 $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));
The change I made in manufacturer.php was on line 85
85 $page = (int)$this->request->get['page'];
Did I do something wrong?
2021-01-27 5:52:35 - PHP Warning: Division by zero in /home/customer/www/kenwoodchefrestore.co.uk/public_html/shop/catalog/controller/product/manufacturer.php on line 311
311 $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));
The change I made in manufacturer.php was on line 85
85 $page = (int)$this->request->get['page'];
Did I do something wrong?
Well xxxvirusxxx certainly gave you the good advice so maybe you did.
Make sure to clear the cache on dashboard top right corner.
Make sure to do HARD refresh in your browser on THAT PAGE or try a different browser.
DOUBLE CHECK the php file that the CHNAGES are SAVED
If you did everything xxxvirusxxx showed you it should be good
code MUST be like this
Code: Select all
if (isset($this->request->get['page'])) {
$page = (int)$this->request->get['page'];
} else {
$page = 1;
}
Redundancy ...
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Who is online
Users browsing this forum: No registered users and 13 guests