Order Export & Order Import for WooCommerce - Version 2.0.6

Version Description

  • Fixed: Mail sending with order status transition on import
Download this release

Release Info

Developer webtoffee
Plugin Icon 128x128 Order Export & Order Import for WooCommerce
Version 2.0.6
Comparing to
See all releases

Code changes from version 2.0.5 to 2.0.6

admin/modules/export/export.php CHANGED
@@ -126,7 +126,7 @@ class Wt_Import_Export_For_Woo_Basic_Export
126
  $fields['default_export_batch']=array(
127
  'label'=>__("Default Export batch count"),
128
  'type'=>'number',
129
- 'value' =>100,
130
  'field_name'=>'default_export_batch',
131
  'help_text'=>__('Provide the default count for the records to be exported in a batch.'),
132
  'validation_rule'=>array('type'=>'absint'),
@@ -276,7 +276,7 @@ class Wt_Import_Export_For_Woo_Basic_Export
276
  'type'=>'text',
277
  'value'=>$this->default_batch_count,
278
  'field_name'=>'batch_count',
279
- 'help_text'=>sprintf(__('The number of records that the server will process for every iteration within the configured timeout interval. If the export fails due to timeout you can lower this number accordingly and try again. Defaulted to %d records.'), 100),
280
  'validation_rule'=>array('type'=>'absint'),
281
  )
282
  );
126
  $fields['default_export_batch']=array(
127
  'label'=>__("Default Export batch count"),
128
  'type'=>'number',
129
+ 'value' =>30,
130
  'field_name'=>'default_export_batch',
131
  'help_text'=>__('Provide the default count for the records to be exported in a batch.'),
132
  'validation_rule'=>array('type'=>'absint'),
276
  'type'=>'text',
277
  'value'=>$this->default_batch_count,
278
  'field_name'=>'batch_count',
279
+ 'help_text'=>sprintf(__('The number of records that the server will process for every iteration within the configured timeout interval. If the export fails due to timeout you can lower this number accordingly and try again. Defaulted to %d records.'), 30),
280
  'validation_rule'=>array('type'=>'absint'),
281
  )
282
  );
admin/modules/order/import/import.php CHANGED
@@ -1387,9 +1387,16 @@ class Wt_Import_Export_For_Woo_Basic_Order_Import {
1387
  // wc_create_order(); woocommerce/includes/wc-core-function.php:83 -> $order = new WC_Order(); woocommerce/includes/class-wc-order.php:16 -> $order->save();
1388
  // woocommerce/includes/class-wc-order.php:218 -> parent::save(); woocommerce/includes/abstracts/abstract_wc_order.php:168 -> $this->data_store->create( $this ); woocommerce/includes/data-store/abstract-wc-order-data-store-cpt.php:58
1389
 
1390
- add_action( 'woocommerce_email', array($this, 'wt_iew_order_import_unhook_woocommerce_email') ); // disabled all order related email sending. Need to implimet a way to send status change email based on $this->status_mail flag
1391
 
1392
-
 
 
 
 
 
 
 
1393
  $order = wc_create_order($data);
1394
  if (is_wp_error($order)) {
1395
  return $order;
@@ -1744,6 +1751,8 @@ class Wt_Import_Export_For_Woo_Basic_Order_Import {
1744
 
1745
  function wt_create_refund( $input_currency, $args = array() ) {
1746
 
 
 
1747
  $default_args = array(
1748
  'amount' => 0,
1749
  'reason' => null,
@@ -1837,6 +1846,8 @@ class Wt_Import_Export_For_Woo_Basic_Order_Import {
1837
  */
1838
  do_action( 'woocommerce_create_refund', $refund, $args );
1839
 
 
 
1840
  if ( $refund->save() ) {
1841
  if ( $args['refund_payment'] ) {
1842
  $result = wc_refund_payment( $order, $refund->get_amount(), $refund->get_reason() );
@@ -1925,15 +1936,43 @@ class Wt_Import_Export_For_Woo_Basic_Order_Import {
1925
  remove_action( 'woocommerce_order_status_failed_to_processing_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
1926
  remove_action( 'woocommerce_order_status_failed_to_completed_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
1927
  remove_action( 'woocommerce_order_status_failed_to_on-hold_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
 
1928
 
1929
- // Processing order emails
1930
  remove_action( 'woocommerce_order_status_pending_to_processing_notification', array( $email_class->emails['WC_Email_Customer_Processing_Order'], 'trigger' ) );
1931
  remove_action( 'woocommerce_order_status_pending_to_on-hold_notification', array( $email_class->emails['WC_Email_Customer_Processing_Order'], 'trigger' ) );
1932
- remove_action( 'woocommerce_order_status_pending_to_on-hold_notification', array( $email_class->emails['WC_Email_Customer_On_Hold_Order'], 'trigger' ) );
1933
- remove_action( 'woocommerce_order_status_processing_to_on-hold_notification', array( $email_class->emails['WC_Email_Customer_On_Hold_Order'], 'trigger' ) );
1934
-
1935
- // Completed order emails
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1936
  remove_action( 'woocommerce_order_status_completed_notification', array( $email_class->emails['WC_Email_Customer_Completed_Order'], 'trigger' ) );
 
 
 
 
 
 
 
 
 
 
 
 
1937
 
1938
  }
1939
 
1387
  // wc_create_order(); woocommerce/includes/wc-core-function.php:83 -> $order = new WC_Order(); woocommerce/includes/class-wc-order.php:16 -> $order->save();
1388
  // woocommerce/includes/class-wc-order.php:218 -> parent::save(); woocommerce/includes/abstracts/abstract_wc_order.php:168 -> $this->data_store->create( $this ); woocommerce/includes/data-store/abstract-wc-order-data-store-cpt.php:58
1389
 
1390
+ add_action( 'woocommerce_email', array($this, 'wt_iew_order_import_unhook_woocommerce_email') ); // disabled all order related email sending. Need to implimet a way to send status change email based on $this->status_mail flag
1391
 
1392
+
1393
+ remove_all_actions('woocommerce_order_status_refunded_notification');
1394
+ remove_all_actions('woocommerce_order_partially_refunded_notification');
1395
+ remove_action('woocommerce_order_status_refunded', array('WC_Emails', 'send_transactional_email'));
1396
+ remove_action('woocommerce_order_partially_refunded', array('WC_Emails', 'send_transactional_email'));
1397
+ remove_action('woocommerce_order_fully_refunded', array('WC_Emails', 'send_transactional_email'));
1398
+
1399
+
1400
  $order = wc_create_order($data);
1401
  if (is_wp_error($order)) {
1402
  return $order;
1751
 
1752
  function wt_create_refund( $input_currency, $args = array() ) {
1753
 
1754
+
1755
+
1756
  $default_args = array(
1757
  'amount' => 0,
1758
  'reason' => null,
1846
  */
1847
  do_action( 'woocommerce_create_refund', $refund, $args );
1848
 
1849
+ add_action( 'woocommerce_email', array($this, 'wt_iew_order_import_unhook_woocommerce_email') );
1850
+
1851
  if ( $refund->save() ) {
1852
  if ( $args['refund_payment'] ) {
1853
  $result = wc_refund_payment( $order, $refund->get_amount(), $refund->get_reason() );
1936
  remove_action( 'woocommerce_order_status_failed_to_processing_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
1937
  remove_action( 'woocommerce_order_status_failed_to_completed_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
1938
  remove_action( 'woocommerce_order_status_failed_to_on-hold_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
1939
+ remove_action( 'woocommerce_order_status_failed_to_pending_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
1940
 
1941
+ // Processing emails
1942
  remove_action( 'woocommerce_order_status_pending_to_processing_notification', array( $email_class->emails['WC_Email_Customer_Processing_Order'], 'trigger' ) );
1943
  remove_action( 'woocommerce_order_status_pending_to_on-hold_notification', array( $email_class->emails['WC_Email_Customer_Processing_Order'], 'trigger' ) );
1944
+ remove_action( 'woocommerce_order_status_on-hold_to_processing_notification', array( $email_class->emails['WC_Email_Customer_Processing_Order'], 'trigger' ) );
1945
+ remove_action( 'woocommerce_order_status_failed_to_processing_notification', array( $email_class->emails['WC_Email_Customer_Processing_Order'], 'trigger' ) );
1946
+ remove_action( 'woocommerce_order_status_cancelled_to_processing_notification', array( $email_class->emails['WC_Email_Customer_Processing_Order'], 'trigger' ) );
1947
+
1948
+ // On-hold emails
1949
+ remove_action( 'woocommerce_order_status_cancelled_to_on-hold_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
1950
+ remove_action( 'woocommerce_order_status_cancelled_to_on-hold_notification', array( $email_class->emails['WC_Email_Customer_On_Hold_Order'], 'trigger' ) );
1951
+ remove_action( 'woocommerce_order_status_failed_to_on-hold_notification', array( $email_class->emails['WC_Email_Customer_On_Hold_Order'], 'trigger' ) );
1952
+ remove_action( 'woocommerce_order_status_pending_to_on-hold_notification', array( $email_class->emails['WC_Email_Customer_On_Hold_Order'], 'trigger' ) );
1953
+ remove_action( 'woocommerce_order_status_processing_to_on-hold_notification', array( $email_class->emails['WC_Email_Customer_On_Hold_Order'], 'trigger' ) );
1954
+
1955
+ // Cancelled emails
1956
+ remove_action( 'woocommerce_order_status_on-hold_to_cancelled_notification', array( $email_class->emails['WC_Email_Cancelled_Order'], 'trigger' ) );
1957
+ remove_action( 'woocommerce_order_status_processing_to_cancelled_notification', array( $email_class->emails['WC_Email_Cancelled_Order'], 'trigger' ) );
1958
+ remove_action( 'woocommerce_order_status_failed_to_cancelled_notification', array( $email_class->emails['WC_Email_Cancelled_Order'], 'trigger' ) );
1959
+ remove_action( 'woocommerce_order_status_completed_to_cancelled_notification', array( $email_class->emails['WC_Email_Cancelled_Order'], 'trigger' ) );
1960
+
1961
+
1962
+ // Completed emails
1963
  remove_action( 'woocommerce_order_status_completed_notification', array( $email_class->emails['WC_Email_Customer_Completed_Order'], 'trigger' ) );
1964
+ remove_action( 'woocommerce_order_status_processing_to_completed_notification', array( $email_class->emails['WC_Email_Customer_Completed_Order'], 'trigger' ) );
1965
+ remove_action( 'woocommerce_order_status_refunded_to_completed_notification', array( $email_class->emails['WC_Email_Customer_Completed_Order'], 'trigger' ) );
1966
+ remove_action( 'woocommerce_order_status_cancelled_to_completed_notification', array( $email_class->emails['WC_Email_Customer_Completed_Order'], 'trigger' ) );
1967
+
1968
+ // Refund mails
1969
+ remove_action( 'woocommerce_order_status_completed_to_refunded_notification', array( $email_class->emails['WC_Email_Customer_Refunded_Order'], 'trigger' ) );
1970
+ remove_action( 'woocommerce_order_status_processing_to_refunded_notification', array( $email_class->emails['WC_Email_Customer_Refunded_Order'], 'trigger' ) );
1971
+ remove_action( 'woocommerce_order_status_refunded', array( $email_class->emails['WC_Email_Customer_Refunded_Order'], 'trigger' ) );
1972
+
1973
+ // Failed emails
1974
+ remove_action( 'woocommerce_order_status_on-hold_to_failed_notification', array( $email_class->emails['WC_Email_Failed_Order'], 'trigger' ) );
1975
+ remove_action( 'woocommerce_order_status_pending_to_failed_notification', array( $email_class->emails['WC_Email_Failed_Order'], 'trigger' ) );
1976
 
1977
  }
1978
 
admin/modules/order/order.php CHANGED
@@ -505,11 +505,11 @@ class Wt_Import_Export_For_Woo_Basic_Order {
505
  'validation_rule' => array('type'=>'text_arr')
506
  );
507
  $fields['email'] = array(
508
- 'label' => __('Email'),
509
  'placeholder' => __('Search for a customer…'),
510
  'field_name' => 'email',
511
  'sele_vals' => array(),
512
- 'help_text' => __('Input the customer email to export orders pertaining to only these customers.'),
513
  'type' => 'multi_select',
514
  'css_class' => 'wc-customer-search',
515
  'validation_rule' => array('type'=>'text_arr')
505
  'validation_rule' => array('type'=>'text_arr')
506
  );
507
  $fields['email'] = array(
508
+ 'label' => __('Customer'),
509
  'placeholder' => __('Search for a customer…'),
510
  'field_name' => 'email',
511
  'sele_vals' => array(),
512
+ 'help_text' => __('Input the customer name or email to export orders pertaining to only these customers.'),
513
  'type' => 'multi_select',
514
  'css_class' => 'wc-customer-search',
515
  'validation_rule' => array('type'=>'text_arr')
includes/class-wt-import-export-for-woo.php CHANGED
@@ -80,7 +80,7 @@ class Wt_Import_Export_For_Woo_Basic {
80
  if ( defined( 'WT_O_IEW_VERSION' ) ) {
81
  $this->version = WT_O_IEW_VERSION;
82
  } else {
83
- $this->version = '2.0.5';
84
  }
85
  $this->plugin_name = 'wt-import-export-for-woo-basic';
86
 
80
  if ( defined( 'WT_O_IEW_VERSION' ) ) {
81
  $this->version = WT_O_IEW_VERSION;
82
  } else {
83
+ $this->version = '2.0.6';
84
  }
85
  $this->plugin_name = 'wt-import-export-for-woo-basic';
86
 
order-import-export-for-woocommerce.php CHANGED
@@ -6,7 +6,7 @@ Plugin URI: https://wordpress.org/plugins/order-import-export-for-woocommerce/
6
  Description: Export and Import Order detail including line items, From and To your WooCommerce Store.
7
  Author: WebToffee
8
  Author URI: https://www.webtoffee.com/product/woocommerce-order-coupon-subscription-export-import/
9
- Version: 2.0.5
10
  Text Domain: order-import-export-for-woocommerce
11
  WC tested up to: 5.3.0
12
  License: GPLv3
@@ -45,7 +45,7 @@ if ( !defined( 'WT_IEW_DEBUG_BASIC_TROUBLESHOOT' ) ) {
45
  * Start at version 1.0.0 and use SemVer - https://semver.org
46
  * Rename this for your plugin and update it as you release new versions.
47
  */
48
- define( 'WT_O_IEW_VERSION', '2.0.5' );
49
 
50
  /**
51
  * The code that runs during plugin activation.
6
  Description: Export and Import Order detail including line items, From and To your WooCommerce Store.
7
  Author: WebToffee
8
  Author URI: https://www.webtoffee.com/product/woocommerce-order-coupon-subscription-export-import/
9
+ Version: 2.0.6
10
  Text Domain: order-import-export-for-woocommerce
11
  WC tested up to: 5.3.0
12
  License: GPLv3
45
  * Start at version 1.0.0 and use SemVer - https://semver.org
46
  * Rename this for your plugin and update it as you release new versions.
47
  */
48
+ define( 'WT_O_IEW_VERSION', '2.0.6' );
49
 
50
  /**
51
  * The code that runs during plugin activation.
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: order export, order import, woocommerce export orders, woocommerce import
5
  Requires at least: 3.0.1
6
  Tested up to: 5.7
7
  Requires PHP: 5.6
8
- Stable tag: 2.0.5
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
@@ -213,6 +213,8 @@ Yes.
213
 
214
  == Changelog ==
215
 
 
 
216
  = 2.0.5 =
217
  * Fixed: Payment date update
218
  * Fixed: Mail sending with on-hold status on import
@@ -435,6 +437,5 @@ Yes.
435
 
436
  == Upgrade Notice ==
437
 
438
- = 2.0.5 =
439
- * Fixed: Payment date update
440
- * Fixed: Mail sending with on-hold status on import
5
  Requires at least: 3.0.1
6
  Tested up to: 5.7
7
  Requires PHP: 5.6
8
+ Stable tag: 2.0.6
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
213
 
214
  == Changelog ==
215
 
216
+ = 2.0.6 =
217
+ * Fixed: Mail sending with order status transition on import
218
  = 2.0.5 =
219
  * Fixed: Payment date update
220
  * Fixed: Mail sending with on-hold status on import
437
 
438
  == Upgrade Notice ==
439
 
440
+ = 2.0.6 =
441
+ * Fixed: Mail sending with order status transition on import