Change price of product on store's website (Magento)

Change price of product on store's website (Magento)

July 16, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Change price of product on store's website (Magento)

Changing Product Prices Across Multiple Magento Stores

In today’s e-commerce landscape, running multiple stores from a single platform is becoming increasingly common. If you’re using Magento to manage your online retail empire, you might find yourself needing to adjust product prices on a per-store basis. This kind of flexibility can help drive sales by allowing you to offer discounted rates to specific customer segments.

Understanding the Default Magento Behavior

By default, Magento allows you to create multiple websites and stores within those websites. However, it doesn’t natively support setting different prices for the same product across these stores. The pricing is typically set at the global level and applied uniformly throughout your entire catalog.

If you try to change a product’s price in one store view, it will automatically update in all subsequent views as well. This default behavior can make it challenging to offer tiered or promotional pricing that varies between your stores.

Changing Product Prices via Code

To change the prices of individual products for specific stores without affecting other stores, you’ll need to dive into Magento’s codebase and make some strategic modifications. Here are the steps involved:

  1. Create a custom module: Start by creating a new module in app/code/local/YourCompany/PriceManager. This module will contain your custom price logic.

  2. Override the core product model: In your new module, create a file called Product.php within the Model/Catalog directory. This file should extend Magento’s base product model (Mage_Catalog_Model_Product).

  3. Modify the getFinalPrice() method: Override this method in your custom Product class to implement your price adjustment logic. Here’s an example:

public function getFinalPrice()
{
    $price = parent::getFinalPrice();

    // Check if we're on a specific store ID (e.g., 2)
    if ($this->getStoreId() == 2) {
        // Apply your custom price adjustment here
        $price -= 10; // Subtract $10 from the final price for Store ID 2
    }

    return $price;
}

In this example, we’re subtracting $10 from the final product price whenever it’s viewed on a store with an ID of 2. You can replace this logic with your own custom business rules.

  1. Configure your module: Update the config.xml file in your module directory to define the necessary configuration settings for Magento to recognize your custom model.

  2. Flush the cache and recompile: After making these changes, make sure to flush the cache (index.php?route=admin/tool/cache_manager/flush) and recompile the code pool (index.php?route=admin/system/compiler/generate).

Displaying Custom Product Selection

To display only specific products in a store based on your own data, you can create a custom product collection and apply your selection criteria. Here’s an example:

  1. Create a new block: In your module, add a new block file (e.g., Product/Collection.php) to define your custom product collection.

  2. Override the getProducts() method: Implement your custom product selection logic in this method. For instance, you might want to filter products based on their category or supplier:

public function getProducts()
{
    $collection = Mage::getResourceModel('catalog/product_collection');

    // Apply filters here
    $collection->addAttributeToFilter('category_id', array('eq' => 5)); // Filter by Category ID

    return $collection;
}
  1. Use the custom block in your template: In your store’s product listing template, use this custom block to display products based on your selection criteria.

Conclusion

Changing product prices and displaying custom product selections across multiple Magento stores requires a combination of understanding Magento’s core architecture and implementing strategic code modifications. By creating a custom module and overriding key methods in the catalog model, you can achieve the desired level of control over your pricing strategy.

Remember to thoroughly test these changes before deploying them to your live environment, as they can significantly impact your customers’ shopping experience.

If you need assistance with more advanced Magento development tasks or are looking for professional help managing your e-commerce infrastructure, don’t hesitate to reach out to our team at Laravel Company. We specialize in providing top-notch services tailored to your business needs.

Catalog Extensions Configuration Customers

Our network