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
Display differnet price based on size entered
Re: Display differnet price based on size entered
Instead of doing this customization what if you use Show Product With Option Grid display for product details page. This will render all your variants on on product details page with option to add with quantity. So in your case your customer can pick suitable variant from the list. Give it a try simply log as merchant and then navigate to product details page. From bottom you will see edit option use that. Then for content select Show Product With Option Grid and save it.
Re: Display differnet price based on size entered
Hi Mazhar,
I have used Options and Variants to create the grid with the different sizes then in Manage Variants i put the prices against each size.
For example
Width 450 and the Height 750 with a price of $12
The customers can enter the size Width 450 and the Height 630
In the grid the product size is Width 450 and the Height 750 with a price of $12 so the customers gets this size and we cut it to fit.
I could not put every size from 450 to 2000mm in the grid I only enter the sizes that have a price against them.
Thanks
Mark
I have used Options and Variants to create the grid with the different sizes then in Manage Variants i put the prices against each size.
For example
Width 450 and the Height 750 with a price of $12
The customers can enter the size Width 450 and the Height 630
In the grid the product size is Width 450 and the Height 750 with a price of $12 so the customers gets this size and we cut it to fit.
I could not put every size from 450 to 2000mm in the grid I only enter the sizes that have a price against them.
Thanks
Mark