Developer forum

Forum » Ecommerce - Standard features » BOM Products and quantity

BOM Products and quantity

Aki Ruuskanen
Aki Ruuskanen
Reply

Hi,

I have problem with the quantities in BOMProducts. 

I can select different quantities for the BOMProducts. So thats fine. 

But if a select for example 100 of the main product, all the BOMProducts also get 100 in quantity. 

And if an select "3" for one of the BOMProducts and "10" on the main product, the BOMProduct gets "13" as quantity. 

Testpage: http://rapidodemo.softgear.se/english/testproducts/massa-och-event/visitkort-standard

Code:

<form action="" method="post" class="">
    <div class="row no-gutters product-quantity-controller">
        <div class="col-3 col-lg-2 amount">
            <input type="hidden" name="productid" value='@GetValue("Ecom:Product.ID")'>
            <input type="hidden" name="cartcmd" value="add">
            Antal:<input id="quantity" ="NumericQuantityText w-100 h-100 text-center border-0" maxlength="4" name="quantity" type="text" value="1">
        </div>
    <div>
    @* BOMProducts *@
    @if (GetLoop("BOMProducts").Count > 0)
    {
        <h2 class="section-title">Dessa följer med</h2>
        foreach (LoopItem BOMProductItem in GetLoop("BOMProducts"))
        {
            string link = "/" + BOMProductItem.GetString("Ecom:Product.LinkGroup.Clean") + (!String.IsNullOrEmpty(BOMProductItem.GetString("Ecom:Product.VariantID")) ? "&VariantID=" + BOMProductItem.GetString("Ecom:Product.VariantID") : "");
            <div class="grid__col--border grid">
                <div class="grid__cell grid__cell--align-middle-left">
                    <a href="@link" class="u-pull--left u-margin-right">
                        <img src="/Admin/Public/GetImage.ashx?width=50&image=@BOMProductItem.GetString("Ecom:Product.ImageSmall.Default.Clean")&Compression=99" />
                    </a>
                    <a href="@link">@BOMProductItem.GetString("Ecom:Product.Name") - @BOMProductItem.GetString("Ecom:Product.Price")</a>
                </div>
            </div>
        }
    }
    <h2>Välj utrustning:</h2>
    @foreach(LoopItem li in GetLoop("BOMConfigurators")){
        <div>
        <h4>@li.GetValue("Ecom:Product.Configurator.NoneSelected.Text")</h4>
        <input type="text" value="1" name='@li.GetValue("Ecom:Product.Configurator.ID")Quantity' />
        <select name='@li.GetValue("Ecom:Product.Configurator.ID")'>
        @foreach(LoopItem cp in li.GetLoop("ConfiguratorProducts")){
             <option value='@cp.GetValue("Ecom:Product.ID")' >@cp.GetValue("Ecom:Product.Name") (@cp.GetValue("Ecom:Product.ActualPrice") SEK) </option>
        }
        </select>
  </div>
}

</div>
    <div class="col-12 col-lg-4 cart-button-wrapper">
        <input type="submit" alt="KÖÖP" value="KÖP" class="btn btn-primary btn-buy float-right w-100">
    </div>
</div>
</form>

Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Aki

That is how it was originally designed.

Some wants Buy X configurations consisting of 2 Y and 3 Z each.

Where others wants Buy X configurations consisting of 2 Y and 3 Z, giving a total of X*2 of Y and X*3 Z. Because then the numbers add up in the ERP.

You want to change combinations on both parameters and DW cannot handle that. It thinks that you add 100*product 1 + 3 more.

An 'easy' way of solving this is to handle what number you want in custom fields on the template, and update the records on the order accordingly. Be aware that price calculations can get really tricky depending on you calculation method chosen on the product.

BR Nicolai

Votes for this answer: 1
 
Aki Ruuskanen
Aki Ruuskanen
Reply

Alright. Thanks. 

/Aki

 

You must be logged in to post in the forum