I would like to get all the product IDs from the current category page. I don't want to load the whole collection, I just need to get the product IDs from the products currently displayed.
E.g.:
Customer goes on category, order is set to price descending, number of displayed products is set to 20 --> I just want to retrieve these product IDs
Customer goes to page 2 --> now I just want to retrieve these product IDs
Customer changes order to name asc, number of displayed products to 50 --> now I just want to retrieve these product IDs
So, getting the whole collection via
$category_id = Mage::getModel('catalog/layer')
->getCurrentCategory()
->getId();
$category = Mage::getModel('catalog/category')
->load($category_id);
$products = Mage::getModel('catalog/product')
->getCollection()
->addAttributeToSelect('*')
->addCategoryFilter($category)
->setOrder('price', 'ASC')
->load();
does not really help me, because I can't actually just the product IDs which are currently displayed to the customer. Is there some kind of way to filter and limit the collections to the values which the customer currently uses?
P.S: Get product id of current category page this guy had the same question (I guess) but didn't receive any answer, at least none, that would help me with my problem.