Post by Tom Cat » Mon Jan 25, 2021 10:50 pm

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

New member

Posts

Joined
Thu Mar 08, 2012 4:24 am

User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by Tom Cat » Tue Jan 26, 2021 5:53 pm

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.

New member

Posts

Joined
Thu Mar 08, 2012 4:24 am

Post by xxvirusxx » Tue Jan 26, 2021 6:41 pm

By changing

Code: Select all

$page = $this->request->get['page'];
to

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


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by Tom Cat » Wed Jan 27, 2021 11:25 pm

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?

New member

Posts

Joined
Thu Mar 08, 2012 4:24 am

Post by mikeinterserv » Wed Jan 27, 2021 11:42 pm

Tom Cat wrote:
Wed Jan 27, 2021 11:25 pm
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;
}

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by straightlight » Thu Jan 28, 2021 9:39 am

Redundancy ...

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 13 guests