Developer forum

Forum » Ecommerce - Standard features » Show BOM products on product detail

Show BOM products on product detail

René Poulsen
René Poulsen
Reply

Hi,

I have a solution where I don't want to show BOM products in the producstlist. I only want to show them on product detail.

So I have product A which is just a good old regular product. I go to the page that shows product A.

Product A is also, together with another product (product B), part of a BOM (product C). So on the page showing product A I want to find this BOM and show the products that are part of this (+ an add to cart button etc.). Is this possible? I can ony see the products in the BOM if I access the product C page - and not when accesssing the product A (or product B) page.

I've tried using the BOMProducts loop (https://doc.dynamicweb.com/template-tags/ecommerce/product-catalog/product#BOMProducts), but this shows nothing on the product A page.
I've also tried to find something in the API that might be able to do this for me, but haven't found anything so far.

Is this possible in any way?


Replies

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi René,

 

If I understood you correctly, Product A does not have BOM products, that's why the loop is empty. Only Product C does.

 

Since you are using a reverse logic, it's not that easy to get that list. The easiest solution might be using the index (although I am not sure BOM products are indexed, but you can do that with an IndexBuilderExtender) and then get all products of type "Parts List" (like Product C) that contain the current product (Product A in this case).

 

Best Regards,

Nuno Aguiar

 
René Poulsen
René Poulsen
Reply

Yeah, it's reverse logic. I just want to show regular products - and show the "packages" (BOMs) on the regular product.
I guess I'll have to take a look at the index to see if it's possible to make a query.

Thank you for the input.

 

You must be logged in to post in the forum