Skip to main content

I’m trying to build a show/hide logic block in Klaviyo that only shows an image if someone has not purchased a specific product. We’re using the Placed Order event from Shopify, and I’d love help figuring out the best syntax or condition setup for this.

Has anyone implemented something similar? Ideally, I'd want the logic to look for the product name within the Placed Order event history and only show the image if the user has not placed an order overall with it.

Any suggestions, examples, or workarounds would be much appreciated.

 

Thanks in advance!

Hello ​@almammm ,

 

You are on the right track using the places order event. To hide the image if someone already bought a specific product, you can use this condition inside a show hide logic block: 

 

person|lookup:'Placed Order'|where:'Items.ProductName','equals','Your Product Name'|length == 0

 

 

This checks all placed order events and filters by product name. If none match, the image shows. If they bought it, it stays hidden .

 

Just replace "your product name" with the exact name from shopify. Test with a profile that hasn't ordered the item yet and one that has, so you are sure it behaves as expecting.

 

Let me know if this answer your question!


Hi there! Thanks so much for your reply.

The logic you suggested doesn’t seem to be working on our end. I’m wondering if it might be due to the event that’s triggering the flow — we’re using the “Ordered Product” event, but the lookup is pulling from the “Placed Order” event. Could that be causing the issue?

Ideally, I’d like to run the lookup against historical “Ordered Product” events instead, but I understand that each “Ordered Product” event only contains data for a single item, not the full purchase history — which is why I was originally trying to use “Placed Order.”

Is there any way to access historical “Ordered Product” data in the logic to check if someone has ever purchased a specific item?

Thanks again for your help!


Hi ​@almammm ! 

Unfortunately it isn’t possible to show/hide based on previous placed orders. If your flow is triggered by the Placed Order metric, you can filter based on the specific Placed Order event that triggered the flow, but not based on past Placed Orders. I apologize for the limitation! As a workaround, you may consider using a dynamic product feed that shows products a customer may also like depending on their past purchases. For more, please see our guide How to use product feeds and recommendations . 

I hope this helps, and let me know if you have any further questions! 


Reply