6

I want to show both special & regular price at the same time on the product listing and product page for configurable products.

Right now it only shows the final price. E.g. if the regular price is $50 and the special price is $40. I will only see 40$.

What I want is that a strike-through the version of the regular price also.

The simple products attached to the configurable products all have a regular & special price set - even if all regular/special prices are the same, only the final price is shown.

Simple products show both special & regular price at the same time. Both prices are also shown if a specific option of the configurable product is selected. But I want it to be shown initially when no option is selected as well.

6
  • To achive This Check This Link. github.com/magento/magento2/issues/7624 Commented Jun 9, 2017 at 6:43
  • @Cudos A configurable product has associated other products, the special price is set to the associated product, if you have two associated products and both have a special price different from each other, which special price you display it? Commented Jun 12, 2017 at 12:46
  • I tried the same fix. it worked when i changed the original file. But if i am overriding the file it has no effect. Maybe my file path is not correct. Here is the path I am overriding to: > app/design/frontend/Cloudways/m2-theme/Magento_Configurable_Product/templates/product/price/final_price.phtml Please help! Commented Nov 23, 2017 at 13:38
  • @St3phan hi, i have one issue with my configurable product, by luck someone post what i exactly need, could you pls help us? magento.stackexchange.com/q/291238/57334 Commented Oct 8, 2019 at 11:23
  • But your issue is in Magento 2.1 and someone post is for Magento 1.9.x Commented Oct 8, 2019 at 11:26

2 Answers 2

10

Not sure if it's just the right way but what it did worked for me.

I copied below file into my theme and removed !$block->isProductList() && on line 22:

vendor/magento/module-configurable-product/view/base/templates/product/price/final_price.phtml

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

and both prices now show up.

Both show up also if only one simple product is special-priced so this could be a good solution only when all simples are special-priced, otherwise for those which are not, it shows inconsistent data.

0
1

I've just been looking at this on Magento 2.3 and came across this thread. However, looking at the html and css, it looks to me as though the price is in the html, it just ends up with a "display:none" applied to it from the .no-display class. I have added the following to my css to overwrite it:

.old-price.sly-old-price { display: block !important; } 

The !important is needed as when you click through from a catalogue page the as individual product paage seems to use some javascript to put inline style display:none.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.