Skip to main content
Contributor II
February 14, 2023
Solved

Show/hide Logic based on a purchase of a particular item

  • February 14, 2023
  • 1 reply
  • 638 views

Hi everyone,

 

I’m trying to show/hide an image when a person purchases an item called “Serum + BC” or “Serum + BC Sku 2”.

 

I tried to use the variable: event.ProductNames.0 but Klaviyo is showing an error when rendering the email.

 

I already read Klaviyo’s documentation but it’s not clear how to apply the logic when you’re trying to use an event on a particular request.

 

Can you please help? Thanks!

 

What I’ve read: https://help.klaviyo.com/hc/en-us/articles/7655965301531-How-to-show-or-hide-template-blocks-and-sections-based-on-dynamic-variables-new-editor-

https://help.klaviyo.com/hc/en-us/articles/7655926841499

 

    This topic has been closed for replies.
    Best answer by In the Inbox

    Hi @AlmaMedinaaa,

    Thank you for posting your question in the community. 

    I love the show/hide logic in Klaviyo, but it can be a little tricky to configure. 

    A couple of assumptions:

    • I assume you are using the Placed Order event to trigger the email
    • The names of the products must match exactly to what is passed through via the Placed order event

    In order to show an image for the products “Serum + BC” or “Serum + BC Sku 2” and hide it for all other products, you would set up the Show/Hide logic as follows:

    'Serum + BC' in event.Items or 'Serum + BC Sku 2' in event.Items

    Give that a try! 

    @In the Inbox 

    1 reply

    In the Inbox
    Partner - Platinum
    2025 Champion
    February 14, 2023

    Hi @AlmaMedinaaa,

    Thank you for posting your question in the community. 

    I love the show/hide logic in Klaviyo, but it can be a little tricky to configure. 

    A couple of assumptions:

    • I assume you are using the Placed Order event to trigger the email
    • The names of the products must match exactly to what is passed through via the Placed order event

    In order to show an image for the products “Serum + BC” or “Serum + BC Sku 2” and hide it for all other products, you would set up the Show/Hide logic as follows:

    'Serum + BC' in event.Items or 'Serum + BC Sku 2' in event.Items

    Give that a try! 

    @In the Inbox 

    Bryan Richey // Klaviyo Champion & Email Strategist at In the Inbox // https://intheinbox.co/