Home » Magento

Magento: Load store specific product

23 November 2009 2,587 views Popularity: 6% Share/Bookmark

email

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

Related posts:

  1. Magento: Get store information
  2. Magento: Get parent id of simple product associated to configurable product
  3. Magento: Show/Hide Demo Store Notice
  4. Magento: Product Edit Warning: Invalid argument supplied for foreach()
  5. Magento: Product is still visible in catalog and search even after changing visibility to nowhere
  6. Magento: How to get all associated children product of a configurable product?
  7. Magento: How to get product stock quantity & other stock information?
  8. Magento: Get category name and url from product
  9. Magento: Get manufacturer name and id from product
  10. Magento: Showing Store Selector / Switcher in header and footer
  • 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());