I want to show X percent discount on all products in my website. I dont want to apply that on checkout page. Just only want to show visually like below image enter image description here

Is there any way to show this ?

Actually my problem is when i apply site wide discount from catalog price rules after that if we apply coupon code then it discounts the discounted product (with catalog price rule) on checkout page. how to fix this?

1 Answer 1


So you actually want to create a banner like percentage on each product but the price will remain the same?

You can add a custom html element to your




something like:

<?php if ($_product->isSaleable() && $_product->getTypeId() !== "simple") : ?>
<?php $finalPrice = $_product->getPriceInfo()->getPrice('final_price')->getAmount()->getValue(); ?>
<?php $bundleRegularPrice = $_product->getPriceInfo()->getPrice('regular_price')->getAmount()->getValue(); ?>
<?php $save = $bundleRegularPrice - $finalPrice; ?>
<?php $percent = round(($save * 100) / $bundleRegularPrice); ?>
<?php if ($percent) : ?>
    <span class="product-label sale-label"><span>-<?php echo $percent; ?>%</span></span>
<?php else : ?>
<?php endif; ?>

on the right spot of each page, i.e the product image banner probably. Please feel free to adjust the code as needed.

  • please check my updated question
    – Ashar Riaz
    Commented Aug 30, 2019 at 13:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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