Why aren't my Liquid variables giving me the Shopify data I expect?
Most often, this is because of a misalignment between the Liquid variables that Shopify uses in their email notifications or for storefront templates, and the Shopify REST API.
For all of Mechanic's Liquid objects that are based on Shopify data, we use data from the Shopify REST API. The data structures here are widely similar, but do have variations: for Shopify emails, for example, you might use {{ order.shipping_address.street }}
, but in Mechanic you'd need to use {{ order.shipping_address.address1 }}
.
For a definitive overview of the properties available on each Liquid object, search our documentation for the appropriate object. Our Liquid section has one article for each Liquid object type that we support, when working with Shopify data. Or, you can jump directly to the appropriate documentation at shopify.dev. (For example, see Shopify's official list of Order properties.)
And remember: if you're ever unsure what properties a Liquid object contains, use the "log" tag to log the complete object to the task result. This is the best way to find out exactly what data you have available.