Mechanic is a development and ecommerce automation platform for Shopify. :)
Don't keep your customers waiting! Stay on top of orders that have yet to be delivered, by auto-archiving every order once every item has reached the customer.
Runs Occurs whenever a fulfillment event is created.
Don't keep your customers waiting! Stay on top of orders that have yet to be delivered, by auto-archiving every order once every item has reached the customer.
This task monitors fulfillment events. Every time a fulfillment event occurs, every fulfillment in the related order is scanned - once each fulfillment reaches the "delivered" status, this task archives the order.
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/fulfillment_events/create
{% assign order_qualifies = false %} {% assign order = fulfillment_event.order %} {% if order.closed_at == blank %} {% if order.fulfillment_status == "fulfilled" %} {% assign shipment_statuses = order.fulfillments | map: "shipment_status" | uniq %} {% if shipment_statuses.size == 1 and shipment_statuses.first == "delivered" %} {% assign order_qualifies = true %} {% else %} {"log": {{ shipment_statuses | join: ", " | prepend: "Order is not fully delivered. Status(es) found: " | json }}} {% endif %} {% else %} {"log": {{ "Order is not fulfilled; status is " | append: order.fulfillment_status | json }}} {% endif %} {% else %} {"log": "Order is already closed."} {% endif %} {% if order_qualifies or event.preview %} { "action": { "type": "shopify", "options": [ "post", "/admin/orders/{{ order.id | default: "0000" }}/close.json", {} ] } } {% endif %}