Jump to content

Dynamic Price Update On Product Page (Specific Pricing Not Working)


Recommended Posts

Hi

 

I am very new to Prestashop and am configuring my first store.  On the product page I want to show the total price for goods being ordered (i.e. unit price * quantity).  I have made an adaption to my theme (which is just a modified version of the default theme) such that

 

1.)  On changing the quantity_wanted I call updateDisplay in the product.js, i.e.

 

$(document).ready(function(){
$("#quantity_wanted").change(function(){
    updateDisplay();
});
});

 

2.)  I have modified the line in product.js to display the total rather than the unit price:

inserting:

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

 

in place of:

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

 

It all looks fine and prices change by quantity and attributes, however after that the unit price is not getting updated for any specific_prices I have set.  I have dumped the object that gets returned from ProductController and is says specific_prices:false.  So the total being shown on my product page is different (higher) than that shown in the shopping basket.  You can see the problem in action at this URL:

 

http://www.infinityfuneralstationery.co.uk/traditional-funeral-order-of-service/classic.html

 

I have a lower specific price set at a quantity of 100.  It "works" in the shopping basket but not on the product page.  I'm using 1.6.1.3, so I have the latest stable version that I am aware of.

 

Any help, much appreciated!

 

Thanks

Gary

 

 

 

 

 

 

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