fix(orders): enforce configured expiry

Apply the configured order lifetime to all checkout flows and close unpaid orders once their expiry is reached.
This commit is contained in:
2026-08-12 17:49:54 +08:00
parent 5752f80e62
commit 69dd3b66ab
8 changed files with 92 additions and 12 deletions
+2
View File
@@ -125,6 +125,7 @@ trait OrderRepositoryAdmin {
public function get_orders_admin(array $args = [], string $search = ''): array {
global $wpdb;
$this->expire_pending_orders();
[$where, $params] = $this->build_admin_order_filters($args, $search);
$limit = max(1, min(100, (int) ($args['limit'] ?? 20)));
@@ -147,6 +148,7 @@ trait OrderRepositoryAdmin {
public function get_orders_count(array $args = [], string $search = ''): int {
global $wpdb;
$this->expire_pending_orders();
[$where, $params] = $this->build_admin_order_filters($args, $search);
$where_sql = $where ? 'WHERE ' . implode(' AND ', $where) : '';