Skip to main content
Contributor I
October 13, 2022
Solved

Looping over {% catalog %} tag

  • October 13, 2022
  • 3 replies
  • 388 views

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.

    This topic has been closed for replies.
    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
    DovAnswer
    Klaviyo Alum
    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.

     

    DD
    gaurav.mAuthor
    Contributor I
    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
    Klaviyo Alum
    October 24, 2022

    Hi @gaurav.m,

    Glad that was helpful for you.

    Yes, that sounds correct.

    Thanks for being a community member.

    DD