I need to multiply a price modifier rather than simply add a fixed value, from what I see online it can’t be done Multiply price for custom pricing
So I wrote some code to calculate my price difference per option on my product page and then bind the amount the price needs to increase by in the cart modifiers inside the add to cart button.
I thought I had solved this but what I didn’t consider is that once inside the cart the modifiers in the dropdown menus don’t have access to my calculations, so it doesn’t recalculate correctly anymore, it only adds or removes the price diff without multiplying the first modifier.
I’m using alpineJS, and what I am wondering is, is there a way to access the information in those dropdown menus to also bind those modifiers to my alpine code?
Here is a code pen of what I have https://codepen.io/fredbouin/pen/YzJqMLv