Table of Contents

Class BomGroupViewModel

Namespace
Dynamicweb.Ecommerce.ProductCatalog
Assembly
Dynamicweb.Ecommerce.dll

Represents a configurable BOM (Bill of Materials / bundle) group from which the customer selects one product option.

public class BomGroupViewModel : FillableViewModelBase
Inheritance
BomGroupViewModel
Inherited Members

Remarks

A BOM group defines a configurable slot in a bundle product. The customer must (or can) pick one product from Products to fill this slot. Use DefaultProduct to pre-select an option, and NoneSelectedText as the empty/placeholder label in a dropdown.

Typical Razor template usage — render the group as a <select>:

<select name="BomGroup_@group.Id">
    <option value="">@group.NoneSelectedText</option>
    @foreach (var product in group.Products)
    {
        var selected = product.ProductId == group.DefaultProduct?.ProductId ? "selected" : "";
        <option value="@product.ProductId" @selected>@product.ProductId</option>
    }
</select>

Properties

DefaultProduct

Gets or sets the product that is pre-selected by default in this group. May be null if no default is defined; in that case, use NoneSelectedText as the initial selection.

public ProductInfoViewModel? DefaultProduct { get; set; }

Property Value

ProductInfoViewModel

Id

Gets or sets the unique identifier of the BOM group. Use as the form field name when posting the customer's selection.

public required string Id { get; set; }

Property Value

string

Name

Gets or sets the display name of the BOM group shown as the group label or heading in the template.

public required string Name { get; set; }

Property Value

string

NoneSelectedText

Gets or sets the placeholder text to display when no product has been selected in this group (e.g. "-- Select an option --"). Use this as the label for the empty <option> in a dropdown.

public string? NoneSelectedText { get; set; }

Property Value

string

Products

Gets or sets the list of products available for selection in this BOM group. The customer picks exactly one from this list to configure the bundle slot represented by this group.

public required List<ProductInfoViewModel> Products { get; set; }

Property Value

List<ProductInfoViewModel>

See Also

To top