Posted on 21/01/2019 23:38:18
Hi Martin
Duely noted - we might include in 3.2.
The BOM implementation has not changed radically since it was introduced in DW6, so you can use the same approach as always. Here is a Razor example.
@if (GetLoop("BOMProducts").Count > 0){
<div class="col-md-12 col-xs-12" id="includingproducts">
<hr></hr>
<h3 class="section-title">@Translate("Including products", "Including products")</h3>
@foreach (LoopItem bomproduct in GetLoop("BOMProducts")){
var bomimage = bomproduct.GetString("Ecom:Product.ImageSmall.Clean");
<ul>
<li class="bomlist"><a href="@bomproduct.GetString("Ecom:Product.Link.Clean.PID")">
<img src="/Admin/Public/GetImage.ashx?width=50&image=@bomimage&Compression=99" alt="">
<text> </text>@bomproduct.GetString("Ecom:Product.Name")
</a></li>
</ul>
}
<table cellspacing="0" cellpadding="0" border="0">
@foreach (LoopItem bomconfig in GetLoop("BOMConfigurators")){
<tr>
<td>
<b>@bomconfig.GetString("Ecom:Product.Configurator.Name")</b><br>
<select name="@bomconfig.GetString("Ecom:Product.Configurator.ID")">
@foreach (LoopItem configproduct in GetLoop("ConfiguratorProducts")){
<option value="@configproduct.GetString("Ecom:Product.ID")" @configproduct.GetString("Ecom:Product.Configurator.Selected") > @configproduct.GetString("Ecom:Product.Name") ( @configproduct.GetString("Ecom:Product.ActualPrice")" ) </option>
}
</select>
</td>
</tr>
}
</table>
</div>
}
Also find attached a full product template that includes bom and variants.
BR Nicolai