Alpaca can add tags to your Shopify orders automatically. You set these up in Settings → Orders & checkout → Order tags.
Each tag you add can be plain text, such as alpaca, which is added to every order. It can also use Liquid, so the tag depends on the order. For example, you can tag only orders that have been packed, or tag each order with its pickup location.
There are also two built-in options on the same page:
Tag orders with pickup time (if applicable)
Tag orders with delivery time (if applicable)
When does Alpaca apply order tags?
Alpaca works out your order tags and updates them on the order whenever one of these happens:
A new order is placed.
You mark an order as packed or partially packed in Alpaca.
You unpack an order in Alpaca, moving it back to new.
You mark an order as fulfilled in Alpaca. This includes bulk updates and completing a stop on a delivery route.
You cancel an order in Alpaca.
The customer reschedules their pickup or delivery time from their order status page.
You change the delivery method for an order.
You remove the scheduled time from an order.
An order is marked as abandoned automatically.
Each time, Alpaca re-checks every tag rule. It adds tags that now apply and removes ones that no longer do. For example, a "packed" tag is removed if the order is unpacked.
Changes made outside of Alpaca
Tags aren't updated when an order changes in Shopify rather than in Alpaca. Examples are fulfilling or cancelling an order directly in Shopify, or cancelling a fulfilment there. The tags will catch up the next time one of the actions above happens to that order.
Examples
Add each of these as its own tag. If a tag works out to be blank for an order, nothing is added.
Tag orders once they're packed
{% if order.status == 'PACKED' %}alpaca-packed{% endif %}
Tag orders by fulfilment method
{% if order.type contains 'pickup' %}pickup{% elsif order.type contains 'delivery' %}delivery{% else %}shipping{% endif %}
Tag orders with their pickup or fulfilment location
{{ location.name }}
To get a lower-case tag with hyphens instead of spaces, e.g. leeds-store:
{{ location.name | downcase | replace: ' ', '-' }}
Tag orders with their delivery rate
{% if order.delivery_rate_name %}Rate: {{ order.delivery_rate_name }}{% endif %}
Tag delivery orders that are packed and ready to go out
{% if order.type contains 'delivery' and order.status == 'PACKED' %}ready-for-driver{% endif %}
Tag orders with items that aren't available
{% unless order.itemsAreAvailable %}stock-issue{% endunless %}
Tag orders where any item has a particular line item property
{% for item in order.line_items %}{% if item.properties_map['Gift wrap'] %}gift-wrap{% break %}{% endif %}{% endfor %}
Tag orders that contain a particular SKU
{% for item in order.line_items %}{% if item.sku == 'GIFT-BOX' %}contains-gift-box{% break %}{% endif %}{% endfor %}The {% break %} in these two examples stops the tag being repeated when more than one item matches.
Tag orders paid with a particular payment method
{% if order.payment_gateway_names contains 'Cash on Delivery (COD)' %}cash-on-delivery{% endif %}
Tag high-value orders
{% assign total = order.total | plus: 0 %}{% if total >= 100 %}high-value{% endif %}
Tag orders by the customer's language
{% if customer.locale == 'fr' %}french-speaking{% endif %}
Things to watch
No commas. A tag can't contain a comma, either in the Liquid itself or in the value it produces. That rules out values such as addresses and
order.product_tags.Avoid values that change. Timestamps,
order.hours_remainingandlocation.nowproduce a different tag every time tags are refreshed.Keep personal details out of tags. Don't put customer names, emails or phone numbers in tags.
Capitals matter. Compare statuses in capitals, e.g.
order.status == 'PACKED', not'packed'.Filters. Standard Liquid filters such as
downcase,upcase,replaceandplusall work. Alpaca also providesmoneyandmoney_with_currency.
Liquid variable reference
Order tags can use four objects: order, location, customer and shop.
order
Variable | What it contains |
| Shopify order name, e.g. |
| Alpaca's order ID |
| Shopify's numeric order ID |
| How the order is being fulfilled: |
|
|
|
|
| Order total |
| Order subtotal |
| Order note |
| List of payment methods used |
| Pickup date and time, in the customer's language |
| Start and end of the pickup slot (slot-based pickups only) |
| Delivery date and time, in the customer's language |
| Start and end of the delivery slot (slot-based deliveries only) |
| Scheduled time as a timestamp in milliseconds |
| When the order was placed, as a timestamp in milliseconds (store time or UTC) |
| Hours until the scheduled time |
| ID of the delivery rate used |
| Name of the delivery rate, if there is one |
| Name of the shipping rate, if there is one |
| Tags from the product rules that matched the order, separated by commas |
| List of line items (see below) |
| Shipping address |
| Tracking URL |
| Order token |
| The customer's order status page |
| Links the customer can use to reschedule |
Line items
Each item in order.line_items has Shopify's line item fields, such as title, sku, quantity, vendor, product_id, variant_id and properties.
It also has properties_map, which lets you look up a line item property by name, e.g. item.properties_map['Gift wrap'].
location
The pickup or fulfilment location for the order.
Variable | What it contains |
| Location name |
| Location ID |
| Address lines |
| City and province or state |
| Country and postcode |
| Full address |
| Phone number |
| Pickup instructions |
| Time zone, e.g. |
| List of opening hours, each with |
| The current time |
customer
Variable | What it contains |
| Full name |
| First and last name |
| Email address |
| Phone number |
| Customer's language, e.g. |
shop
Variable | What it contains |
| Store name |
| Store's myshopify.com domain |
| Store contact email |
| Shopify's numeric store ID |

