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

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)

and you can see the code we’ve used (see Attachment 2)

this is what my cart looks like

this is really important to our business, we’ll be glad if you help us.
Thank you.

Hi @Z_I_1

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!

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

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