Developer forum

Forum » Templates » BOM samples
Peter Leleulya
Reply

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.
 


Replies

 
Nicolai Høeg Pedersen
Reply

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>&nbsp;&nbsp;&nbsp;</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>

}

 

 

 
Peter Leleulya
Reply

Thanks nicolai, I'll give it a try

 
Peter Leleulya
Reply

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?

 
Nicolai Høeg Pedersen
Reply

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

 
Peter Leleulya
Reply

Thanks for the info, now I can stop puzzling ...

 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer

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

Votes for this answer: 1

 

You must be logged in to post in the forum