Просмотр исходного кода

studiou-wc-ord-print-statuses: fix in_print_date settings

Dalibor Votruba 1 год назад
Родитель
Сommit
931a4866a7

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

@@ -55,7 +55,7 @@ class Bulk_Actions_Manager {
             $order = wc_get_order($post_id);
             if ($order) {
                 $order->update_status('to-print');
-                update_post_meta($post_id, 'to-print-date', current_time('mysql'));
+                update_post_meta($post_id, 'to_print_date', current_time('mysql'));
                 UtilsLog::log('Order #' . $post_id . ' marked as "to-print"');
                 UtilsLog::message('Order #' . $post_id . ' marked as "to-print"' );
             }
@@ -72,7 +72,7 @@ class Bulk_Actions_Manager {
             $order = wc_get_order($post_id);
             if ($order) {
                 $order->update_status('in-print');
-                update_post_meta($post_id, 'in-print-date', current_time('mysql'));
+                update_post_meta($post_id, 'in_print_date', current_time('mysql'));
                 UtilsLog::message('Order #' . $post_id . ' marked as "in-print"' );
             }
         }

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

@@ -46,8 +46,7 @@ class Order_Status_Manager {
                 foreach ($this->custom_statuses as $status_slug => $status_args) {
                     $new_order_statuses[$status_slug] = $status_args['label'];
                 }
-            }
-        }
+            }        }
 
         return $new_order_statuses;
     }
@@ -57,9 +56,9 @@ class Order_Status_Manager {
         // For example:
         UtilsLog::log('Order #' . $order_id . ' status change ' . $old_status . ' -> ' . $new_status);
         if ($new_status === 'to-print') {
-            update_post_meta($order_id, 'to-print-date', current_time('mysql'));
+            update_post_meta($order_id, 'to_print_date', current_time('mysql'));
         } elseif ($new_status === 'in-print') {
-            update_post_meta($order_id, 'in-print-date', current_time('mysql'));
+            update_post_meta($order_id, 'in_print_date', current_time('mysql'));
         }
     }
 

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

@@ -3,7 +3,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 (wc-to-print, wc-in-print), bulk actions, and status change timestamps to WooCommerce for print orders to third party providers
- * Version: 1.1
+ * Version: 1.2
  * Requires at least: 5.8
  * Requires PHP: 7.2
  * Author: Dalibor Votruba