Magento – Magento 2 display old price AND special price in category list

configurable-productmagento2pricespecial-price

In my old 1.7.0.2 version, I have in a category product list :

"special_price" instead of "regular_price" like : 200$ instead of 350$

As I understand Magento2 change the way of setting special_price for a configurable product, but also the way of this special_price is display (seems to display the lowest price for simple products associated)

How Can I display the old price AND the special_price in Magento2 ?

PS : I use only configurable products

Best Answer

Found solution here : https://github.com/magento/magento2/issues/7624

Copy final_price.phtml from

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

to

Vendor/theme/Magento_ConfigurableProduct/templates/product/price/final_price.phtml

change (around line 22)

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

(special_price will display)

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

(remove the no-display class)

Related Topic