Jump to content

Updating the price on quantity change (product page)


Recommended Posts

  • 4 months later...

Hi Fabio,

 

I can't make it work, unfortunately...

here is a code

if (priceWithDiscountsDisplay > 0)
    {
    if(findSpecificPrice()){
      $('#our_price_display, #our_price_display2').text(findSpecificPrice()).trigger('change');
    }
    else{
      $('#our_price_display, #our_price_display2').text(formatCurrency(priceWithDiscountsDisplay, currencyFormat, currencySign, currencyBlank)).trigger('change');
      $('#our_price_display, #our_price_display2').text(formatCurrency(priceWithDiscountsDisplay * $('#quantity_wanted').val(), currencyFormat, currencySign, currencyBlank)).trigger('change');
    }
    }
    else
    {
        $('#our_price_display, #our_price_display2').text(formatCurrency(0, currencyFormat, currencySign, currencyBlank)).trigger('change');
    }

Please advise

Link to comment
Share on other sites

  • 2 months later...
  • 2 months later...
  • 4 months later...
  • 6 months later...

Hi @NemoPS

This part dont works for me. I use prestashop 1.6.1.20 and default template. Can you help me?

 $('#our_price_display').text(formatCurrency(priceWithDiscountsDisplay * $('#quantity_wanted').val(), currencyFormat, currencySign, currencyBlank)).trigger('change');

 

product.js

Edited by lucascatani
Add product.js to the post (see edit history)
Link to comment
Share on other sites

  • 1 month later...

Hey thanks for the feedback.

The real issue was for products with no combination AND a quantity discount (but no discount for the product when the quantity wanted is 1).

I made the changes for this case.

I also show the reduction percent or amount when the quantity triggers it, and the crossed old price.

I someone needs it, I can explain what I did, I don't think my code is optimised and it require the option "Display discounted price" for the discount board to be toggle but still if it can help, feel free to ask.

 

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