Mechanic is a development and ecommerce automation platform for Shopify. :)
Does exactly as it says. :)
Runs Occurs whenever an order is updated. Configuration includes order tag to watch for, order tag to remove, and ignore tag case.
Mechanic is designed to benefit everybody: merchants, customers, developers, agencies, Shopifolks, everybody.
That’s why we make it easy to configure automation without code, why we make it easy to tweak the underlying code once tasks are installed, and why we publish it all here for everyone to learn from.
(By the way, have you seen our documentation? Have you joined the Slack community?)
shopify/orders/updated
{% if event.preview %}
{% assign order = hash %}
{% assign order["admin_graphql_api_id"] = "gid://shopify/Order/1234567890" %}
{% assign order["tags"] = options.order_tag_to_watch_for__required | append: ", " | append: options.order_tag_to_remove__required %}
{% endif %}
{% assign order_tags = order.tags | split: ", " %}
{% assign tag_to_match = options.order_tag_to_watch_for__required %}
{% assign tag_to_remove = options.order_tag_to_remove__required %}
{% if options.ignore_tag_case__boolean %}
{% assign order_tags = order.tags | downcase | split: ", " %}
{% assign tag_to_match = options.order_tag_to_watch_for__required | downcase %}
{% assign tag_to_remove = options.order_tag_to_remove__required | downcase %}
{% endif %}
{% if order_tags contains tag_to_match and order_tags contains tag_to_remove %}
{% action "shopify" %}
mutation {
tagsRemove(
id: {{ order.admin_graphql_api_id | json }}
tags: {{ options.order_tag_to_remove__required | json }}
) {
userErrors {
field
message
}
}
}
{% endaction %}
{% endif %}apple
butter
true