RE: Widget to show related products on details page?

Mark Clarke, modified 6 Years ago. Regular Member Posts: 107 Join Date: 3/3/12 Recent Posts
Hi all,

When a product is create there is an option to selected related assets. I would like to show these on the product details page but can't find a way to do this. I have tried the related assets widget but not sure how to link it to the product in the display details widget.

thanks
Alec Sloan, modified 6 Years ago. New Member Posts: 7 Join Date: 3/16/19 Recent Posts
Hi Mark,

You can use the Product Publisher to do this, simply configure it for what products you want it to show. 

  • You can select Dynamic and filter by catagory or tags
  • You can select Manual and manually assign each product you wont on that detail page
  • You can select datasource which enables you to render product relations you may have made on a products "Product Relations" tab in the admin catalog
Note that with the datasource option you'll likely need to reindex cpDefinition.

I'll attach a short video example.

Best,
Alec
Mark Clarke, modified 6 Years ago. Regular Member Posts: 107 Join Date: 3/3/12 Recent Posts
Thanks Alec!  Will implement.
Mark Clarke, modified 6 Years ago. Regular Member Posts: 107 Join Date: 3/3/12 Recent Posts
Hi Alec,

I don't have "product relation" as a data source option on my asset publisher. I reindex the "com.liferay.commerce.product.model.CPDefinition" option but it didn't make a different to the datasource drop down. I do have some products with "related" products populated. I am on 1.1.3.

​​​​​​​kind regards
Mark Clarke, modified 6 Years ago. Regular Member Posts: 107 Join Date: 3/3/12 Recent Posts
Hi Alec,

I think some posts were lost during the forum outage that occurred today as I was in the midst of posting a response to your suggestion that I run a health check on the commerce module when it all died and now it looks like your post has dissaperared.

In any event I did run the health check and enabled "Wishlist" and "Account Roles" but the "related products" option is still missing. See attached video.

thanks
Alec Sloan, modified 6 Years ago. New Member Posts: 7 Join Date: 3/16/19 Recent Posts
Hi Mark,

I see now, a video helps so much! While there should have been some relations created OOTB it looks like you're experience the issue reported in EMP-16, You should be able to manually create the relation groups in Control Panel > System Settings > Catalog > Product Relations.

I'm sorry I thought you weren't able to see the dataSource tab at all.

Best,
​​​​​​​Alec
Mark Clarke, modified 6 Years ago. Regular Member Posts: 107 Join Date: 3/3/12 Recent Posts
HI Alec,

Thanks all sorted now. Just updated the search index after adding the product relation types and related products are now displaying. I had to recapture them as I was able to add products to the "related products" tab on a catalolg item but there were no "types" on the left at that side.

​​​​​​​thanks