Tags: Draft Orders, Metafields, Orders
This task will watch for orders created from draft, copying over any metafields to the order that match the ones configured in this task. If the "Copy all metafields" option is checked, then it will skip the matching and instead just copy any metafields that exist on the draft order.
- View in the task library: tasks.mechanic.dev/copy-draft-order-metafields-to-orders
- Task JSON, for direct import: task.json
- Preview task code: script.liquid
{
"metafields_to_copy__array": [
"sample.change_me"
],
"copy_all_metafields__boolean": false
}
Learn about task options in Mechanic
shopify/orders/create
mechanic/user/order
Learn about event subscriptions in Mechanic
This task will watch for orders created from draft, copying over any metafields to the order that match the ones configured in this task. If the "Copy all metafields" option is checked, then it will skip the matching and instead just copy any metafields that exist on the draft order.
When configuring metafields to copy, they should be entered as namespace.key (e.g. "custom.estimated_ship_date").
Orders may also be sent individually to this task from an admin link. Caution when using this feature though, as this task does not check if the metafields already exist on the order nor if the values are different; it will just overwrite them.
Find this task in the library at tasks.mechanic.dev, and use the "Try this task" button. Or, import this task's JSON export – see Importing and exporting tasks to learn how imports work.
Found a bug? Got an improvement to add? Start here: ../../CONTRIBUTING.md.
Submit your task requests for consideration by the Mechanic community, and they may be chosen for development and inclusion in the task library!