Hello, I’m currently building a logic that displays blocks like this.
event.extra.line_items.0.product.variant.sku == Product A or event.extra.line_items.0.product.variant.sku == Product B and event.extra.line_items.0.product.variant.sku == Product C
This syntax works but not how it’s supposed to. The logic I want is (A+B) * C but what’s happening is A + B*C. I want Either A or B to be paired with C not only B. I’ve tried several characters to group {}, () but none of them worked. Can anyone confirm if what I’m trying to do is possible in Klaviyo Show/Hide block logic? Thanks!
Page 1 / 1
Hi
At this time, Klaviyo does not support nested logic using the show/hide field within the template editor. You would need to use nested IF logic using the <source> button, but that might not apply to this use case.
The code would look something like this:
{% if CONDITION_C %}
{ % if CONDITION_A %}
this would show if CONDITION_A AND CONDITION_C are TRUE
{% elif CONDITION_B %}
this would show if CONDITION_B AND CONDITION_C are TRUE
{% else %}
this would show if only CONDITION_C is TRUE
{% endif %}
You can learn more about this in the If-Else Blocks section of our Guide to Template Tags and Variable Syntax help center article and furthermore you'll find additional details here.
I hope this helps to clarify!
- Brian
Reply
Log in to the Community
Use your Klaviyo credentials
Log in with Klaviyo
Use your Klaviyo credentials
Log in with KlaviyoEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.