I'm using this code getting products. And also using some addAttributeToFilter method for filter.
$collection = Mage::getResourceModel('reports/product_collection')
->addAttributeToSelect('*')
->addStoreFilter()
->setOrder('created_at', 'desc')
->setVisibility(Mage::getSingleton('catalog/product_visibility')->getVisibleInCatalogIds());
Also I'm using $collection->count()
code to get products count.
I'm trying to write my own pagination. (My products page is really complicated.)
Then I use this code setPage($pageNumber, $productsPerPage)
to paginate.
But if I'm gonna paginate $collection->count()
function return $productsPerPage number.
For example:
setPage(1, 6) // 6 product per page
$collection->count() // return 6 (but I have 16 products!)
If I use only $collection->count()
code, it return 16!
What I'm missing?
I hope you guys understand me.