Page 1 of 1

Probably solution for Pagination Error on Product pages

Posted: Wed Aug 12, 2009 11:25 am
by ck.kong
Go to the folder catalog/model/catalog and edit the file product.php and add-in the red color checking. (Backup before modify the file)

At line 37 ~ line 42
public function getTotalProductsByCategoryId($category_id = 0) {
$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "product_to_category p2c LEFT JOIN " . DB_PREFIX . "product p ON (p2c.product_id = p.product_id) LEFT JOIN " . DB_PREFIX . "stock_status ss ON (p.stock_status_id = ss.stock_status_id) WHERE p.status = '1' AND p.date_available <= NOW() AND p2c.category_id = '" . (int)$category_id . "' AND ss.language_id = '" . (int)$this->language->getId() . "'");

return $query->row['total'];
}

Or you can cut and paste the entire function with this code too.

Code: Select all

public function getTotalProductsByCategoryId($category_id = 0) {
$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "product_to_category p2c LEFT JOIN " . DB_PREFIX . "product p ON (p2c.product_id = p.product_id) LEFT JOIN " . DB_PREFIX . "stock_status ss ON (p.stock_status_id = ss.stock_status_id) WHERE p.status = '1' AND p.date_available <= NOW() AND p2c.category_id = '" . (int)$category_id . "' AND ss.language_id = '" . (int)$this->language->getId() . "'");

return $query->row['total'];
}

Re: Probably solution for Pagination Error on Product pages

Posted: Fri Aug 21, 2009 1:34 pm
by jacobIdesign
This fixed my issue!

Re: Probably solution for Pagination Error on Product pages

Posted: Wed Aug 26, 2009 10:06 pm
by ellina
Worked like a charm, no pagination issues anymore.
Many thanks :)

Re: Probably solution for Pagination Error on Product pages

Posted: Mon Feb 01, 2010 11:52 pm
by ckpepper02
Thanks for this! It fixed my issue too.