Dynamically Update Product Price In Product View

Hello,

a client has asked to have text fields in the product options section and have the product price updated based on which fields are filled.

I have created a jQuery script that counts the filled fields and calculates the new price but I do not know how to change the product price in the product properties so that it moves on to the cart.

I tried looking in the fn_change_options function but I cannot understand how to do it.

Thank you in advance.

Hello,

a client has asked to have text fields in the product options section and have the product price updated based on which fields are filled.

I have created a jQuery script that counts the filled fields and calculates the new price but I do not know how to change the product price in the product properties so that it moves on to the cart.

I tried looking in the fn_change_options function but I cannot understand how to do it.

Thank you in advance.

Hello,

You can display calculated price to the customer using jQuery, but you will also need to change price when customer adds product to cart. You can use add_product_to_cart_check_price hook from app/functions/fn.cart.php file.

Hello,

You can display calculated price to the customer using jQuery, but you will also need to change price when customer adds product to cart. You can use add_product_to_cart_check_price hook from app/functions/fn.cart.php file.

Hello,

(Sorry for the greek image) The "new" problem is that when the user fills in the 1η Χάραξη and 2η Χάραξη input fields my jQuery works but if the user clicks on the following check boxes the default ajax action kicks in and then my code stops working and the price resets.


Found it!! I had to use a ceEvent to reload the script after the ajax call