Order Export & Order Import for WooCommerce - Version 1.2.0

Version Description

  • Bug fix: Fixed WC Log issues.
Download this release

Release Info

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

Code changes from version 1.1.9 to 1.2.0

includes/importer/class-wf-csv-parser.php CHANGED
@@ -168,7 +168,7 @@ class WF_CSV_Parser {
168
  $row++;
169
 
170
  if ( $row <= $record_offset ) {
171
- $WF_CSV_Order_Import->log->add( sprintf( __( '> Row %s - skipped due to record offset.', 'wf_order_import_export' ), $row ) );
172
  unset($item);
173
  return;
174
  }
@@ -180,7 +180,7 @@ class WF_CSV_Parser {
180
  $order_number = ( ! empty( $item['order_number'] ) ) ? $item['order_number'] : null;
181
  $order_number_formatted = ( ! empty( $item['order_number_formatted'] ) ) ? $item['order_number_formatted'] : $order_number;
182
 
183
- $WF_CSV_Order_Import->log->add( sprintf( __( '> Row %s - preparing for import.', 'wf_order_import_export' ), $row ) );
184
 
185
 
186
  // validate the supplied formatted order number/order number
@@ -188,7 +188,7 @@ class WF_CSV_Parser {
188
 
189
  if ( $order_number && ! is_numeric( $order_number ) ) {
190
 
191
- $WF_CSV_Order_Import->log->add( sprintf( __( '> > Skipped. Order number field must be an integer: %s.', 'wf_order_import_export' ), $order_number ) );
192
  $skipped++;
193
  unset($item);
194
  return;
@@ -197,7 +197,7 @@ class WF_CSV_Parser {
197
 
198
  if ( $order_number_formatted && ! $order_number ) {
199
 
200
- $WF_CSV_Order_Import->log->add( __( '> > Skipped. Formatted order number provided but no numerical order number, see the documentation for further details.', 'wf_order_import_export' ) );
201
  $skipped++;
202
  unset($item);
203
  return;
@@ -229,7 +229,7 @@ class WF_CSV_Parser {
229
 
230
  if ( $order_id ) {
231
  // skip if order ID already exist.
232
- $WF_CSV_Order_Import->log->add( sprintf( __( '> > Skipped. Order %s already exists.', 'wf_order_import_export' ), $order_number_formatted ) );
233
  $skipped++;
234
  unset($item);
235
  return;
@@ -245,7 +245,7 @@ class WF_CSV_Parser {
245
 
246
  if ( ! $found_customer ) {
247
 
248
- $WF_CSV_Order_Import->log->add( sprintf( __( '> > Skipped. Cannot find customer with id %s.', 'wf_order_import_export' ), $item['customer_id'] ) );
249
  $skipped++;
250
  unset($item);
251
  return;;
@@ -286,7 +286,7 @@ class WF_CSV_Parser {
286
  }
287
 
288
  if ( ! $found_status ) {
289
- $WF_CSV_Order_Import->log->add( sprintf( __( '> > Skipped. Unknown order status %s (%s).', 'wf_order_import_export' ), $item['status'], implode( $available_statuses, ', ' ) ) );
290
  $skipped++;
291
  unset($item);
292
  return;
@@ -300,7 +300,7 @@ class WF_CSV_Parser {
300
  if ( ! empty( $item['date'] ) ) {
301
  if ( false === ( $item['date'] = strtotime( $item['date'] ) ) ) {
302
  // invalid date format
303
- $WF_CSV_Order_Import->log->add( sprintf( __( '> > Skipped. Invalid date format %s.', 'wf_order_import_export' ), $item['date'] ) );
304
  $skipped++;
305
  unset($item);
306
  return;
@@ -593,7 +593,7 @@ class WF_CSV_Parser {
593
 
594
  if ( ! $allow_unknown_products && ! $product_id ) {
595
  // unknown product
596
- $WF_CSV_Order_Import->log->add( sprintf( __( '> > Skipped. Unknown order item: %s.', 'wf_order_import_export' ), $product_identifier ) );
597
  $skipped++;
598
  $i++;
599
  continue; // break outer loop
@@ -628,7 +628,7 @@ class WF_CSV_Parser {
628
 
629
  if ( ! $sku || ! $qty || ! is_numeric( $total ) ) {
630
  // invalid item
631
- $WF_CSV_Order_Import->log->add( sprintf( __( '> > Row %d - %s - skipped. Missing SKU, quantity or total', 'wf_order_import_export' ), $row, $item['order_id'] ) );
632
  $skipped++;
633
  unset($item);
634
  return; // break outer loop
@@ -639,7 +639,7 @@ class WF_CSV_Parser {
639
 
640
  if ( ! $product_id ) {
641
  // unknown product
642
- $WF_CSV_Order_Import->log->add( sprintf( __( '> > Row %d - %s - skipped. Unknown order item: %s.', 'wf_order_import_export' ), $row, $item['order_id'], $sku ) );
643
  $skipped++;
644
  unset($item);
645
  return; // break outer loop
168
  $row++;
169
 
170
  if ( $row <= $record_offset ) {
171
+ $WF_CSV_Order_Import->log->add( 'csv-import', sprintf( __( '> Row %s - skipped due to record offset.', 'wf_order_import_export' ), $row ) );
172
  unset($item);
173
  return;
174
  }
180
  $order_number = ( ! empty( $item['order_number'] ) ) ? $item['order_number'] : null;
181
  $order_number_formatted = ( ! empty( $item['order_number_formatted'] ) ) ? $item['order_number_formatted'] : $order_number;
182
 
183
+ $WF_CSV_Order_Import->log->add( 'csv-import', sprintf( __( '> Row %s - preparing for import.', 'wf_order_import_export' ), $row ) );
184
 
185
 
186
  // validate the supplied formatted order number/order number
188
 
189
  if ( $order_number && ! is_numeric( $order_number ) ) {
190
 
191
+ $WF_CSV_Order_Import->log->add( 'csv-import', sprintf( __( '> > Skipped. Order number field must be an integer: %s.', 'wf_order_import_export' ), $order_number ) );
192
  $skipped++;
193
  unset($item);
194
  return;
197
 
198
  if ( $order_number_formatted && ! $order_number ) {
199
 
200
+ $WF_CSV_Order_Import->log->add( 'csv-import', __( '> > Skipped. Formatted order number provided but no numerical order number, see the documentation for further details.', 'wf_order_import_export' ) );
201
  $skipped++;
202
  unset($item);
203
  return;
229
 
230
  if ( $order_id ) {
231
  // skip if order ID already exist.
232
+ $WF_CSV_Order_Import->log->add( 'csv-import', sprintf( __( '> > Skipped. Order %s already exists.', 'wf_order_import_export' ), $order_number_formatted ) );
233
  $skipped++;
234
  unset($item);
235
  return;
245
 
246
  if ( ! $found_customer ) {
247
 
248
+ $WF_CSV_Order_Import->log->add( 'csv-import', sprintf( __( '> > Skipped. Cannot find customer with id %s.', 'wf_order_import_export' ), $item['customer_id'] ) );
249
  $skipped++;
250
  unset($item);
251
  return;;
286
  }
287
 
288
  if ( ! $found_status ) {
289
+ $WF_CSV_Order_Import->log->add( 'csv-import', sprintf( __( '> > Skipped. Unknown order status %s (%s).', 'wf_order_import_export' ), $item['status'], implode( $available_statuses, ', ' ) ) );
290
  $skipped++;
291
  unset($item);
292
  return;
300
  if ( ! empty( $item['date'] ) ) {
301
  if ( false === ( $item['date'] = strtotime( $item['date'] ) ) ) {
302
  // invalid date format
303
+ $WF_CSV_Order_Import->log->add( 'csv-import', sprintf( __( '> > Skipped. Invalid date format %s.', 'wf_order_import_export' ), $item['date'] ) );
304
  $skipped++;
305
  unset($item);
306
  return;
593
 
594
  if ( ! $allow_unknown_products && ! $product_id ) {
595
  // unknown product
596
+ $WF_CSV_Order_Import->log->add( 'csv-import', sprintf( __( '> > Skipped. Unknown order item: %s.', 'wf_order_import_export' ), $product_identifier ) );
597
  $skipped++;
598
  $i++;
599
  continue; // break outer loop
628
 
629
  if ( ! $sku || ! $qty || ! is_numeric( $total ) ) {
630
  // invalid item
631
+ $WF_CSV_Order_Import->log->add( 'csv-import', sprintf( __( '> > Row %d - %s - skipped. Missing SKU, quantity or total', 'wf_order_import_export' ), $row, $item['order_id'] ) );
632
  $skipped++;
633
  unset($item);
634
  return; // break outer loop
639
 
640
  if ( ! $product_id ) {
641
  // unknown product
642
+ $WF_CSV_Order_Import->log->add( 'csv-import', sprintf( __( '> > Row %d - %s - skipped. Unknown order item: %s.', 'wf_order_import_export' ), $row, $item['order_id'], $sku ) );
643
  $skipped++;
644
  unset($item);
645
  return; // break outer loop
includes/importer/class-wf-orderimpexpcsv-order-import.php CHANGED
@@ -547,8 +547,8 @@ class WF_OrderImpExpCsv_Order_Import extends WP_Importer {
547
  // plan a dry run
548
  //$dry_run = isset( $_POST['dry_run'] ) && $_POST['dry_run'] ? true : false;
549
 
550
- $this->log->add( '---' );
551
- $this->log->add( __( 'Processing orders.', 'wf_order_import_export' ) );
552
 
553
  // check class-wc-checkout.php for reference
554
 
@@ -590,7 +590,7 @@ class WF_OrderImpExpCsv_Order_Import extends WP_Importer {
590
  $this->errored++;
591
  $new_added = false;
592
  //$this->add_import_result('failed', __($order_id->get_error_message() , 'wf_order_import_export'), $post['order_number'], $order_data['post_title'], $post['order_number']);
593
- $this->log->add( sprintf( __( '> Error inserting %s: %s', 'wf_order_import_export'), $post['order_number'], $order_id->get_error_message() ), true );
594
  }
595
 
596
  }
@@ -758,11 +758,11 @@ class WF_OrderImpExpCsv_Order_Import extends WP_Importer {
758
  $this->add_import_result('imported', __($out_msg, 'wf_order_import_export'), $order_id, $order_data['post_title'], $order_id);
759
  $this->log->add('csv-import', sprintf(__('> &#8220;%s&#8221;' . $usr_msg, 'wf_order_import_export'), esc_html($order_data['post_title'])), true);
760
  $this->imported++;
761
- $this->log->add( sprintf( __( '> Finished importing order %s', 'wf_order_import_export' ), $dry_run ? "" : $order->get_order_number() ) );
762
 
763
  // }
764
 
765
- $this->log->add( __( 'Finished processing orders.', 'wf_order_import_export' ) );
766
 
767
  unset( $post );
768
  }
547
  // plan a dry run
548
  //$dry_run = isset( $_POST['dry_run'] ) && $_POST['dry_run'] ? true : false;
549
 
550
+ $this->log->add( 'csv-import', '---' );
551
+ $this->log->add( 'csv-import', __( 'Processing orders.', 'wf_order_import_export' ) );
552
 
553
  // check class-wc-checkout.php for reference
554
 
590
  $this->errored++;
591
  $new_added = false;
592
  //$this->add_import_result('failed', __($order_id->get_error_message() , 'wf_order_import_export'), $post['order_number'], $order_data['post_title'], $post['order_number']);
593
+ $this->log->add( 'csv-import', sprintf( __( '> Error inserting %s: %s', 'wf_order_import_export'), $post['order_number'], $order_id->get_error_message() ), true );
594
  }
595
 
596
  }
758
  $this->add_import_result('imported', __($out_msg, 'wf_order_import_export'), $order_id, $order_data['post_title'], $order_id);
759
  $this->log->add('csv-import', sprintf(__('> &#8220;%s&#8221;' . $usr_msg, 'wf_order_import_export'), esc_html($order_data['post_title'])), true);
760
  $this->imported++;
761
+ $this->log->add( 'csv-import', sprintf( __( '> Finished importing order %s', 'wf_order_import_export' ), $dry_run ? "" : $order->get_order_number() ) );
762
 
763
  // }
764
 
765
+ $this->log->add( 'csv-import', __( 'Finished processing orders.', 'wf_order_import_export' ) );
766
 
767
  unset( $post );
768
  }
order-import-export.php CHANGED
@@ -2,11 +2,11 @@
2
  /*
3
  *
4
  Plugin Name: Order / Coupon / Subscription Export Import Plugin for WooCommerce (BASIC)
5
- Plugin URI: http://www.xadapter.com/product/order-import-export-plugin-for-woocommerce/
6
  Description: Export and Import Order detail including line items, From and To your WooCommerce Store.
7
  Author: XAdapter
8
- Author URI: http://www.xadapter.com/
9
- Version: 1.1.9
10
  Text Domain: wf_order_import_export
11
  */
12
 
@@ -57,7 +57,7 @@ if (in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', ge
57
  public function wf_plugin_action_links( $links ) {
58
  $plugin_links = array(
59
  '<a href="' . admin_url( 'admin.php?page=wf_woocommerce_order_im_ex' ) . '">' . __( 'Import Export', 'wf_order_import_export' ) . '</a>',
60
- '<a href="http://www.xadapter.com/product/order-import-export-plugin-for-woocommerce/" target="_blank" style="color:#3db634;">' . __( 'Premium Upgrade', 'wf_order_import_export' ) . '</a>',
61
  '<a href="https://wordpress.org/support/plugin/order-import-export-for-woocommerce">' . __( 'Support', 'wf_order_import_export' ) . '</a>',
62
  );
63
  return array_merge( $plugin_links, $links );
2
  /*
3
  *
4
  Plugin Name: Order / Coupon / Subscription Export Import Plugin for WooCommerce (BASIC)
5
+ Plugin URI: https://www.xadapter.com/product/order-import-export-plugin-for-woocommerce/
6
  Description: Export and Import Order detail including line items, From and To your WooCommerce Store.
7
  Author: XAdapter
8
+ Author URI: https://www.xadapter.com/
9
+ Version: 1.2.0
10
  Text Domain: wf_order_import_export
11
  */
12
 
57
  public function wf_plugin_action_links( $links ) {
58
  $plugin_links = array(
59
  '<a href="' . admin_url( 'admin.php?page=wf_woocommerce_order_im_ex' ) . '">' . __( 'Import Export', 'wf_order_import_export' ) . '</a>',
60
+ '<a href="https://www.xadapter.com/product/order-import-export-plugin-for-woocommerce/" target="_blank" style="color:#3db634;">' . __( 'Premium Upgrade', 'wf_order_import_export' ) . '</a>',
61
  '<a href="https://wordpress.org/support/plugin/order-import-export-for-woocommerce">' . __( 'Support', 'wf_order_import_export' ) . '</a>',
62
  );
63
  return array_merge( $plugin_links, $links );
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link:
4
  Tags: woocommerce export orders, woocommerce import orders, woocommerce export import orders, export woocommerce orders with line item details,woocommerce export coupons, woocommerce import coupons, woocommerce export import coupons
5
  Requires at least: 3.0.1
6
  Tested up to: 4.8
7
- Stable tag: 1.1.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -75,6 +75,8 @@ Yes. You can import or export order line item details.
75
  3. Exported sample order Screen
76
 
77
  == Changelog ==
 
 
78
  = 1.1.9 =
79
  * Minor Content Change.
80
  = 1.1.8 =
@@ -118,6 +120,8 @@ Yes. You can import or export order line item details.
118
  * Export /Import WooCommerce Orders.
119
 
120
  == Upgrade Notice ==
 
 
121
  = 1.1.9 =
122
  * Minor Content Change.
123
  = 1.1.8 =
4
  Tags: woocommerce export orders, woocommerce import orders, woocommerce export import orders, export woocommerce orders with line item details,woocommerce export coupons, woocommerce import coupons, woocommerce export import coupons
5
  Requires at least: 3.0.1
6
  Tested up to: 4.8
7
+ Stable tag: 1.2.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
75
  3. Exported sample order Screen
76
 
77
  == Changelog ==
78
+ = 1.2.0 =
79
+ * Bug fix: Fixed WC Log issues.
80
  = 1.1.9 =
81
  * Minor Content Change.
82
  = 1.1.8 =
120
  * Export /Import WooCommerce Orders.
121
 
122
  == Upgrade Notice ==
123
+ = 1.2.0 =
124
+ * Bug fix: Fixed WC Log issues.
125
  = 1.1.9 =
126
  * Minor Content Change.
127
  = 1.1.8 =