Hi,
On a standard Swift 1.21.0 (DW 9.15.6) I have created 4 BOM products. I have then made it possible to select BOM items by following this forum post. While three of products works as intended, one of them does not. It is marked in Image 1 below. On that product I have selected a group with variants as a BOM item. The user should be able to select a variant and add to cart, but I cannot figure out how to do that. In Image 2 you’ll see the code that generates the dropdown shown in Image 3. The code in Image 2 works for products without variants, as it is using @configproduct.GetString("Ecom:Product.ID") as value for the options. However, if I want to add a variant, it will add the variant’s master product with the BOM product instead, which makes perfect sense. So I have tried a few options to get around this:
- Setting the value of the option to @configproduct.GetString("Ecom:Product.Number") – does not work, which makes sense as multiple products can have the same product number. It adds the first product in the list no matter what is selected.
- Setting the value of the option to @configproduct.GetString("Ecom:Product.CompareID") – does not work. As the CompareID is unique for each variant, it would make sense that this could be used to identify variants in the BOM configurator. It adds the first product in the list no matter what is selected.
I hope there is a solution to this. I have faced this problem on two projects now - a Rapido running 9.12.5 and a Swift running 9.15.7.
Kind regards,
Roald
Image 1
Image 2
Image 3