If you want to programmatically update product prices per website (this means that you have many websites and have set a website scope for price in the configuration), then you can use this script:

public function updateProductPrices ($sku, $newPrice) {

    $websites = Mage::app()->getWebsites();

    $product = Mage::getModel('catalog/product')
    $productId = $product->getIdBySku($sku);

    foreach ($websites as $_eachWebsite) {
        $_websiteId = $_eachWebsite->getWebsiteId();

        $websiteObj = new Mage_Core_Model_Website();

        $storeIds = $websiteObj->getStoreIds();

        if (count($storeIds)) {
            foreach ($storeIds as $_eachStoreId) {

                $oldPrice = $product->getPrice();

                if ($oldPrice != $newPrice) {

        unset($storeIds, $websiteObj, $_websiteId);


Important note: I haven’t developed this, but I think it’s interesting to note it down. Thanks to Knowledge Craving from Stackoverflow.

Categories: Development

1 Comment

Trainee · February 11, 2013 at 1:43 pm

The Changes Happened Only Front End Not Back-ends

Leave a Reply

Your email address will not be published. Required fields are marked *