Error on Category View with More than one Page of Products
Posted: Thu Aug 20, 2020 8:22 pm
Hi Experts
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.
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.