Skip to content
10.8.0 hero (2)
Mads Bjernemose NielsenFebruary 20253 min read

Knowledge Base: Creating a Relationship

Product relations are used to connect different products within your store. Create product bundles by displaying similar products and recommendations (e.g. items frequently bought together by other customers).

For quick navigation:

 

How does it work?


Product relations can be either one-way or two-way connections between products, determined by a specific relation type. A product can have multiple relations to other products and be used in different contexts depending on the relation type.

two-way-relation


A two-way relationship example would be displaying matching shirts for dress pants and vice-versa, where the same dress pants appear when viewing the shirts.

A one-way relationship example would be displaying matching accessories next to a phone, but not necessarily the other way around, as it may not be relevant.

 

How to create a product relation type?


Before you start relating products one to another, we need to create a product relation type. The scenario we will be looking at relating is “similar products”. In order to create a product type you need to go to settingsproduct relation types section → create "new".

similar_products.gif

When you create a product relation type, you need to name it accordingly, so you know what use case it is for. In this scenario we will call it ‘similar products’.

ℹ️ For the new product relation type to work, you need to to adjust the API.

 

How to work with product relations?


Now let’s use the product relation type that has been just created. To do this we have to go to a product that we want to connect with other products.

  • 📝 Under the product find Relations section and click New.

  • You will be presented with the modal: • In the first step you need to select the relation type (what we have set up previously) and choose whether you want the relationship to be one-way or two-way. • When you continue you can pick the products you want to relate. Since we are relating similar products, we will select the products that are similar to the initial one.

  • Once we selected all relevant product, clicking add will finish the action, in the relations section you should be seeing all the product you have selected.

work_with_product_relations

 

avatar

Mads Bjernemose Nielsen

Backend developer at Ucommerce