Are there razor samples available for BOMConfigurators and BOMProductItems using form fields?
I can't figure out how to set this up properly.
Thanks in advance.
Developer forum
E-mail notifications
BOM samples
Replies
Will this help - or are you missing something in specific?
@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>
}
Thanks nicolai, I'll give it a try
Nicolai,
When I have order line fields and I want to set the value of the Parts list product different to the part product, how do I do that?
In both cases I'm suggested to use <input type=text name=EcomOrderLineFieldInput_FieldnName size=255 /> but that results in a concatenation in the Orderline XML Node of the Part list product and empty node in the part product Prderline XML.
How do I discriminate between parent and child input fields?
Hi Peter
That is not possible from the products add to cart form. You would have to build a notification subsriber Notifications.eCommerce.Cart.Line.Added
You can update them on the cart though, using the OrderLineFieldValue_{orderLineID}_{OrderLineFieldSystemName} tag.
BR Nicolai
Thanks for the info, now I can stop puzzling ...
I've created TFS#18682 for 8.7.0.4 that includes this feature. So you would be able to do <input type=text name=EcomOrderLineFieldInput_{orderLineField.SystemName}{BOMItemID}> on your product add to cart form.
Due sometimes next week.
BR Nicolai
You must be logged in to post in the forum