Order Export & Order Import for WooCommerce - Version 1.1.7

Version Description

  • Compatibility with WC 2.7
Download this release

Release Info

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

Code changes from version 1.1.6 to 1.1.7

includes/exporter/class-wf-orderimpexpcsv-exporter.php CHANGED
@@ -151,7 +151,7 @@ class WF_OrderImpExpCsv_Exporter {
151
 
152
  $line_item = array(
153
  'name' => html_entity_decode($product->get_title() ? $product->get_title() : $item['name'], ENT_NOQUOTES, 'UTF-8'),
154
- 'product_id' => $product->id,
155
  'sku' => $product->get_sku(),
156
  'quantity' => $item['qty'],
157
  'total' => wc_format_decimal($order->get_line_total($item), 2),
@@ -205,7 +205,7 @@ class WF_OrderImpExpCsv_Exporter {
205
 
206
  $coupon = new WC_Coupon($coupon_item['name']);
207
 
208
- $coupon_post = get_post($coupon->id);
209
 
210
  $coupon_items[] = implode('|', array(
211
  'code:' . $coupon_item['name'],
@@ -214,6 +214,7 @@ class WF_OrderImpExpCsv_Exporter {
214
  ));
215
  }
216
 
 
217
  $order_data = array(
218
  'order_id' => $order->id,
219
  'order_number' => $order->get_order_number(),
@@ -262,7 +263,58 @@ class WF_OrderImpExpCsv_Exporter {
262
  'order_notes' => implode('|', WF_OrderImpExpCsv_Exporter::get_order_notes($order)),
263
  'download_permissions' => $order->download_permissions_granted ? $order->download_permissions_granted : 0,
264
  );
265
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
266
  foreach ($order_data as $key => $value) {
267
  if (!$export_columns || in_array( $key, $export_columns ) ){
268
  // need to modify code
@@ -287,7 +339,7 @@ class WF_OrderImpExpCsv_Exporter {
287
  $callback = array('WC_Comments', 'exclude_order_comments');
288
 
289
  $args = array(
290
- 'post_id' => $order->id,
291
  'approve' => 'approve',
292
  'type' => 'order_note'
293
  );
151
 
152
  $line_item = array(
153
  'name' => html_entity_decode($product->get_title() ? $product->get_title() : $item['name'], ENT_NOQUOTES, 'UTF-8'),
154
+ 'product_id' => (WC()->version < '2.7.0')?$product->id:$product->get_id(),
155
  'sku' => $product->get_sku(),
156
  'quantity' => $item['qty'],
157
  'total' => wc_format_decimal($order->get_line_total($item), 2),
205
 
206
  $coupon = new WC_Coupon($coupon_item['name']);
207
 
208
+ $coupon_post = get_post((WC()->version < '2.7.0')?$coupon->id:$coupon->get_id());
209
 
210
  $coupon_items[] = implode('|', array(
211
  'code:' . $coupon_item['name'],
214
  ));
215
  }
216
 
217
+ if (version_compare(WC_VERSION, '2.7', '<')) {
218
  $order_data = array(
219
  'order_id' => $order->id,
220
  'order_number' => $order->get_order_number(),
263
  'order_notes' => implode('|', WF_OrderImpExpCsv_Exporter::get_order_notes($order)),
264
  'download_permissions' => $order->download_permissions_granted ? $order->download_permissions_granted : 0,
265
  );
266
+ }else{
267
+
268
+ $order_data = array(
269
+ 'order_id' => $order->get_id(),
270
+ 'order_number' => $order->get_order_number(),
271
+ 'order_date' => date('Y-m-d H:i:s' ,$order->get_date_created()),
272
+ 'status' => $order->get_status(),
273
+ 'shipping_total' => $order->get_total_shipping(),
274
+ 'shipping_tax_total' => wc_format_decimal($order->get_shipping_tax(), 2),
275
+ 'fee_total' => wc_format_decimal($fee_total, 2),
276
+ 'fee_tax_total' => wc_format_decimal($fee_tax_total, 2),
277
+ 'tax_total' => wc_format_decimal($order->get_total_tax(), 2),
278
+ 'cart_discount' => (defined('WC_VERSION') && (WC_VERSION >= 2.3)) ? wc_format_decimal($order->get_total_discount(), 2) : wc_format_decimal($order->get_cart_discount(), 2),
279
+ 'order_discount' => (defined('WC_VERSION') && (WC_VERSION >= 2.3)) ? wc_format_decimal($order->get_total_discount(), 2) : wc_format_decimal($order->get_order_discount(), 2),
280
+ 'discount_total' => wc_format_decimal($order->get_total_discount(), 2),
281
+ 'order_total' => @wc_format_decimal($order->get_total(), 2),
282
+ 'refunded_total' => wc_format_decimal($order->get_total_refunded(), 2),
283
+ 'order_currency' => $order->get_currency(),
284
+ 'payment_method' => $order->get_payment_method(),
285
+ 'shipping_method' => $order->get_shipping_method(),
286
+ 'customer_id' => $order->get_user_id(),
287
+ 'customer_user' => $order->get_user_id(),
288
+ 'billing_first_name' => $order->get_billing_first_name(),
289
+ 'billing_last_name' => $order->get_billing_last_name(),
290
+ 'billing_company' => $order->get_billing_company(),
291
+ 'billing_email' => $order->get_billing_email(),
292
+ 'billing_phone' => $order->get_billing_phone(),
293
+ 'billing_address_1' => $order->get_billing_address_1(),
294
+ 'billing_address_2' => $order->get_billing_address_2(),
295
+ 'billing_postcode' => $order->get_billing_postcode(),
296
+ 'billing_city' => $order->get_billing_city(),
297
+ 'billing_state' => $order->get_billing_state(),
298
+ 'billing_country' => $order->get_billing_country(),
299
+ 'shipping_first_name' => $order->get_shipping_first_name(),
300
+ 'shipping_last_name' => $order->get_shipping_last_name(),
301
+ 'shipping_company' => $order->get_shipping_company(),
302
+ 'shipping_address_1' => $order->get_shipping_address_1(),
303
+ 'shipping_address_2' => $order->get_shipping_address_2(),
304
+ 'shipping_postcode' => $order->get_shipping_postcode(),
305
+ 'shipping_city' => $order->get_shipping_city(),
306
+ 'shipping_state' => $order->get_shipping_state(),
307
+ 'shipping_country' => $order->get_shipping_country(),
308
+ 'customer_note' => $order->get_customer_note(),
309
+ 'shipping_items' => implode(';', $shipping_items),
310
+ 'fee_items' => implode(';', $fee_items),
311
+ 'tax_items' => implode(';', $tax_items),
312
+ 'coupon_items' => implode(';', $coupon_items),
313
+ 'order_notes' => implode('|', WF_OrderImpExpCsv_Exporter::get_order_notes($order)),
314
+ 'download_permissions' => $order->is_download_permitted() ? $order->is_download_permitted() : 0,
315
+ );
316
+
317
+ }
318
  foreach ($order_data as $key => $value) {
319
  if (!$export_columns || in_array( $key, $export_columns ) ){
320
  // need to modify code
339
  $callback = array('WC_Comments', 'exclude_order_comments');
340
 
341
  $args = array(
342
+ 'post_id' => (WC()->version < '2.7.0')?$order->id:$order->get_id(),
343
  'approve' => 'approve',
344
  'type' => 'order_note'
345
  );
includes/importer/class-wf-cpnimpexpcsv-coupon-import.php CHANGED
@@ -147,9 +147,9 @@ class WF_CpnImpExpCsv_Coupon_Import extends WP_Importer {
147
  var data = {
148
  action: 'coupon_csv_import_request',
149
  file: '<?php echo addslashes( $file ); ?>',
150
- mapping: '<?php echo json_encode( $_POST['map_from'] ); ?>',
151
  profile: '<?php echo $this->profile; ?>',
152
- eval_field: '<?php echo stripslashes(json_encode(($_POST['eval_field']),JSON_HEX_APOS)) ?>',
153
  delimiter: '<?php echo $this->delimiter; ?>',
154
  merge_empty_cells: '<?php echo $this->merge_empty_cells; ?>',
155
  start_pos: start_pos,
147
  var data = {
148
  action: 'coupon_csv_import_request',
149
  file: '<?php echo addslashes( $file ); ?>',
150
+ mapping: '<?php echo @json_encode( $_POST['map_from'] ); ?>',
151
  profile: '<?php echo $this->profile; ?>',
152
+ eval_field: '<?php echo @stripslashes(json_encode(($_POST['eval_field']),JSON_HEX_APOS)) ?>',
153
  delimiter: '<?php echo $this->delimiter; ?>',
154
  merge_empty_cells: '<?php echo $this->merge_empty_cells; ?>',
155
  start_pos: start_pos,
order-import-export.php CHANGED
@@ -6,7 +6,7 @@ Plugin URI: http://www.xadapter.com/product/order-import-export-plugin-for-wooco
6
  Description: Export and Import Order detail including line items, From and To your WooCommerce Store.
7
  Author: HikeForce
8
  Author URI: http://www.xadapter.com/vendor/hikeforce/
9
- Version: 1.1.6
10
  Text Domain: wf_order_import_export
11
  */
12
 
6
  Description: Export and Import Order detail including line items, From and To your WooCommerce Store.
7
  Author: HikeForce
8
  Author URI: http://www.xadapter.com/vendor/hikeforce/
9
+ Version: 1.1.7
10
  Text Domain: wf_order_import_export
11
  */
12
 
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Order / Coupon / Subscription Export Import Plugin for WooCommerce (BASIC) ===
2
- Contributors: hikeforce, elvinwf
3
  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.7
7
- Stable tag: 1.1.6
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.6 =
79
  * Sample CSV file updated.
80
  = 1.1.5 =
@@ -112,6 +114,8 @@ Yes. You can import or export order line item details.
112
  * Export /Import WooCommerce Orders.
113
 
114
  == Upgrade Notice ==
 
 
115
  = 1.1.6 =
116
  * Sample CSV file updated
117
  = 1.1.5 =
1
  === Order / Coupon / Subscription Export Import Plugin for WooCommerce (BASIC) ===
2
+ Contributors: hikeforce, niwf, mujeebur
3
  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.7
7
+ Stable tag: 1.1.7
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.1.7 =
79
+ * Compatibility with WC 2.7
80
  = 1.1.6 =
81
  * Sample CSV file updated.
82
  = 1.1.5 =
114
  * Export /Import WooCommerce Orders.
115
 
116
  == Upgrade Notice ==
117
+ = 1.1.7 =
118
+ * Compatibility with WC 2.7
119
  = 1.1.6 =
120
  * Sample CSV file updated
121
  = 1.1.5 =