Jump to content

[SOLVED]Percentage problem please need help Prestashop v 1.7.7.1


Fadli Abderrafie

Recommended Posts

Hello, 

Can you please give screen shot of your backend  , because which parameter you set for price discount, $ or %.

The things is that. if you set % based discount from your backend. then in front end only change in product page is not enough when user add product in cart it will show in check out page that is different.

You can adjust the discount percentage from backend. Or which admin option you apply and front end what you like. It will give clear idea to give more specific solution

 

Thank you

discount-price.png

Link to comment
Share on other sites

by the way i found the solution but its work just in one place

 image.png.7d069c5773a98292ae83325494e6c26a.pngimage.thumb.png.e9394d4ca5f9166ce9df5f3c79fe158a.png

image.png.5348b2e6090daac57188359ef0d92ddd.png

SOLVED Need to change that code in Product.tpl and Product-special.tpl

from that code 

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

to

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

 

image.png

Edited by Fadli Abderrafie (see edit history)
Link to comment
Share on other sites

@Fadli Abderrafie  This is why i told you  , you need to change each and every place , like check out page and cart page or any other place where the percentage is showing.

 

I test in my end and check if i set % from back end it show in front end with percentage. If i round it backend it will show front end. But when we round it front end smarty the backend value will show in front end other place

Thank you

  • Like 1
Link to comment
Share on other sites

SOLVED 

 

edit product.tpl 

from

<span class="discount-percentage">{$product.discount_percentage}</span>
            {else}
              <span class="discount discount-amount">
                  {l s='Save %amount%' d='Shop.Theme.Catalog' sprintf=['%amount%' => $product.discount_to_display]}
              </span>

to

{if $product.discount_type === 'percentage'} <span class="discount-percentage discount-product">{$product.discount_percentage|round:0}%</span> {elseif $product.discount_type === 'amount'} <span class="discount-amount discount-product">{$product.discount_percentage|round:0}%</span> {/if}

Edited by Fadli Abderrafie (see edit history)
Link to comment
Share on other sites

  • Fadli Abderrafie changed the title to [SOLVED]Percentage problem please need help Prestashop v 1.7.7.1

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