Liquid Templating

Liquid is a template language offered by the Shopify platform.

Before continuing to read this article, it is recommended that you know how to use Shopify Liquid. Please review the Shopify developer documentation for more information.

These are the recommended filters, operators, and tags to use from Shopify Liquid in your MESA workflows:

if, else, for, ==, or, and contains

Here are a few MESA workflow templates that use Shopify Liquid:

The most common example of Shopify Liquid can be found in the Add product options to Shopify order notes template. Shopify Liquid is being used in the Note field of the Shopify Order Note Update action.

The Shopify Liquid allows displaying these details for each product from the Shopify order. This will be added to the order note.

  • Product Title

  • Product SKU

  • Line Item Properties

An adjustment that can be made in the Shopify Liquid is to limit which line item properties display in the order notes. You will need to add an if tag mentioned in the Shopify developer documentation.

The following two lines need to be added in the appropriate placement.

{% if property.name == 'Customization' or property.name == 'Color' %}

{% endif %}

If you would like to specify multiple line item properties, you can add the or operator.

The following two lines will need to be added in the appropriate placement.

{% if property.name contains 'Customization' or property.name contains 'Color' %}

{% endif %}

The above example uses the == operator. That means the line item properties' names must match the words Customization or Color exactly.

If you prefer to do partial matching, you can replace the == operator with the contains operator.

{% if property.name contains 'Customization' or property.name contains 'Color' %}

{% endif %}

Note: Capitalization is very important when typing out the line item properties' names. Please double check your capitalization for the names.

Whitespace Control

By including hyphens in your Liquid tag, you can strip any whitespace (extra spaces) that may be showing in text that are not needed.

Here is how to make this adjustment.

{%- if property.name contains 'Customization' or property.name contains 'Color' -%}

{%- endif -%}

👋 If you need any assistance with adjusting Shopify Liquid, please contact us at contact@getmesa.com. We are happy to help!

Last updated