Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Dynamically Update Product Price In Product View Rate Topic   - - - - -

 
  • avlach
  • Newbie
  • Trial users
  • Join Date: 19-Feb 19
  • 5 posts

Posted 19 February 2019 - 11:27 AM #1

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.



 
  • galtinbaeva
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 3344 posts

Posted 26 February 2019 - 05:56 AM #2

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.


Simtech Development | sales@simtechdev.com | www.simtechdev.com
CERTIFIED CS-CART PARTNER | LICENSES | DEVELOPMENT | ADD-ONS | DESIGN | UPGRADE

Google Analytics Enhanced Ecommerce - get advanced ecommerce analytics


 
  • avlach
  • Newbie
  • Trial users
  • Join Date: 19-Feb 19
  • 5 posts

Posted 28 February 2019 - 02:01 PM #3

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,

 

Screen_Shot.png

 

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

 


 



 
  • avlach
  • Newbie
  • Trial users
  • Join Date: 19-Feb 19
  • 5 posts

Posted 01 March 2019 - 07:12 AM #4

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