Showing Price Range for Configurable Products in Magento
If you’re using the Simple Configurable Products extension on your Magento 1.7 store and want to display a price range instead of “Price From” on category pages, I’ll guide you through achieving this without touching core files.
Current Behavior: Price from Cheapest Product
By default, the Simple Configurable Products extension displays the price range as “Price from $[cheapest product price]” in the catalog and search results. While this is useful information, it doesn’t provide a complete picture of the product’s pricing options.
Desired Behavior: Price Range Display
You want to show the full price range for each configurable item:
$[price of cheapest associated product] - $[price of most expensive associated product]
This approach gives customers a clear overview of what they can expect when selecting different product attributes (like size or color).
Solution: Modify the Extension’s Behavior
To achieve this, we’ll need to modify how the extension renders the price block. Here are the steps:
-
First, locate the file
app/code/local/Simple/ConfigurableProducts/Block/Product/Price.phpin your Magento installation. -
Open the file and look for the method
getProductPricesaround line 104 (the exact location may vary based on extension version). -
In this method, you’ll find an array
$pricesthat contains price information about all associated simple products. -
To calculate both the minimum and maximum prices, add these lines inside the loop:
$minPrice = min($prices);
$maxPrice = max($prices);
- Now, update the line
return $this->__('From') . ' <span class="price">' . $this->getPriceHtml($prices[0]) . '</span>';to display both prices:
return '<span class="price">' . $this->getPriceHtml($minPrice) . '</span>' .
' - ' .
'<span class="price">' . $this->getPriceHtml($maxPrice) . '</span>';
- Save the file and clear your Magento cache.
Verifying Changes
After making these modifications, refresh your category or search result page that contains configurable products. The price display should now show the full range:
$49.00 - $79.00
This approach uses the built-in Simple Configurable Products extension features without requiring any core file changes.
Conclusion
Displaying the full price range for configurable products provides better transparency to your customers and helps drive informed purchasing decisions. By following this guide, you can easily update your Magento store’s behavior using the provided extension.
At Laravel Company, we specialize in helping businesses optimize their e-commerce platforms. If you need assistance with customizing Magento extensions or improving your online store’s user experience, feel free to reach out to our expert team for consultation and development services: https://laravelcompany.com/magento-development.