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.

5
  • To achive This Check This Link. github.com/magento/magento2/issues/7624 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?
    – St3phan
    Jun 12, 2017 at 12:46
  • @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
    – Gem
    Oct 8, 2019 at 11:23
  • But your issue is in Magento 2.1 and someone post is for Magento 1.9.x
    – St3phan
    Oct 8, 2019 at 11:26
  • You have a configurable product with many simple products and it's possible to have special price for a few simple products and for the rest you don't have special price, how can you see to apply for this reason ?
    – St3phan
    Oct 8, 2019 at 11:30

3 Answers 3

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
2

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!

3
  • 1
    Sorry had renamed the module incorrect. NOW fixed and it is working final path to override file is : app/design/frontend/Cloudways/m2-theme/Magento_ConfigurableProduct/templates/product/price/final_price.phtml Note the module name should be Magento_ConfigurableProduct and not Magento_Configurable_Product
    – Abid Malik
    Nov 25, 2017 at 8:11
  • Did you have to run any commands after doing this? I've changed the file, but not updated for me... Sep 19, 2018 at 8:33
  • @YorkieMagento - No just clear the cache.
    – Abid Malik
    Dec 30, 2018 at 8:47
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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.