Jump to content

Show special price in percentage % instead of the discount amount €..


Recommended Posts

In prestashop 1.7 I have declared products discount in amount and not in percentage.


But in product page i want to show the corresponding percentage instead of the discount amount.
The lines of code that show a percentage or amount of discount depending on what you put in the admin are:

 <!-- {if $product.discount_type === 'percentage'}
                  <span class="discount-percentage discount-product">{$product.discount_percentage}</span>
                {elseif $product.discount_type === 'amount'}
                  <span class="discount-amount discount-product">{$product.discount_amount_to_display}</span>
                {/if} -->

Any idea how i can calculate the discount rate from the discount amount and show it in place of discount amount?

Edited by Prestan0ob (see edit history)

Share this post

Link to post
Share on other sites

  • 3 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More