1

I am using a jQuery script to add static price to the product's regular price on the product detail page. On the product page, the price is updated, but the price is not updated in the cart when added

An example:

  • Regular price is $10.
  • Static price is $50.
  • Total price on product page: $60
  • Cart page product price: $10.

The code that I am using on the product detail page:

jQuery('#options_1_text').removeAttr('onchange').on('keyup', function (e){
    var price=50; //add var declaration
    optionsPrice.changePrice('opConfig',price);
    optionsPrice.reload();
}); 
  • you cannot add a price using jquery it does not make any sense. – rehan ansari May 2 '18 at 13:08
  • 1
    @rehanansari - what he is doing is updating a dynamic price in the product page. That can be very useful, and it is working just fine. I think what you mean is that updating a displayed price in the product page with jQuery has no effect on anything but the number that the user sees on that page. – mtr.web May 2 '18 at 13:18
  • You'll probably need to do more digging in the opConfig script in your options template-file. It would also help if you could add the name of the file you are editing, the relevant php involved, and the output of the input-element that you are changing events for, #options_1_text – mtr.web May 2 '18 at 13:21
  • check this might be help you magento.stackexchange.com/questions/83590/… – Keyur Shah May 2 '18 at 13:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.