Skip to main content
Solved

Image hide/show logic with OR statement


Forum|alt.badge.img+1

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?

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

View original
Did this topic or the replies in the thread help you find an answer to your question?

4 replies

Forum|alt.badge.img+1
  • Author
  • Contributor II
  • 4 replies
  • 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"


Forum|alt.badge.img+1
  • Author
  • Contributor II
  • 4 replies
  • 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
Forum|alt.badge.img+42
  • Community Manager
  • 431 replies
  • Answer
  • 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


Forum|alt.badge.img+1
  • Author
  • Contributor II
  • 4 replies
  • 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.


Reply