Magento: Load store specific product
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);
Ok we got the $product object but how is it displayed? in my block?
@KoeK – echo $product->getName();
You can also print_r and see the values.
print_r($product->getData());
Leave your response!
Donate
Help this blog grow!
Categories
Archives
Recent Tweets
Recommendations
Find me on Facebook