Link to home
Create AccountLog in
Avatar of kbit
kbit

asked on

Magento pagination product total display issue

Hi all,

I’m running Magento v1.7.0.2.

Let’s say there are 14 products associated with a particular category. If I click on that category, Magento does the pagination correctly and shows the first 8 products, with 3 products per row. It also says “Items 1 to 8 of 8 total”.

If I click on the second page, it correctly shows me 6 products, 3 per row. This time it says “Items 9 to 14 of 6 total”.

Can someone please help me fix this issue and have it reading “Items 1 to 8 of 14 total” and Items 9 to 14 of 14 total” respectively? I have no idea which PHP/XML file to edit and what changes to make.

Many thanks
Avatar of kbit
kbit

ASKER

In Toolbar.php and Pager.php I've changed

    public function getTotalNum()
    {
        return $this->getCollection()->getSize();
    }

Open in new window


to

    public function getTotalNum()
    {
        return $this->getCollection()->count();
    }

Open in new window


and flushed the cache but still no change.
ASKER CERTIFIED SOLUTION
Avatar of kbit
kbit

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer