Related products

Related products are products which are, well, related to a product in some way - they are displayed on the product page in a separate section, as in Figure 1.1.

Figure 1.1 Related products

The nature of the relationship - e.g. Wheels for this bike above - is defined under a relation group. Relation groups are typically solution-specific, which means that you have to create a new set of relation groups for each project.

To create a relation group:

  • Go to Settings > Ecommerce > Product catalog > Relation groups
  • Create a new relation group (Figure 1.2) and name it
  • Click Save and close.
Figure 1.2 Create a new relation group

Once the relation group is created, you can use it to add related products to a product:

  • Go to the Ecommerce area and open the product details for your product 
  • In the ribbon bar, click Related products to open the related products interface
  • Click Add related products and select your relation group (Figure 1.3
Figure 1.3 Add the relation group to your product
  • Mark the products that should be shown as related products
  • Click Save and close
Figure 2.1 Select your related products

Now, the products index must be rebuild. Because this is a brand new relation group that you've just created and want to use, you must build the index manually to index the new relation group as well - the auto-build index functionality doesn't register new relation groups.

So:

  • Go to Settings > Repositories > Products
  • Open the Products index
  • Rebuild one of our instances (Figure 2.2)
  • Save and close
Figure 2.2 Rebuild the products index

If you've only added new related products using an existing relation group, then the relation group is already registered. Therefore, if your shop is set to auto-build the products index when products are updated, then you don't need to do anything.
If the auto-build is disabled on your shop, then you must still rebuild the index manually.

This rebuild accomplished two things - the product relation is indexed, and the new relation group is indexed and can be added to the summary field used to query for related products:

  • Scroll down to the Fields section of the index page
  • Locate the Related product search field
  • Click it to open the field definition window
  • Add the new relation group to the list of source fields (Figure 3.1)
  • Click OK
  • Save
Figure 3.1 Adding a new relation group to the related products search field

Once the new relation group has been added to the summary field, rebuild the index again.

Now open the product page in frontend - you should see related products rendered under the relation group name, as in Figure 4.3.

Figure 4.3 End result in frontend