Posted on 08/08/2023 14:46:56
The template looks like this:
@inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>>
<h1>Name: @GetString("Ecom:Product.Name")</h1>
<p>ID: @GetString("Ecom:Product.ID")</p>
<p>VariantID: @GetString("Ecom:Product.VariantID")</p>
<hr/>
<h2>ProductRelatedGroups</h2>
<ul>
@foreach (LoopItem relatedGroup in GetLoop("ProductRelatedGroups"))
{
<li>
RelatedGroup.Name: @relatedGroup.GetString("Ecom:Product:RelatedGroup.Name") - Product count: @relatedGroup.GetLoop("Products").Count
</li>
}
</ul>
<hr/>
<h2>VariantCombinations</h2>
<ul>
@foreach (LoopItem item in GetLoop("VariantCombinations"))
{
<li>
@item.GetString("Ecom:Product.VariantLinkGroup")
</li>
}
</ul>
<hr/>
I have a test site here:
http://thermex.test001.webtester.dk/produkter/emhaetter/vaeghaengt-emhaette/mini-perpignan
All products in the related group "Eksterne motorer" has applied the settings shown in the first post. So i would expect all products with the variant option "Med motor" not to have any related products in the "Eksterne motorer" group.
--
All the best, Jesper