Developer notes
Tables
Section titled “Tables”| Table | Contents |
|---|---|
?:kv_oa_rules |
Rules: statuses, wait, filters as comma lists, mode (P preview, L live), since_ts (0 = all orders) |
?:kv_oa_log |
One row per rule, order and mode: old and new status, result (D done, F failed, W would change), reopened_at |
?:kv_oa_times |
When an order entered a status |
?:kv_oa_meta |
lock, last_run |
Classes
Section titled “Classes”Tygh\Addons\KvOrderAutomation: Rules (storage, validation, templates), Runner (matching, applying, log).
Runner::run() takes a 10 minute lock, then goes through active rules by position. matches() builds one query per rule, oldest first, limited by max_per_run. apply() reads the status again and, in live mode, calls fn_change_order_status($order_id, $to, $from, $notify) with fn_get_notification_rules().
Parent orders (is_parent_order = Y) never match.
| Hook | Purpose |
|---|---|
change_order_status_post |
Records the time; marks log rows when something else moves the order on |
delete_order |
Removes the order’s rows |
Both exist with the same arguments in 4.17.2 and 4.21.2.
admin.php --dispatch=kv_order_automation.cron on the console, or over HTTP with cron_password. The mode is listed in schemas/permissions/trusted_controllers.post.php, because core sends a request without a session to the login page otherwise. The password is compared with hash_equals; an empty core password closes the HTTP path.
License gate
Section titled “License gate”Runner::isOn() is checked before a pass. Without a license no order is touched.
Full page cache
Section titled “Full page cache”No storefront output, no storefront code path.