Jump to content

Percentage in Cart


Recommended Posts

Hi there,

 

I have a catalog price rule that discounts all products with 50% in a certan category. This works fine.

When the cutomer adds the products to the cart it displays the percentage as 46.01%. (See picture prestashopPriceWrong.jpg)

post-779688-0-46631000-1398237788_thumb.jpg

 

So i went to the template file (i use standard 1.6 template) and modified /themes/default-bootstrap/shopping-cart-product-line.tpl - this worked fine (check picture prestashopPriceOk.jpg

post-779688-0-46631000-1398237788_thumb.jpg

 

now the problem is every time i press the +/- to increase or decreas the quntity the cart refreshes and switches back to view that is not correct. When i do a full page refresh the view is correct again.

 

I think this is a ajax call that loads something - but i can not inde what...

 

Thanx for your help!

Lars

post-779688-0-79653500-1398237795_thumb.jpg

Link to comment
Share on other sites

Hi Peter,

 

I found a way how it worked for me:

 

The magic of the ajax call happens in this file -> /themes/default-bootstrap/js/cart-summary.js

I had to change line 751

 

Original:

priceReductionPercent = ps_round((ps_round(product_list[i].price_without_quantity_discount) - ps_round(product_list[i].price_wt))/ps_round(product_list[i].price_without_quantity_discount) * -100);

I changed it to:

priceReductionPercent = Math.round((product_list[i].price/product_list[i].price_without_quantity_discount)*-100);

Hope this helps!

Cheers,

Lars

Edited by u2nr (see edit history)
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...