Showing fabric colors on side panel of Ecomm

Hi, i’m trying to display fabric colors on my Ecomm site, so that customers can select which fabric pattern they want for the shirt they are purchasing. I don’t need the image of the shirt to change, I simply want the fabric options to be on the side, and the customer to click on the fabric they want to purchase. There is an article here that explains this to a certain extent, however the example is actually a lot more detailed than what i need. Majority of this I can actually do with databases and dynamic pages. However, I believe the only code I will need is the little snippet that does the math portion of the product - adding the base price of the shirt to the price of the specific material the customer chooses. Would anyone be able to provide this little piece of code I would need? Thank you!