Home » Magento

Magento: Load store specific product

23 November 2009 Share/Bookmark

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);

From Mukesh Chapagain's Blog, post Magento: Load store specific product

email

php magento mukesh chapagain

Get New Post by Email
RSS Feed Subscribe RSS Feed
  • KoeK

    Ok we got the $product object but how is it displayed? in my block?

  • http://blog.chapagain.com.np Mukesh

    @KoeK – echo $product->getName();

    You can also print_r and see the values.

    print_r($product->getData());

  • Stefan Brendle

    “setStore” means for “Storeview”. How do I set up values like the CategoryIds on “Store”-layer? In the backend it is called “Group”, but I can’t find anything to this topic … :-/