We are considering some development that will allow our discounted products to show the "was" price next to the discounted / "now" price. Initial research has proven this to be tricky to get right. Has anyone attempted this type of customisation?
Hello @lowis_coetzee
All you have to do is set the "special price" from the backend for the product.
Steps to follow:
The frontend displays both the price as per your requirement - https://drops.meetanshi.com/eNnwSO
Do let me know if you have any doubts further.
Hope it helps.
Thank you.
Would this apply to the relevant products on the category pages? Photo example attached.
Thanks
I have custom solution for this. You can add below code in file final_price.phtml.
You can copy this file from vendor/magento/module-configurable-product/view/base/templates/product/price/final_price.phtml to your theme.
Here is the code:
<?php if ($block->hasSpecialPrice()): ?> <span class="old-price"> <?php /* @escapeNotVerified */ echo $block->renderAmount($priceModel->getAmount(), [ 'display_label' => __('Regular Price'), 'price_id' => $block->getPriceId('product-price-' . $idSuffix), 'price_type' => 'oldPrice', 'include_container' => true, 'skip_adjustments' => true ]); ?> </span> <?php endif; ?>
I hope it will help you.
Thanks
---
If you've found one of my answers useful, please give"Kudos" and "Accept as Solution"