Making fabric options In Wix stores associate with different prices

Hi,
I’m working on an ecomm site that requires a little code. Basically i want to have fabric options appear on the right hand side of a product page. I want the user to be able to select which fabric option they want and depending on the fabric they choose, the price will change accordingly. I have created a database with all of this info, and created a product page for the product, however I can’t seem to figure out how to connect the fabric with the price. I also can’t make the fabric options into buttons. At the moment they are only static images in a repeater and not interactive. I have taken a piece of code from another example that I think might work. The only issue is that the code is adding the base price of the furniture to the additional price from the fabric. Since I have all of the prices of each each product set as the entire price of the product, the code wouldn’t even require the math portion. Would anyone know how to implement this code in order to create the fabric option become a button, and when it’s clicked it changes price? The code I have is below:

}
export function calculatePrice(pot, plant) {
let total = plant.discountedPrice + pot.discountedPrice;
return ${total} ₪;
}