Change Price of Product Based on the width and height that the client will enter

Z_I
Visitor
1 0 1
Hello,
I've created a new template for our product page.
we're planning to sell wallpaper so the client will enter the width and height then the price will change based on that : 
==> final_price = (height * width * price)
so we added two fields on the product page one for the height and one for the width and we've managed to get the final price calculated,
but unfortunately, we couldn't find a way to get the final price to be the price added to the cart when the user clicks on add to cart (see Attachment 1) 
1.png
and you can see the code we've used (see Attachment 2) 
2.png
this is what my cart looks like 
3.png
this is really important to our business, we'll be glad if you help us.
Thank you.
Replies 3 (3)

JHKCreate
Shopify Expert
3571 639 917

Hi @Z_I 

The solution for that is to set a base price per m2 and then modifying the quantity field to act as the multiplier. What that means is changing HxWxPrice to QuantityxPrice where Quantity is set by WxH.

Let me know if that helps!

Did we solve your issue? Like & Mark As Solution to help the community
Should you need any direct help: contact@jhkcreate.com

Learn more about us: jhkcreate.com
Lang123
Visitor
2 0 0

Hi, I need a similar thing on my online shop. Can you help me to get this done?

 

DaveWilkins
Visitor
1 0 0

Hi, did you ever get this figured out? I'm trying to do this same thing!