Jump to content

Hide Prestashop discount percentage decimal.


skeccy

Recommended Posts

Hello. i have a problem with my prestashop. i have price and discount flag with decimal fir example € 100,00 and discount flag -10,00%.

I want see price and discount price with decimal but discount flag without decimals. Is possible?

Can you help me, please?

 

1.JPG

Link to comment
Share on other sites

How to change it programmatically:

Go to /templates/catalog/_partials/miniatures/product.tpl

Find:

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

Change to:

  {if $product.discount_type === 'percentage'}
                  <span class="discount-percentage discount-product">{$product.discount_percentage|string_format:"%d"}</span>

If I solved your question, please dont forget to press grey heart on the right-bottom corner.

  • Like 2
Link to comment
Share on other sites

6 hours ago, Chill_user said:

How to change it programmatically:

Go to /templates/catalog/_partials/miniatures/product.tpl

Find:


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

Change to:


  {if $product.discount_type === 'percentage'}
                  <span class="discount-percentage discount-product">{$product.discount_percentage|string_format:"%d"}</span>

If I solved your question, please dont forget to press grey heart on the right-bottom corner.

Hello scuse me for my reply.

Your solution works!!

But after that modify I had to regenerate the cache for the change to take effect

Thanks a Lot! Perfect

Link to comment
Share on other sites

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...