- 23 Feb 2024
- 2 Minutes to read
- Print
- DarkLight
Display recommended Products with Web Product Relationships
- Updated on 23 Feb 2024
- 2 Minutes to read
- Print
- DarkLight
Available from version 1.31.
If recommended products should be displayed on the product page at least one recommende product relationship should be available. This page contains all information required to be able to associate a product to multiple recommended product and display them in the shop. Recommendations are two way relationships. Meaning product X is recommend for product Y and vice versa.
If Web Product layout v1.24 is assigned to a user all required components are available.
Add New Product Relationship action to Web Product layout
There is a custom action button which provides the ability to associate a Web Product to multiple other Web Products. If it's not on the page it's possible to add it with the following steps:
- Go to Salesforce setup -> Object Manager -> Web Product.
- In the Page Layouts section open de layout assigned to the user which should be able to add recommended products.
- Add the Lightning Action 'New Product Relationship' to the 'Salesforce Mobile and Lightning Experience Actions'. Override the default if necessary.
- Save the layout.
Add related products list to Web Product layout
To prevent having two related lists on the web product object page there is a component that displays all relationships where the specific product is either specified in the 'From' or 'To' field. Having this component on the Web Product object page helps to quickly identify the relationships associated to the web product. To add it to the page execute the following steps:
- Go to Salesforce setup -> Lightning App Builder.
- Open the web product page that is in use or create a new one.
- Add the 'Product Relationships' component on the required location.
- Save the page.
Create product relationships
Make sure the 'New Product Relationship' action is on the assigned page layout. For configuring the product to product relationship execute te following steps:
- Go to the web product which should have associated recommended products.
- Click on the 'New Product Relationship' action, it's in the lightning action section on the right top of the object page.
- Choose 'Recommended' in the 'Type' field .
- Select the Web Product that needs to be recommended in the 'Web Product To' field.
Add component to product page
To display recommended products in the shop the 'Recommended Products' component should be on the 'Web Product Details' page in the shop. In order to do this execute the following steps:
- Go to Salesforce setup -> Feature Settings -> Digital Experiences -> Sites.
- On the site that represents the shop click 'Builder'.
- In the 'Page' section (left top corner) search for 'Web Product Details' and open it.
- Open the component panel (lightning icon left in the page) and search for 'Recommended Products'
- Drag it onto the page in a horizontaly oriented section, like the footer section.
- Save and publish the site.