do you have a database table that contains the price for the selected size, to perform a look up.
Or will the price always increment by a set amount for a size no mater what is ordered?
Say for example you have shirts.
Will a small be the base price, and medium increment by 1 dollar, larger by 2 etc... no matter which item is ordered?
I will need some more information on how you are setting this up to be able to assist.