Home » Magento

Magento: Load store specific product

23 November 2009 486 views 2 Comments Popularity: 6% 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

Related posts:

  1. Magento: How to get all associated children product of a configurable product?
  2. Magento: Product Edit Warning: Invalid argument supplied for foreach()
  3. Magento: How to get most viewed products?
  4. Magento: Get parent id of simple product associated to configurable product
  5. Magento: Get store information

2 Comments »

  • KoeK said:

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

  • Mukesh said:

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

    You can also print_r and see the values.

    print_r($product->getData());

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.