Skip to main content
Contributor II
March 10, 2023
Solved

Image hide/show logic with OR statement

  • March 10, 2023
  • 4 replies
  • 640 views

event.ShippingRate|default:'' = 'Standard Shipping (with Tracking)'

^^ this works fine so far for showing an image in the conditional logic.

I want to include an OR statement to also include ‘Standard Shipping (with Tracking) - Free Activated’

I’ve tried a number of combinations and can’t get this to work

Can someone please help?

    This topic has been closed for replies.
    Best answer by chloe.strange

    Hi @Weaverc

    Apologies for the delay here. Have you referenced this Help Article? It should help get you down the right path. I would first recommend that you double check the event variables by following the steps below:

    1. From the template editor, click Preview and Test
    2. Under Preview data source, click Event
    3. From the dropdown menu, select the event that will trigger the message you’re building 
    4. Scroll through the Event properties to find the property you’d like to include 
    5. Click the property name to copy the variable 
    6. Paste the variable into a text block or text editor 
    7. Remove the curly brackets (i.e., {{ and }}) from around the variable, as well as any filters
    8. Use the variable that remains in your show/hide condition

    Let me know if other questions come up!

    ~Chloe

    4 replies

    WeavercAuthor
    Contributor II
    March 10, 2023

    Ok I did get this to work like this, i’m not sure if its correct:

    event.ShippingRate|default:'' = 'Standard Shipping (with Tracking)'  or event.ShippingRate|default:'' = 'Standard Shipping (with Tracking) - Free Activated'

    but how do I now wrap this in an “and” statement to include the following: 
    if event.extra.line_items.0.product.tags includes "8Days"

    WeavercAuthor
    Contributor II
    March 10, 2023

    this doesn’t work;

    event.ShippingRate|default:'' = 'Standard Shipping (with Tracking)'  or event.ShippingRate|default:'' = 'Standard Shipping (with Tracking) - Free Activated' and event.extra.line_items.0.product.tags|default:'' = ‘8Days’

    chloe.strange
    Community Manager
    Community Manager
    March 17, 2023

    Hi @Weaverc

    Apologies for the delay here. Have you referenced this Help Article? It should help get you down the right path. I would first recommend that you double check the event variables by following the steps below:

    1. From the template editor, click Preview and Test
    2. Under Preview data source, click Event
    3. From the dropdown menu, select the event that will trigger the message you’re building 
    4. Scroll through the Event properties to find the property you’d like to include 
    5. Click the property name to copy the variable 
    6. Paste the variable into a text block or text editor 
    7. Remove the curly brackets (i.e., {{ and }}) from around the variable, as well as any filters
    8. Use the variable that remains in your show/hide condition

    Let me know if other questions come up!

    ~Chloe

    WeavercAuthor
    Contributor II
    March 18, 2023

    I ended up ditching the conditional logic in the show/hide image feature and just went to a text box with coding and html. Thanks anyway.