Re: How to have a product page price updated based on the quantity and update cart with new price?

How to have a product page price updated based on the quantity and update cart with new price?

MLaurex
Tourist
8 0 2

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.

Replies 2 (2)

PaulNewton
Shopify Partner
6419 585 1360

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.

 


@MLaurex wrote:

.. looking for a method to have a product's price updated based on the quantity..


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.

 


@MLaurex wrote:

...and a few other values (radio buttons, checkboxes) while on the product page


That's moving into the realm product personalization.

 

Save time & money ,Ask Questions The Smart Way


Confused? Busy? Get the solution you need paull.newton+shopifyforum@gmail.com


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Buy Paul a Coffee for more answers or donate to eff.org


PaulNewton
Shopify Partner
6419 585 1360

@PaulNewton wrote:

Javascript, nor liquid , can modify the actual real price of a product. So you can change the

 


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.

Save time & money ,Ask Questions The Smart Way


Confused? Busy? Get the solution you need paull.newton+shopifyforum@gmail.com


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Buy Paul a Coffee for more answers or donate to eff.org