in the cart object you should have a weight column.
in the add to cart button for each product, you set the weight column to the weight for that product.
as for the code from my previous reply, the first step is to have the correct column names:
for the price, i think you will want to have 3 price columns
as long as you have those column names, you will not need to edit the code.