Developer forum

Forum » Dynamicweb 10 » BOM in DW10
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

We now have a set of VieModels associated with BOM products.

I have managed to get a hold of the BOMConfiguration but I cannot figure out how to calculate the price of the BOM depending on the different options selected.

Has anybody else managed to solve this issue?

Thank you,

Adrian


Replies

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,
On the same topic, does anybody know what the add-to-cart form should look like for a configurable BOM?

I suppose it is different than a regular addMulti.

Thank you,
Adrian

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

I have finally managed to add a configured product to the cart but it seems that the price of the product is not calculated based on the options selected:

 

I have checked the EcomOrderLine table and it seems to be correctly saved:

 

The product is configured to use Fixed + Calculated:

I am running on DW10.13.3.

Thank you,

Adrian

 

 

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Adrian

Can you show the configuration of the BOM?

It is fixed price plus changes - so if you have a default selected item in one of the configuration groups, that default item will be part of the fixed price - and then only if you choose another item for that bom group, will the price change.

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

It is set up exactly like that.
I have one item (Display 13 Inch) and 4 groups, the product is set as Fixed+Changes but apparently the order calculation completely ignores this selection.

I have struggled for a while to get the correct form for adding to the cart but it seems (from the database) that the products are added correctly and assigned to the correct ParentOrderline.

But, as you can see from my screenshots, only the price of the product is considered for the order total. Just as it would have been defined as "Fixed".

Adrian

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

If you want to play around with it: https://dw10.ignite.commergent.ro/

The configured product is assigned to the "Mac" group and it is called MacBook Air Configurable.

Adrian

 

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Any news on this topic?
I need to know if there is something in DW preventing the correct calculation or in my logic for adding to the cart.

Thank you,

Adrian

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Adrian

Yes, sorry - thought you did get the answer.

I got this from the developer looking into it - see if this fixes your issue.

It looks like the problem is due a bug in js method  updateConfigurator() which is called every time when an user changed configuration.
The problem is with the first call - when product page is just loaded.
Note, I changed currency to RON - as it is default currency, just to avoid rate recalulations
 
So, at the start (see screen 1) the method takes product price:
string price = product.Price.PriceFormatted;  // 4462,5
Which already includes prices of product default items, and added prices of default items second time.
4462,5 + 59.5 + 595 + 238 = 5355 
At the end of loading you see screen 2
Note, in the cart you see the correct price
 
screen 1 - loading start
 
srceen 2 - page loadded

 

You must be logged in to post in the forum