Hi Tomas,
Sorry about the long delay, but different responsabilities took me away from this. Here's the code (trimmed down) of what we used
@helper RenderProductSpecifications()
{
var productService = Dynamicweb.Ecommerce.Services.Products;
var productId = GetString("Ecom:Product.Number");
var product = productService.GetProductByNumber(productId, Dynamicweb.Ecommerce.Common.Context.Language.LanguageId);
//var variants = productService.GetProductsAndVariantsByProduct(product);
// var variants = GetLoop("VariantCombinations");
var group = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(GetString("Ecom:Product.PrimaryOrFirstGroupID"));
var variants = group.Products.Where(p => string.Equals(p.Id, product.Id, StringComparison.OrdinalIgnoreCase) && !p.IsVariantMaster);
var comparableFieldsFieldDisplayGroupId = Pageview.AreaSettings.GetItem("Custom").GetItem("CustomSettings").GetList("ComparableFields").SelectedValue;
var specificationsFieldDisplayGroupId = Pageview.AreaSettings.GetItem("Custom").GetItem("CustomSettings").GetList("SpecificationsFields").SelectedValue;
<section>
<div>
@getFieldDisplayGroupsMultiple(variants, Convert.ToInt32(comparableFieldsFieldDisplayGroupId))
</div>
<div>
@getFieldDisplayGroupsSingle(product, Convert.ToInt32(specificationsFieldDisplayGroupId))
</div>
</section>
}
@helper getFieldDisplayGroupsMultiple(IEnumerable<Dynamicweb.Ecommerce.Products.Product> variants, int displayGroupId )
{
var productCategoriesFields = Dynamicweb.Ecommerce.Services.FieldDisplayGroups.GetById(displayGroupId).FieldIds.ToString();
var groupName = Dynamicweb.Ecommerce.Services.FieldDisplayGroups.GetById(displayGroupId).Name;
List<String> groupFields = new List<String>(productCategoriesFields.Split(",".ToCharArray()));
<div>@groupName</div>
<table>
<thead>
<tr>
<th></th>
@foreach(var variant in variants)
{
<th>@variant.Name</th>
}
</tr>
</thead>
<tbody>
@foreach (var field in groupFields)
{
var categoryID = GetCategoryId(field);
var fieldID = GetFieldId(field);
<tr class="@hideRow @categoryID @fieldID dw-mod">
<td class="u-no-border-top u-border-bottom dw-mod">@GetCategoryName(field)</td>
@foreach (var variant in variants)
{
<td>@GetFieldDisplayValue(variant, field, categoryID, fieldID)</td>
}
</tr>
}
</tbody>
</table>
}
@helper getFieldDisplayGroupsSingle(Dynamicweb.Ecommerce.Products.Product product, int displayGroupId )
{
var productCategoriesFields = Dynamicweb.Ecommerce.Services.FieldDisplayGroups.GetById(displayGroupId).FieldIds.ToString();
List<String> groupFields = new List<String>(productCategoriesFields.Split(",".ToCharArray()));
foreach (var field in groupFields)
{
var categoryID = GetCategoryId(field);
var fieldID = GetFieldId(field);
var value = GetFieldDisplayValue(product, field, categoryID, fieldID);
if (value.IsNotNullOrEmpty())
{
<div>
<div>@GetCategoryName(field)</div>
<div>@value.ToString()</div>
</div>
}
}
}
Hope if helps you,
Nuno Aguiar