Hi,
Theme used: Dawn
I’m looking for a method to have a product’s price updated based on the quantity, and a few other values (radio buttons, checkboxes) while on the product page, and have the cart updated with new price when its submitted.
I was thinking of using an if statement function with addEventListener to the specific inputs (radio)
I have all the liquid “assign” variables setup for the price to change to in the assets>price.lquid for the if statement function.
Thanks in advance.
The scripts forum isn’t for javascript it’s for checkout-scripts on the Shopify Plus plan , but moderators aren’t keeping it clear like they should.
Use the design forums or technical forums for such javascript things to increase chances of getting relevant solutions.
Javascript, nor liquid , can modify the actual real price of a product. So you can change the presentment price all day long but when the customer goes to checkout the actual price as will be shown as entered in the admin for that product.
Natively changing price based on quantity is tier pricing, aka volume pricing aka quantity breaks, that’s only available for shopify Plus plans with price lists or checkout-scripts.
All others need to implement advanced theme customization whereby you either add multiple products to the cart or swap different products of the correct price in and out of the cart and or use discounts ; and or use apps.
If your DIY’ing it there are topics on it, and in some I’ve describe the general approach.
That’s moving into the realm product personalization.
1 Like
Clarification, javascript on the front end clientside cannot modify product prices through the ajax api. Backaned javascript, such as in node.js, using the admin apis is completely different.