Jump to content

Variable does not refresh in cart-summary.js


tryple

Recommended Posts

I use prestashop 1.6.1.24.
I have a variable $ total_saving where I keep the total saved from the cart. I have it added in the file cart-summary.js as:

$('#total_saving').html(formatCurrency(json.total_saving, currencyFormat, currencySign, currencyBlank));

I want its value to be refreshed when modifying the cart but it is not refreshed. It only changes its value if I reload the whole page.

I have tried to change the line:
$('#total_price').html(formatCurrency(json.total_price, currencyFormat, currencySign, currencyBlank));
by:
$('#total_price').html(formatCurrency(json.total_saving, currencyFormat, currencySign, currencyBlank));

to check that the value is being calculated correctly and works perfectly. Refresh the value in the Total section of the cart.

What do I have to do more so that this variable is refreshed in the cart?

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