Magento get list of Products in Comparison List
Magento get list of Products in Comparison List : If you want to get the list of products which are in comparison list Mage_Catalog_Model_Product_Compare_List and it’s method getItemCollection() is used. You can get collection of items which are in comparison list. Here in this tutorial we are going to explain how to get comparison list products.
Magento get list of Products in Comparison List
Mage::getModel(‘catalog/product_compare_list’)->getItemCollection(); will give the collection of the products which are in comparison list.
Magento get list of Products in Comparison List:
$collection = Mage::getModel('catalog/product_compare_list')->getItemCollection(); foreach($collection as $product){ echo $product->getId(); } |
The above example will give you the product collection which are added on comparison list.
Advertisements