Skip to main content
Solved

Looping over {% catalog %} tag

  • October 13, 2022
  • 3 replies
  • 333 views

Forum|alt.badge.img+2

I have a product catalog and I want to programmatically access that catalog in my email templates. I am able to access a single catalog item using a syntax like:

{% catalog itemId %}
{{ catalog_item.title }}
{% endcatalog %}

However, I am not able to figure out how to perform advanced operations on catalog collection programmatically.

For example, I would like to find top 10 highest rated items from the catalog in a particular category and then randomly pick 3 items from that list and use those in an email template.

Any insights regarding this will be highly appreciated.

Best answer by Dov

Hi @gaurav.m,

Thanks for sharing this question with us.

This article contains some strategies you may find helpful to achieve your goal. Also keep in mind that the catalog lookup feature is designed for tech-savvy marketers or customers who have access to a developer.

I hope that’s helpful.

 

3 replies

Dov
Forum|alt.badge.img+61
  • Klaviyo Alum
  • 1493 replies
  • Answer
  • October 13, 2022

Hi @gaurav.m,

Thanks for sharing this question with us.

This article contains some strategies you may find helpful to achieve your goal. Also keep in mind that the catalog lookup feature is designed for tech-savvy marketers or customers who have access to a developer.

I hope that’s helpful.

 


Forum|alt.badge.img+2
  • Author
  • Contributor I
  • 1 reply
  • October 14, 2022

Hi @Dov - Many thanks for this link. This is going to be indeed very helpful. If I understand correctly, this is going to be the process:

  1. Create separate product feeds for each criteria of our email. This feed will now only contain the products we are interested in including in our email.
  2. Use the product feed and logic mentioned in the linked article to get the information about individual products that can be included in the email.

Am I correct?

Thanks


Dov
Forum|alt.badge.img+61
  • Klaviyo Alum
  • 1493 replies
  • October 24, 2022

Hi @gaurav.m,

Glad that was helpful for you.

Yes, that sounds correct.

Thanks for being a community member.