- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Was / Now prices display
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?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Was / Now prices display
Hello @lowis_coetzee
All you have to do is set the "special price" from the backend for the product.
Steps to follow:
- Login to admin panel
- Navigate to Catalog > Products
- Edit the product for which you want to show the discounted price or special price
- The "was" price, i.e., the original price of the product is set in the "Price" field.
- Click on "Advanced Pricing"
- Set the "now" discounted price in the "Special Price" field as shown here - https://drops.meetanshi.com/bBexHC
- Save the Configuration.
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.
If you've found my answer useful, please give"Kudos" and "Accept as Solution"
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Was / Now prices display
Thank you.
Would this apply to the relevant products on the category pages? Photo example attached.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Was / Now prices display
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"