Saturday, September 17, 2011

How to Load store specific product in Magento

Different stores can be set in Magento. A product can be made visible in selected stores.
/**
* get store id
*/
$storeId = Mage::app()->getStore()->getId();
/**
* call the Magento catalog/product model
* set the current store ID
* load the product
*/
$product = Mage::getModel('catalog/product')
->setStoreId($storeId)
->load($key);

0 comments:

Post a Comment