How to link variable pricing to shopping cart in 3D model?

Hello everyone!

First I apologize if this topic has already been discussed before. I have an interactive 3D model embedded in my page.

I have created 2 control bars (Width and Length) (HTML Language) with values ​​from 200 to 1000 each and with ‘step’ from ‘1’ to ‘1’, so the variables are many.

WithJavaScript I configure the price I want. For example, the user chooses a 400x600 product.

This variable has a value of 200. If it is 456x567 it has a price of 231.7…(Example)

I have all this solved but my question is:

How can I link to the ‘shopping cart’ according to my variables? Obviously a 100x100 product is not worth the same as a 900x900 product…

Thanks for your help.