Would you like to place multiple rows of dynamic products in an e-mail, containing, for example, 3 products per row? This article will tell you how to do that.
Step 1: add a dynamic product row
Step 2: number the products
Step 3: add a fallback
Step 1: add a dynamic product row
Navigate to Rows. Choose the desired dynamic row that is not a loop. So you can use all dynamisc products without "all" in front of it. Drag the row to the desired place in the email.
Step 2: number the products
Each product in a dynamic row that is not a loop is numbered. Each product defaults to 0. To prevent the customer from seeing the same product several times, you need to adjust these numbers per product. You do this numbering in the following four places:
In the liquid of the product name: {{ products.[0].name }}
In the liquid of the description: {{ products.[0].short_description }}
In the liquid of the button: {{ products.[0].url }}
In the liquid of the image: {{ products.[0].main_image }}
Step 3: add a fallback
To prevent profiles with fewer (e.g. last ordered- ) products from seeing an empty row, change the condition of the dynamic row. Select the row, under dynamic content on the right, click edit condition. In the "Before" box, add the following liquid:
{% if products[0] != nil %}
Here you enter the number you gave to the other variables earlier. You repeat this for all the blocks you might want to omit.
Example: First block contains products 0 to 2, then the liquid is:
{% if products[0] != nil %}
The second block contains products 3-5, then the liquid is
{% if products[3] != nil %}
Want to know more about using liquid and manipulating it? Read more about email personalisation options.