Skip to content

Latest commit

 

History

History

cancel-and-close-unpaid-orders-after-two-days

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Cancel and close unpaid orders after x hours/days

Tags: Cancel, Orders, Unpaid

This task scans for orders that are more than X days or hours old that have a financial status of "pending", and ensures that they are all closed/archived and cancelled. Pending orders that are already closed will be cancelled, and pending orders that are already cancelled will be closed. Optionally, choose to add a tag to such orders, and whether to restock line items.

Default options

{
  "only_process_orders_having_this_tag": null,
  "ignore_orders_having_this_tag": null,
  "period_to_wait_before_checking_each_order__number_required": 1,
  "period_to_wait_is_in_hours__boolean": false,
  "period_to_wait_is_in_days__boolean": true,
  "tag_to_add_to_the_order": null,
  "cancellation_reason_to_set": "other",
  "restock_line_items__boolean": null,
  "send_cancellation_email_to_customer__boolean": false,
  "test_mode__boolean": true
}

Learn about task options in Mechanic

Subscriptions

{% if options.period_to_wait_is_in_hours__boolean %}
  mechanic/scheduler/hourly
{% elsif options.period_to_wait_is_in_days__boolean %}
  mechanic/scheduler/daily
{% endif %}
mechanic/user/trigger

Learn about event subscriptions in Mechanic

Documentation

This task scans for orders that are more than X days or hours old that have a financial status of "pending", and ensures that they are all closed/archived and cancelled. Pending orders that are already closed will be cancelled, and pending orders that are already cancelled will be closed. Optionally, choose to add a tag to such orders, and whether to restock line items.

If configured with an interval in hours, this task will run hourly. If configured with an interval in days, the task will run every night at midnight, in your store's local timezone. Run this task manually to perform the scan on demand.

Run first using test mode, to ensure expected results before running without it.

Installing this task

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.

Contributions

Found a bug? Got an improvement to add? Start here: ../../CONTRIBUTING.md.

Task requests

Submit your task requests for consideration by the Mechanic community, and they may be chosen for development and inclusion in the task library!