Solved

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

  • 14 February 2023
  • 1 reply
  • 293 views

Badge +2

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

 

icon

Best answer by In the Inbox 14 February 2023, 18:36

View original

1 reply

Userlevel 7
Badge +29

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 

Reply