Display differnet price based on size entered
Posted: Wed Jul 21, 2010 2:00 am
Hi,
I have create variants for a product that works like a grid of choices.
Our products have different prices bases on the size selected.
For example Product one matrix.
If the Width 450 and Height 600 the price is $10.
Width 450 600 750
Height
600 $10 $15 $22
750 $12 $16 $23
900 $13 £17 $24
On the product page the price is not displayed until a size is entered.
The sizes entered are not always the same sizes that comes out of the matrix for example
If the size entered is bigger the size in the matrix the next size up is selected.
The Width 450 and the Height 630 then the price is $12.
Width 450
Height750 $12
I want the user to enter the Width and Height then click a button to calculate the price.
In the code what is the best way to do this?
Could I loop through the Products.Variants collection and when the size is equal to or greater than the width and height entered then return that price.
What would I have to assign this price to so that it would be added to the basket after clicking add to basket.
Or has anyone got a better way of doing this?
Thank
Mark
I have create variants for a product that works like a grid of choices.
Our products have different prices bases on the size selected.
For example Product one matrix.
If the Width 450 and Height 600 the price is $10.
Width 450 600 750
Height
600 $10 $15 $22
750 $12 $16 $23
900 $13 £17 $24
On the product page the price is not displayed until a size is entered.
The sizes entered are not always the same sizes that comes out of the matrix for example
If the size entered is bigger the size in the matrix the next size up is selected.
The Width 450 and the Height 630 then the price is $12.
Width 450
Height750 $12
I want the user to enter the Width and Height then click a button to calculate the price.
In the code what is the best way to do this?
Could I loop through the Products.Variants collection and when the size is equal to or greater than the width and height entered then return that price.
What would I have to assign this price to so that it would be added to the basket after clicking add to basket.
Or has anyone got a better way of doing this?
Thank
Mark