Order Export & Order Import for WooCommerce - Version 1.5.2

Version Description

  • WP 5.2.3 Tested OK.
  • Bug fix:'Cannot insert order without order status'.
  • Bug fix:Order note comment_author not export and import.
Download this release

Release Info

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

Code changes from version 1.5.1 to 1.5.2

includes/exporter/class-wf-orderimpexpcsv-exporter.php CHANGED
@@ -322,7 +322,6 @@ class WF_OrderImpExpCsv_Exporter {
322
  add_filter('comments_clauses', $callback);
323
  $notes = array_reverse($notes);
324
  $order_notes = array();
325
-
326
  foreach ($notes as $note) {
327
  $date = $note->comment_date;
328
  $customer_note = 0;
@@ -332,7 +331,8 @@ class WF_OrderImpExpCsv_Exporter {
332
  $order_notes[] = implode('|', array(
333
  'content:' .str_replace(array("\r", "\n"), ' ', $note->comment_content),
334
  'date:'.(!empty($date) ? $date : current_time( 'mysql' )),
335
- 'customer:'.$customer_note
 
336
  ));
337
  }
338
  return $order_notes;
@@ -345,7 +345,8 @@ class WF_OrderImpExpCsv_Exporter {
345
  $order_notes[] = implode('|', array(
346
  'content:' .str_replace(array("\r", "\n"), ' ', $note->content),
347
  'date:'.$note->date_created->date('Y-m-d H:i:s'),
348
- 'customer:'.$note->customer_note
 
349
  ));
350
  }
351
  return $order_notes;
322
  add_filter('comments_clauses', $callback);
323
  $notes = array_reverse($notes);
324
  $order_notes = array();
 
325
  foreach ($notes as $note) {
326
  $date = $note->comment_date;
327
  $customer_note = 0;
331
  $order_notes[] = implode('|', array(
332
  'content:' .str_replace(array("\r", "\n"), ' ', $note->comment_content),
333
  'date:'.(!empty($date) ? $date : current_time( 'mysql' )),
334
+ 'customer:'.$customer_note,
335
+ 'added_by:'.$note->added_by
336
  ));
337
  }
338
  return $order_notes;
345
  $order_notes[] = implode('|', array(
346
  'content:' .str_replace(array("\r", "\n"), ' ', $note->content),
347
  'date:'.$note->date_created->date('Y-m-d H:i:s'),
348
+ 'customer:'.$note->customer_note,
349
+ 'added_by:'.$note->added_by
350
  ));
351
  }
352
  return $order_notes;
includes/importer/class-wf-orderimpexpcsv-order-import.php CHANGED
@@ -360,7 +360,12 @@ class WF_OrderImpExpCsv_Order_Import extends WP_Importer {
360
  $merging = 1;
361
  $record_offset = 0;
362
  foreach ($this->parsed_data as $key => &$item) {
363
- $order = $this->parser->parse_orders($item, $this->raw_headers, $merging, $record_offset);
 
 
 
 
 
364
  if (!is_wp_error($order))
365
  $this->process_orders($order['shop_order'][0]);
366
  else
@@ -766,6 +771,7 @@ class WF_OrderImpExpCsv_Order_Import extends WP_Importer {
766
  if ($merging && $is_order_exist) {
767
  $wpdb->query($wpdb->prepare("DELETE comments,meta FROM {$wpdb->prefix}comments comments LEFT JOIN {$wpdb->prefix}commentmeta meta ON comments.comment_ID = meta.comment_id WHERE comments.comment_post_ID = %d",$order_id));
768
  }
 
769
  foreach ($post['notes'] as $order_note) {
770
  $note = explode('|', $order_note);
771
  $con = array_shift($note);
@@ -774,10 +780,17 @@ class WF_OrderImpExpCsv_Order_Import extends WP_Importer {
774
  $date = substr($date, strpos($date, ":") + 1);
775
  $cus = array_shift($note);
776
  $cus = substr($cus, strpos($cus, ":") + 1);
 
 
 
 
 
 
 
777
  if($cus == '1'){
778
  $comment_id = $order->add_order_note($con,1,1);
779
  } else {
780
- $comment_id = $order->add_order_note($con);
781
  }
782
  wp_update_comment(array('comment_ID' => $comment_id,'comment_date' => $date));
783
  }
360
  $merging = 1;
361
  $record_offset = 0;
362
  foreach ($this->parsed_data as $key => &$item) {
363
+ $order = $this->parser->parse_orders($item, $this->raw_headers, $merging, $record_offset);
364
+ if (empty($order)) {
365
+ $this->add_import_result('skipped', __('Order Skipped, please check the log file', 'order-import-export-for-woocommerce'));
366
+ unset($item, $order);
367
+ continue;
368
+ }
369
  if (!is_wp_error($order))
370
  $this->process_orders($order['shop_order'][0]);
371
  else
771
  if ($merging && $is_order_exist) {
772
  $wpdb->query($wpdb->prepare("DELETE comments,meta FROM {$wpdb->prefix}comments comments LEFT JOIN {$wpdb->prefix}commentmeta meta ON comments.comment_ID = meta.comment_id WHERE comments.comment_post_ID = %d",$order_id));
773
  }
774
+
775
  foreach ($post['notes'] as $order_note) {
776
  $note = explode('|', $order_note);
777
  $con = array_shift($note);
780
  $date = substr($date, strpos($date, ":") + 1);
781
  $cus = array_shift($note);
782
  $cus = substr($cus, strpos($cus, ":") + 1);
783
+ $system = array_shift($note);
784
+ $added_by = substr($system, strpos($system, ":") + 1);
785
+ if($added_by == 'system'){
786
+ $added_by_user = FALSE;
787
+ }else{
788
+ $added_by_user = TRUE;
789
+ }
790
  if($cus == '1'){
791
  $comment_id = $order->add_order_note($con,1,1);
792
  } else {
793
+ $comment_id = $order->add_order_note($con,0,$added_by_user);
794
  }
795
  wp_update_comment(array('comment_ID' => $comment_id,'comment_date' => $date));
796
  }
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: 1.5.1
10
  Text Domain: order-import-export-for-woocommerce
11
  WC tested up to: 3.7.0
12
  License: GPLv3
@@ -24,7 +24,7 @@ define("WF_CPN_IMP_EXP_ID", "wf_cpn_imp_exp");
24
  define("wf_coupon_csv_im_ex", "wf_coupon_csv_im_ex");
25
 
26
  if (!defined('WF_ORDERIMPEXP_CURRENT_VERSION')) {
27
- define("WF_ORDERIMPEXP_CURRENT_VERSION", "1.5.1");
28
  }
29
 
30
  /**
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: 1.5.2
10
  Text Domain: order-import-export-for-woocommerce
11
  WC tested up to: 3.7.0
12
  License: GPLv3
24
  define("wf_coupon_csv_im_ex", "wf_coupon_csv_im_ex");
25
 
26
  if (!defined('WF_ORDERIMPEXP_CURRENT_VERSION')) {
27
+ define("WF_ORDERIMPEXP_CURRENT_VERSION", "1.5.2");
28
  }
29
 
30
  /**
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: webtoffee
3
  Donate link: https://www.webtoffee.com/plugins/
4
  Tags: Order Export, Order Import, WooCommerce Export Orders , WooCommerce Import Orders , Export Orders, Import Orders , order, export, import, woocommerce, csv, coupon, coupon export, coupon import, woocommerce export coupon , woocommerce import coupon , export coupons, import coupons,
5
  Requires at least: 3.0.1
6
- Tested up to: 5.2.2
7
- Stable tag: 1.5.1
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -115,6 +115,10 @@ By default, admin and store manager are given access to export orders from your
115
 
116
  == Changelog ==
117
 
 
 
 
 
118
  = 1.5.1 =
119
  * WC 3.7.0 Tested OK.
120
  * update information hook added.
@@ -254,6 +258,4 @@ By default, admin and store manager are given access to export orders from your
254
  * Export /Import WooCommerce Orders.
255
 
256
  == Upgrade Notice ==
257
- = 1.5.1 =
258
- * WC 3.7.0 Tested OK.
259
- * update information hook added.
3
  Donate link: https://www.webtoffee.com/plugins/
4
  Tags: Order Export, Order Import, WooCommerce Export Orders , WooCommerce Import Orders , Export Orders, Import Orders , order, export, import, woocommerce, csv, coupon, coupon export, coupon import, woocommerce export coupon , woocommerce import coupon , export coupons, import coupons,
5
  Requires at least: 3.0.1
6
+ Tested up to: 5.2.3
7
+ Stable tag: 1.5.2
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
115
 
116
  == Changelog ==
117
 
118
+ = 1.5.2 =
119
+ * WP 5.2.3 Tested OK.
120
+ * Bug fix:'Cannot insert order without order status'.
121
+ * Bug fix:Order note comment_author not export and import.
122
  = 1.5.1 =
123
  * WC 3.7.0 Tested OK.
124
  * update information hook added.
258
  * Export /Import WooCommerce Orders.
259
 
260
  == Upgrade Notice ==
261
+