0
votes

I was trying to Sort product listing with created_at and group by Name, that why i added

$this->_productCollection->addAttributeToSort('created_at', 'desc')
                ->getSelect()->group('name');;

before

return $this->_productCollection;

in function _getProductCollection()

//app/code/local/Mage/Catalog/Block/Product/list.php

sorting is working fine but pagination and item quantity showing wrong.

enter image description here It looks like only 1 products but i have much product here and i have not changed anything in toolbar page.

1

1 Answers

0
votes

The following url will be useful.

http://www.magentocommerce.com/boards/viewthread/51137/

Checkout the function

getSelectCountSql