I had a question where I wanted the size to determine the price that took me some time to get worked out. The key is in the add to cart section of the php code you need to have recordsets that will grab the price information and add everything together.
Yeah, it's a custom implementation and you will need to understand some php in order to pull it off. It should be doable though.