Onsite Templates with Product Data (advanced)

You are here:
Estimated reading time: 1 min

You can display product recommendations in any onsite campaigns, using a custom format for the template.

For more info on classic interaction template format read more here.

When you add a new campaign variation to any campaign, you have the option to use the visual editor.

In order to use it, you have to choose what type of interaction you want. In this case, you have to choose the “Display product triggers” option.

interaction

Product Recommendations Content

You can choose one of our existing popups with product recommendations or you can create one from scratch.

Screenshot-from-2016-02-18-17-22-32

Interaction templates can contain product information:

  • product added to cart
  • most relevant product for user
  • specific product
  • from specific category
  • advanced

By selecting any of these options, your template will include product information.

By default there is only 1 product returned from the recommender engine. To display product data:

Put all html into the specific loop:

{% for product in products.pos01 %} 
<div> product information </div>
{% endfor %}

Use vtproduct attribute

Use vtproduct="pos01" as html attribute and we will add the loop inside this tag.

<ul vtproduct="pos01">
<li reccs-item>
</ul>

Product dynamic tags

Use product tags  to display item related information:

**|product.title|** Title of the product

**|product.url|** Url of the product – use for links

**|product.image|** Url of the product image – use to display product image

**|product.discount|** Percentage of the discount (calculated automated.

**|product.price|** Product price – use to display product price

**|product.discountPrice|** Product discount price – use to display product discount price (if exists)

If you have more attributes added from product feed configuration, feel free to use them using the following dynamic tag: **|product.attribute_name|** where attribute_name is the name of the attribute.

 

Conditional tags:

You can use logic inside the template as the following example:

{% if loop.index0 is divisibleby 3 %} SOME HTML {% endif %}

{% if product.discountPrice %} SOME HTML {% endif %}

Was this article helpful?
Dislike 0
Views: 15