I have a store that has products with multiple variants for each product. I am currently looking into different ways of managing these products as I am seeing that creating each variant for each product is a bit of an admin nightmare. There are 24 variations for each product in total however only 2 of the variations result in a price change to the product.
My latest idea is to create the 2 variations and accomodate for the other 22 with product property dropdowns that have not been checked as a variant property.
I can then use dynamic orderline properties to add details of the specific variation to the order.
My question therefore, is how do I pull the product properties through to the product detaill page. I have razor code for getting the variant options but not sure how to get the product properties that have not been marked as a variant.
The following code is from the razor demo store, I need similar code to get product properties that are not variants:
var uniqueVariants = from v in product.Variants.SelectMany(p => p.ProductProperties) where v.ProductDefinitionField.DisplayOnSite group v by v.ProductDefinitionField into g select g;
Dealing with products with Multiple Variants
I have a store that has products with multiple variants for each product. I am currently looking into different ways of managing these products as I am seeing that creating each variant for each product is a bit of an admin nightmare. There are 24 variations for each product in total however only 2 of the variations result in a price change to the product.
My latest idea is to create the 2 variations and accomodate for the other 22 with product property dropdowns that have not been checked as a variant property.
I can then use dynamic orderline properties to add details of the specific variation to the order.
My question therefore, is how do I pull the product properties through to the product detaill page. I have razor code for getting the variant options but not sure how to get the product properties that have not been marked as a variant.
The following code is from the razor demo store, I need similar code to get product properties that are not variants:
var uniqueVariants = from v in product.Variants.SelectMany(p => p.ProductProperties)
where v.ProductDefinitionField.DisplayOnSite
group v by v.ProductDefinitionField into g
select g;
@if (uniqueVariants.Any())
{
<fieldset class="options">
@foreach (var prop in uniqueVariants)
{
var controlName = string.Format("variation-{0}", prop.Key.Name.ToLower());
<div class="general">
<label for="@controlName">@prop.Key.GetDisplayName()</label>
<span class="wrap">
<select name="@controlName" id="@controlName" class="variant">
<option>Please select ...</option>
@foreach (var value in prop.Select(p => p.Value).Distinct())
{
<option value="@value">@value</option>
}
</select>
</span>
</div>
}
</fieldset>
}
You can get at the product family properties with:
Hope this helps.
is working on a reply...