Skip to main content

So we are accepting back orders from customers now (on Woo) and this comes across in Klaviyo as 

{{ event.extra.Items.0.Metadata.0.Name }} and the label says “Name: Back-ordered”

I know I am doing the below wrong but could somebody help me with the exact logic required? 

“{% if "Back-ordered" in event.extra.Items.Metadata.Name %} Text

{% endif %}

 

 

Hey @SDBradfo 

Thanks for reaching out for help with your variable syntax and writing If statements

Overall, what are you trying to accomplish by using this syntax? Are you using it in a campaign or a flow? If it’s a flow, what metric are you using for the trigger? Generally more information would be needed to determine exactly how to write the IF statement based on what you are trying to accomplish and what event variable should be used. Please let me know more details so we can dig deeper for a clear and easy to follow solution!

I’ll be on the lookout for your response! 


Hello thanks for the reply.

 

It is in a flow for the “new order” trigger from Woocommerce.

Basically if it contains the word “back-order” we will output some text explaining the process from our side 

Hey @SDBradfo 

Thanks for reaching out for help with your variable syntax and writing If statements

Overall, what are you trying to accomplish by using this syntax? Are you using it in a campaign or a flow? If it’s a flow, what metric are you using for the trigger? Generally more information would be needed to determine exactly how to write the IF statement based on what you are trying to accomplish and what event variable should be used. Please let me know more details so we can dig deeper for a clear and easy to follow solution!

I’ll be on the lookout for your response! 

 


@SDBradfo 

It may be possible to accomplish this, do you know if the status of the item (whether it is back-ordered or not) is stored as a product attribute?  If so, it may be possible to modify your client's WooCommerce integration so that these product attributes are synced into Klaviyo. 


@SDBradfo

It may be possible to accomplish this, do you know if the status of the item (whether it is back-ordered or not) is stored as a product attribute?  If so, it may be possible to modify your client's WooCommerce integration so that these product attributes are synced into Klaviyo. 

Yes it’s under MetaData (see image) 

 

I am thinking something like 

“{% if "Back-ordered" in event.extra.Items.Metadata.Name %} Text

{% endif %}” 

Should work?

 


So I can only get it to work with this

 

{% if "_alg_wc_cog_item_cost" in event.extra.Items.0.Metadata.0.Name %}
{% endif %}

but obviously it won’t always be on Line 0.


Reply