Site icon MageComp Blog

Magento 2: Show Both Regular & Special Price on Configurable Products

Show Both Regular & Special Price on Configurable Products in m2

Hello Magento Friends,

Welcome to Magento 2 How-To Tutorials by MageComp. Today’s solution is about Magento 2: Show Both Regular & Special Price on Configurable Products.

Configurable products are a mixture of simple products with various options like color, size, etc. Magento 2 store owners offer special prices to increase sales, purchasing power, and manage surplus stock. But when special prices are applied, it does not show the original price.

So I am here with the solution to show the special price and original price both on configurable products in Magento 2.

Steps to Show Both Regular & Special Price on Configurable Products in Magento 2:

Step 1: Copy final_price.phtml from 

Vendor\magento\module-configurable-product\view\base\templates\product\price\final_price.phtml

to

app\design\frontend\Themes\Yourtheme\Magento_ConfigurableProduct\templates\product\price\final_price.phtml

Step 2: Now find below lines of code

<?php if ($block->hasSpecialPrice()) : ?>

    <span class="old-price sly-old-price">

And replace it with,

<?php if (!$block->isProductList() && $block->hasSpecialPrice()) : ?>

    <span class="old-price sly-old-price no-display">

After performing the above steps, the special price and original price will be displayed on the category page of configurable products in Magento 2.

Conclusion:

This way you can Show Both Regular & Special Price on Configurable Products in Magento 2. In case of any difficulty, feel comfortable contacting me via the comment section. Share the article with other Magento developers and stay tuned so that you do not miss out on any important solution.

Happy Coding!

Exit mobile version