Explorar el Código

fix statuses code from in-print, to-print => wc-in-print, wc-to-print

Dalibor Votruba hace 1 año
padre
commit
f237b4fc43

+ 2 - 2
studiou-wc-ord-print-statuses/includes/class-bulk-actions-manager.php

@@ -51,7 +51,7 @@ class Bulk_Actions_Manager {
             UtilsLog::log('Setting status Order #' . $post_id . ' to "to-print"');
             $order = wc_get_order($post_id);
             if ($order) {
-                $order->update_status('to-print');
+                $order->update_status('wc-to-print');
                 update_post_meta($post_id, 'to-print-date', current_time('mysql'));
                 UtilsLog::log('Order #' . $post_id . ' marked as "to-print"');
             }
@@ -67,7 +67,7 @@ class Bulk_Actions_Manager {
         foreach ($post_ids as $post_id) {
             $order = wc_get_order($post_id);
             if ($order) {
-                $order->update_status('in-print');
+                $order->update_status('wc-in-print');
                 update_post_meta($post_id, 'in-print-date', current_time('mysql'));
             }
         }

+ 2 - 2
studiou-wc-ord-print-statuses/includes/class-order-status-manager.php

@@ -53,9 +53,9 @@ class Order_Status_Manager {
     public function handle_status_transitions($order_id, $old_status, $new_status) {
         // Handle status transitions here
         // For example:
-        if ($new_status === 'to-print') {
+        if ($new_status === 'wc-to-print') {
             update_post_meta($order_id, 'to-print-date', current_time('mysql'));
-        } elseif ($new_status === 'in-print') {
+        } elseif ($new_status === 'wc-in-print') {
             update_post_meta($order_id, 'in-print-date', current_time('mysql'));
         }
     }

+ 1 - 1
studiou-wc-ord-print-statuses/studiou-wc-ord-print-statuses.php

@@ -2,7 +2,7 @@
 /**
  * Plugin Name: QDR - Studiou WC Order Print Statuses
  * Plugin URI: https://www.quadarax.com/plugins/studiou-wc-ord-print-statuses
- * Description: Adds custom order statuses (to-print, in-print), bulk actions, and status change timestamps to WooCommerce for print orders to third party providers
+ * Description: Adds custom order statuses (wc-to-print, wc-in-print), bulk actions, and status change timestamps to WooCommerce for print orders to third party providers
  * Version: 1.1
  * Requires at least: 5.8
  * Requires PHP: 7.2