Reputation: 153
I encounter a huge problem with retrieving Product IDs for current page.
Current page is /catalog/product/list
and all data is taken with class
Mage_Catalog_Block_Product_List
There is method
$this->getLoadedProductCollection();
with the help of it all product items is returned as a collection
Is there any way to get only IDs of Products?
I need in it because I want to make some remote request with IDs array for getting some additional values before retrieving all data by $this->getLoadedProductCollection(); ??
Because doing 2 foreach is not a good idea.
foreach ($_productCollection as $_product) { $arrIds[] = $_product->getId(); }
foreach ($_productCollection as $_product) { show all products here }
Thanks
Upvotes: 1
Views: 3152