I have a requirement when creating orders from Shopify to NetSuite. The logic is this:
If line_items[].sku = “BASE”, then output ‘Order Protection’
If line_items[].sku contains “TIER”, then output ‘Order Protection’
Else output line_items[*].sku
I've tried many handlebar statements. At this point I have this:
If I put a handlebar of just {{{line_items.*.sku}}} then the lookup works and the order is imported.
I believe this handlebar should work, but does not.
{{#compare line_items..sku "==" "BASE"}} Order Protection {{else}} {{#contains line_items..sku "TIER"}} Order Protection {{else}} {{{line_items.*.sku}}} {{/contains}}{{/compare}}
This simplified version does not work either:
{{#compare line_items..sku '===' 'BASE'}}Order Protection{{else}}{{{line_items..sku}}}{{/compare}}
Any thoughts on how to get this to work?