I have setup my Magento with 2 websites, with ID 1 and 4, and one store for each website.

My product has 3 prices: a Default price, and a price for each website.

How can I get these 3 prices programmatically?

See what I have tried so far:

$product = Mage::getModel('catalog/product')->loadByAttribute('sku', $sku);
echo $product->getPrice() . "</br>" ;      // prints price of default website != default price
echo $product->setWebsiteId(1).getPrice() . "</br>" ; // throws exception
  • You have create store for that two website ?
    – Keyul Shah
    Commented Jan 19, 2014 at 9:32
  • Sure, I have created a store and a storeview for each website
    – perissf
    Commented Jan 19, 2014 at 9:38
  • Then Below code defiantly work.
    – Keyul Shah
    Commented Jan 19, 2014 at 9:39

1 Answer 1


If you know the storeId, set in setStoreId :

 * call the Magento catalog/product model
 * set the current store ID
 * load the product
$product = Mage::getModel('catalog/product')

Display in a block :

echo $product->getName();
echo $product->getPrice();

We can also use print_r to see the values :


The following code will show current store ID :

$storeId    = Mage::app()->getStore()->getId();

If you change the $storeId will show different product.

  • You welcome :) :)
    – Keyul Shah
    Commented Jan 19, 2014 at 9:50
  • @KeyulShah do you know how to set a store id? separate question, but i think it would be useful here anyway.
    – ahnbizcad
    Commented Nov 6, 2015 at 19:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.