WooCommerce – Store Exporter - Version 1.9.6

Version Description

  • Added: Dismiss option to PHP FORM limit notice
  • Added: Order export support
  • Added: Transient storage for User Roles and Order Statuses
  • Fixed: Possible issue with Export buttons trigerring wrong export type (thanks Yaniv)
  • Added: Dismiss welcome notice on Overview screen after first export
  • Added: Filter Orders by Date support
  • Fixed: Select all and unselect all ignore disabled export fields
  • Changed: Bring codebases of Pro Plugin closer to help with porting changes
Download this release

Release Info

Developer visser
Plugin Icon 128x128 WooCommerce – Store Exporter
Version 1.9.6
Comparing to
See all releases

Code changes from version 1.9.5 to 1.9.6

exporter.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WooCommerce - Store Exporter
4
  Plugin URI: http://www.visser.com.au/woocommerce/plugins/exporter/
5
  Description: Export store details out of WooCommerce into simple formatted files (e.g. CSV, TSV, Excel formats including XLS and XLSX, XML, etc.)
6
- Version: 1.9.5
7
  Author: Visser Labs
8
  Author URI: http://www.visser.com.au/about/
9
  License: GPL2
@@ -353,6 +353,8 @@ if( is_admin() ) {
353
  'user_orderby' => $export->user_orderby,
354
  'user_order' => $export->user_order
355
  );
 
 
356
  if( empty( $export->fields ) ) {
357
  if( function_exists( sprintf( 'woo_ce_get_%s_fields', $export->type ) ) ) {
358
  $export->fields = call_user_func_array( 'woo_ce_get_' . $export->type . '_fields', array( 'summary' ) );
3
  Plugin Name: WooCommerce - Store Exporter
4
  Plugin URI: http://www.visser.com.au/woocommerce/plugins/exporter/
5
  Description: Export store details out of WooCommerce into simple formatted files (e.g. CSV, TSV, Excel formats including XLS and XLSX, XML, etc.)
6
+ Version: 1.9.6
7
  Author: Visser Labs
8
  Author URI: http://www.visser.com.au/about/
9
  License: GPL2
353
  'user_orderby' => $export->user_orderby,
354
  'user_order' => $export->user_order
355
  );
356
+ $export->args = apply_filters( 'woo_ce_extend_dataset_args', $export->args, $export->type );
357
+
358
  if( empty( $export->fields ) ) {
359
  if( function_exists( sprintf( 'woo_ce_get_%s_fields', $export->type ) ) ) {
360
  $export->fields = call_user_func_array( 'woo_ce_get_' . $export->type . '_fields', array( 'summary' ) );
includes/admin.php CHANGED
@@ -43,6 +43,7 @@ function woo_ce_admin_notice_html( $message = '', $priority = 'updated', $screen
43
  }
44
 
45
  }
 
46
  // Override for WooCommerce notice styling
47
  if( $priority == 'notice' )
48
  $priority = 'updated woocommerce-message'; ?>
@@ -104,7 +105,8 @@ function woo_ce_quick_export_in_process() {
104
  if( !woo_ce_get_option( 'dismiss_max_input_vars_prompt', 0 ) ) {
105
  $troubleshooting_url = 'https://www.visser.com.au/documentation/store-exporter-deluxe/troubleshooting/';
106
 
107
- $message = '<strong>It looks like you have more HTML FORM fields on this screen than your hosting server can process.</strong><br /><br />Just a heads up this PHP configration option <code>max_input_vars</code> limitation may affect export generation and/or saving changes to Scheduled Exports and Export Templates.';
 
108
  $message .= sprintf( ' <a href="%s" target="_blank">%s</a>', $troubleshooting_url . '#unable-to-edit-or-save-export-field-changes-on-the-edit-export-template-screen-or-the-quick-export-screen-just-refreshes', __( 'Need help?', 'woocommerce-exporter' ) );
109
  woo_ce_admin_notice_html( $message, 'error', false, 'max_input_vars' );
110
  }
@@ -165,8 +167,12 @@ add_filter( 'woocommerce_screen_ids', 'woo_ce_wc_screen_ids', 10, 1 );
165
  // Add Store Export to WordPress Administration menu
166
  function woo_ce_admin_menu() {
167
 
168
- $page = add_submenu_page( 'woocommerce', __( 'Store Exporter', 'woocommerce-exporter' ), __( 'Store Export', 'woocommerce-exporter' ), 'view_woocommerce_reports', 'woo_ce', 'woo_ce_html_page' );
169
- add_action( 'admin_print_styles-' . $page, 'woo_ce_enqueue_scripts' );
 
 
 
 
170
  add_action( 'current_screen', 'woo_ce_admin_current_screen' );
171
 
172
  }
@@ -321,7 +327,7 @@ function woo_ce_tab_template( $tab = '' ) {
321
  $category = woo_ce_get_export_type_count( 'category' );
322
  $tag = woo_ce_get_export_type_count( 'tag' );
323
  $brand = '999';
324
- $order = '999';
325
  $customer = '999';
326
  $user = woo_ce_get_export_type_count( 'user' );
327
  $review = '999';
@@ -333,52 +339,72 @@ function woo_ce_tab_template( $tab = '' ) {
333
  $shipping_class = '999';
334
  $ticket = '999';
335
 
336
- // Start loading the Quick Export screen
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
337
 
 
338
  add_action( 'woo_ce_export_before_options', 'woo_ce_export_export_types' );
339
  add_action( 'woo_ce_export_after_options', 'woo_ce_export_export_options' );
340
 
341
  // Products
342
- if( $product_fields = woo_ce_get_product_fields() ) {
343
  foreach( $product_fields as $key => $product_field )
344
  $product_fields[$key]['disabled'] = ( isset( $product_field['disabled'] ) ? $product_field['disabled'] : 0 );
345
  add_action( 'woo_ce_export_product_options_before_table', 'woo_ce_products_filter_by_product_category' );
346
  add_action( 'woo_ce_export_product_options_before_table', 'woo_ce_products_filter_by_product_tag' );
347
- add_action( 'woo_ce_export_product_options_before_table', 'woo_ce_products_filter_by_product_brand' );
348
- add_action( 'woo_ce_export_product_options_before_table', 'woo_ce_products_filter_by_product_vendor' );
 
 
349
  add_action( 'woo_ce_export_product_options_before_table', 'woo_ce_products_filter_by_product_status' );
350
  add_action( 'woo_ce_export_product_options_before_table', 'woo_ce_products_filter_by_product_type' );
351
  add_action( 'woo_ce_export_product_options_before_table', 'woo_ce_products_filter_by_stock_status' );
352
  add_action( 'woo_ce_export_product_options_after_table', 'woo_ce_product_sorting' );
353
- add_action( 'woo_ce_export_options', 'woo_ce_products_upsells_formatting' );
354
- add_action( 'woo_ce_export_options', 'woo_ce_products_crosssells_formatting' );
355
- add_action( 'woo_ce_export_options', 'woo_ce_export_options_gallery_format' );
356
  add_action( 'woo_ce_export_after_form', 'woo_ce_products_custom_fields' );
357
  }
358
 
359
  // Categories
360
- if( $category_fields = woo_ce_get_category_fields() ) {
361
  foreach( $category_fields as $key => $category_field )
362
  $category_fields[$key]['disabled'] = ( isset( $category_field['disabled'] ) ? $category_field['disabled'] : 0 );
363
  add_action( 'woo_ce_export_category_options_after_table', 'woo_ce_category_sorting' );
364
  }
365
 
366
  // Product Tags
367
- if( $tag_fields = woo_ce_get_tag_fields() ) {
368
  foreach( $tag_fields as $key => $tag_field )
369
  $tag_fields[$key]['disabled'] = ( isset( $tag_field['disabled'] ) ? $tag_field['disabled'] : 0 );
370
  add_action( 'woo_ce_export_tag_options_after_table', 'woo_ce_tag_sorting' );
371
  }
372
 
373
  // Brands
374
- if( $brand_fields = woo_ce_get_brand_fields() ) {
375
  foreach( $brand_fields as $key => $brand_field )
376
  $brand_fields[$key]['disabled'] = ( isset( $brand_field['disabled'] ) ? $brand_field['disabled'] : 0 );
377
  add_action( 'woo_ce_export_brand_options_before_table', 'woo_ce_brand_sorting' );
378
  }
379
 
380
  // Orders
381
- if( $order_fields = woo_ce_get_order_fields() ) {
 
 
382
  add_action( 'woo_ce_export_order_options_before_table', 'woo_ce_orders_filter_by_date' );
383
  add_action( 'woo_ce_export_order_options_before_table', 'woo_ce_orders_filter_by_status' );
384
  add_action( 'woo_ce_export_order_options_before_table', 'woo_ce_orders_filter_by_customer' );
@@ -402,14 +428,16 @@ function woo_ce_tab_template( $tab = '' ) {
402
  }
403
 
404
  // Customers
405
- if( $customer_fields = woo_ce_get_customer_fields() ) {
 
 
406
  add_action( 'woo_ce_export_customer_options_before_table', 'woo_ce_customers_filter_by_status' );
407
  add_action( 'woo_ce_export_customer_options_before_table', 'woo_ce_customers_filter_by_user_role' );
408
  add_action( 'woo_ce_export_after_form', 'woo_ce_customers_custom_fields' );
409
  }
410
 
411
  // Users
412
- if( $user_fields = woo_ce_get_user_fields() ) {
413
  foreach( $user_fields as $key => $user_field )
414
  $user_fields[$key]['disabled'] = ( isset( $user_field['disabled'] ) ? $user_field['disabled'] : 0 );
415
  add_action( 'woo_ce_export_user_options_after_table', 'woo_ce_user_sorting' );
@@ -418,25 +446,35 @@ function woo_ce_tab_template( $tab = '' ) {
418
 
419
  // Reviews
420
  if( $review_fields = ( function_exists( 'woo_ce_get_review_fields' ) ? woo_ce_get_review_fields() : false ) ) {
421
-
 
422
  }
423
 
424
  // Coupons
425
- if( $coupon_fields = woo_ce_get_coupon_fields() ) {
 
 
426
  add_action( 'woo_ce_export_coupon_options_before_table', 'woo_ce_coupon_sorting' );
427
  }
428
 
429
  // Subscriptions
430
- if( $subscription_fields = woo_ce_get_subscription_fields() ) {
 
 
431
  add_action( 'woo_ce_export_subscription_options_before_table', 'woo_ce_subscriptions_filter_by_subscription_status' );
432
  add_action( 'woo_ce_export_subscription_options_before_table', 'woo_ce_subscriptions_filter_by_subscription_product' );
433
  }
434
 
435
  // Product Vendors
436
- $product_vendor_fields = woo_ce_get_product_vendor_fields();
 
 
 
437
 
438
  // Commissions
439
- if( $commission_fields = woo_ce_get_commission_fields() ) {
 
 
440
  add_action( 'woo_ce_export_commission_options_before_table', 'woo_ce_commissions_filter_by_date' );
441
  add_action( 'woo_ce_export_commission_options_before_table', 'woo_ce_commissions_filter_by_product_vendor' );
442
  add_action( 'woo_ce_export_commission_options_before_table', 'woo_ce_commissions_filter_by_commission_status' );
@@ -444,22 +482,30 @@ function woo_ce_tab_template( $tab = '' ) {
444
  }
445
 
446
  // Shipping Classes
447
- if( $shipping_class_fields = woo_ce_get_shipping_class_fields() ) {
 
 
448
  add_action( 'woo_ce_export_shipping_class_options_after_table', 'woo_ce_shipping_class_sorting' );
449
  }
450
 
451
  // Tickets
452
 
 
 
 
 
453
 
454
  // Bookings
455
-
 
 
 
456
 
457
  // Attributes
458
- $attribute_fields = false;
459
-
460
- // Export options
461
- $limit_volume = woo_ce_get_option( 'limit_volume' );
462
- $offset = woo_ce_get_option( 'offset' );
463
  break;
464
 
465
  case 'fields':
@@ -565,7 +611,7 @@ function woo_ce_export_export_types() {
565
  $category = woo_ce_get_export_type_count( 'category' );
566
  $tag = woo_ce_get_export_type_count( 'tag' );
567
  $brand = '999';
568
- $order = '999';
569
  $customer = '999';
570
  $user = woo_ce_get_export_type_count( 'user' );
571
  $review = '999';
@@ -666,8 +712,7 @@ function woo_ce_export_export_types() {
666
  <label for="order"><?php _e( 'Orders', 'woocommerce-exporter' ); ?></label>
667
  </td>
668
  <td>
669
- <span class="description"><?php echo ( $order = 999 ? 'N/A' : $order ); ?></span>
670
- <span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span>
671
  </td>
672
  <td width="1%" class="actions">
673
  </td>
43
  }
44
 
45
  }
46
+
47
  // Override for WooCommerce notice styling
48
  if( $priority == 'notice' )
49
  $priority = 'updated woocommerce-message'; ?>
105
  if( !woo_ce_get_option( 'dismiss_max_input_vars_prompt', 0 ) ) {
106
  $troubleshooting_url = 'https://www.visser.com.au/documentation/store-exporter-deluxe/troubleshooting/';
107
 
108
+ $dismiss_url = esc_url( add_query_arg( array( 'action' => 'dismiss_max_input_vars_prompt', '_wpnonce' => wp_create_nonce( 'woo_ce_dismiss_max_input_vars_prompt' ) ) ) );
109
+ $message = '<span style="float:right;"><a href="' . $dismiss_url . '">' . __( 'Dismiss', 'woocommerce-exporter' ) . '</a></span>' . '<strong>It looks like you have more HTML FORM fields on this screen than your hosting server can process.</strong><br /><br />Just a heads up this PHP configration option <code>max_input_vars</code> limitation may affect export generation and/or saving changes to Scheduled Exports and Export Templates.';
110
  $message .= sprintf( ' <a href="%s" target="_blank">%s</a>', $troubleshooting_url . '#unable-to-edit-or-save-export-field-changes-on-the-edit-export-template-screen-or-the-quick-export-screen-just-refreshes', __( 'Need help?', 'woocommerce-exporter' ) );
111
  woo_ce_admin_notice_html( $message, 'error', false, 'max_input_vars' );
112
  }
167
  // Add Store Export to WordPress Administration menu
168
  function woo_ce_admin_menu() {
169
 
170
+ // Check the User has the view_woocommerce_reports capability
171
+ $user_capability = apply_filters( 'woo_ce_admin_user_capability', 'view_woocommerce_reports' );
172
+
173
+ $hook = add_submenu_page( 'woocommerce', __( 'Store Exporter', 'woocommerce-exporter' ), __( 'Store Export', 'woocommerce-exporter' ), $user_capability, 'woo_ce', 'woo_ce_html_page' );
174
+ // Load scripts and styling just for this Screen
175
+ add_action( 'admin_print_styles-' . $hook, 'woo_ce_enqueue_scripts' );
176
  add_action( 'current_screen', 'woo_ce_admin_current_screen' );
177
 
178
  }
327
  $category = woo_ce_get_export_type_count( 'category' );
328
  $tag = woo_ce_get_export_type_count( 'tag' );
329
  $brand = '999';
330
+ $order = woo_ce_get_export_type_count( 'order' );
331
  $customer = '999';
332
  $user = woo_ce_get_export_type_count( 'user' );
333
  $review = '999';
339
  $shipping_class = '999';
340
  $ticket = '999';
341
 
342
+ $product_fields = false;
343
+ $category_fields = false;
344
+ $tag_fields = false;
345
+ $brand_fields = false;
346
+ $order_fields = false;
347
+ $customer_fields = false;
348
+ $user_fields = false;
349
+ $review_fields = false;
350
+ $coupon_fields = false;
351
+ $attribute_fields = false;
352
+ $subscription_fields = false;
353
+ $product_vendor_fields = false;
354
+ $commission_fields = false;
355
+ $shipping_class_fields = false;
356
+ $ticket_fields = false;
357
+ $booking_fields = false;
358
 
359
+ // Start loading the Quick Export screen
360
  add_action( 'woo_ce_export_before_options', 'woo_ce_export_export_types' );
361
  add_action( 'woo_ce_export_after_options', 'woo_ce_export_export_options' );
362
 
363
  // Products
364
+ if( $product_fields = ( function_exists( 'woo_ce_get_product_fields' ) ? woo_ce_get_product_fields() : false ) ) {
365
  foreach( $product_fields as $key => $product_field )
366
  $product_fields[$key]['disabled'] = ( isset( $product_field['disabled'] ) ? $product_field['disabled'] : 0 );
367
  add_action( 'woo_ce_export_product_options_before_table', 'woo_ce_products_filter_by_product_category' );
368
  add_action( 'woo_ce_export_product_options_before_table', 'woo_ce_products_filter_by_product_tag' );
369
+ if( function_exists( 'woo_ce_products_filter_by_product_brand' ) )
370
+ add_action( 'woo_ce_export_product_options_before_table', 'woo_ce_products_filter_by_product_brand' );
371
+ if( function_exists( 'woo_ce_products_filter_by_product_vendor' ) )
372
+ add_action( 'woo_ce_export_product_options_before_table', 'woo_ce_products_filter_by_product_vendor' );
373
  add_action( 'woo_ce_export_product_options_before_table', 'woo_ce_products_filter_by_product_status' );
374
  add_action( 'woo_ce_export_product_options_before_table', 'woo_ce_products_filter_by_product_type' );
375
  add_action( 'woo_ce_export_product_options_before_table', 'woo_ce_products_filter_by_stock_status' );
376
  add_action( 'woo_ce_export_product_options_after_table', 'woo_ce_product_sorting' );
377
+ add_action( 'woo_ce_export_options', 'woo_ce_products_upsell_formatting' );
378
+ add_action( 'woo_ce_export_options', 'woo_ce_products_crosssell_formatting' );
379
+ add_action( 'woo_ce_export_options', 'woo_ce_export_options_product_gallery_formatting' );
380
  add_action( 'woo_ce_export_after_form', 'woo_ce_products_custom_fields' );
381
  }
382
 
383
  // Categories
384
+ if( $category_fields = ( function_exists( 'woo_ce_get_category_fields' ) ? woo_ce_get_category_fields() : false ) ) {
385
  foreach( $category_fields as $key => $category_field )
386
  $category_fields[$key]['disabled'] = ( isset( $category_field['disabled'] ) ? $category_field['disabled'] : 0 );
387
  add_action( 'woo_ce_export_category_options_after_table', 'woo_ce_category_sorting' );
388
  }
389
 
390
  // Product Tags
391
+ if( $tag_fields = ( function_exists( 'woo_ce_get_tag_fields' ) ? woo_ce_get_tag_fields() : false ) ) {
392
  foreach( $tag_fields as $key => $tag_field )
393
  $tag_fields[$key]['disabled'] = ( isset( $tag_field['disabled'] ) ? $tag_field['disabled'] : 0 );
394
  add_action( 'woo_ce_export_tag_options_after_table', 'woo_ce_tag_sorting' );
395
  }
396
 
397
  // Brands
398
+ if( $brand_fields = ( function_exists( 'woo_ce_get_brand_fields' ) ? woo_ce_get_brand_fields() : false ) ) {
399
  foreach( $brand_fields as $key => $brand_field )
400
  $brand_fields[$key]['disabled'] = ( isset( $brand_field['disabled'] ) ? $brand_field['disabled'] : 0 );
401
  add_action( 'woo_ce_export_brand_options_before_table', 'woo_ce_brand_sorting' );
402
  }
403
 
404
  // Orders
405
+ if( $order_fields = ( function_exists( 'woo_ce_get_order_fields' ) ? woo_ce_get_order_fields() : false ) ) {
406
+ foreach( $order_fields as $key => $order_field )
407
+ $order_fields[$key]['disabled'] = ( isset( $order_field['disabled'] ) ? $order_field['disabled'] : 0 );
408
  add_action( 'woo_ce_export_order_options_before_table', 'woo_ce_orders_filter_by_date' );
409
  add_action( 'woo_ce_export_order_options_before_table', 'woo_ce_orders_filter_by_status' );
410
  add_action( 'woo_ce_export_order_options_before_table', 'woo_ce_orders_filter_by_customer' );
428
  }
429
 
430
  // Customers
431
+ if( $customer_fields = ( function_exists( 'woo_ce_get_customer_fields' ) ? woo_ce_get_customer_fields() : false ) ) {
432
+ foreach( $customer_fields as $key => $customer_field )
433
+ $customer_fields[$key]['disabled'] = ( isset( $customer_field['disabled'] ) ? $customer_field['disabled'] : 0 );
434
  add_action( 'woo_ce_export_customer_options_before_table', 'woo_ce_customers_filter_by_status' );
435
  add_action( 'woo_ce_export_customer_options_before_table', 'woo_ce_customers_filter_by_user_role' );
436
  add_action( 'woo_ce_export_after_form', 'woo_ce_customers_custom_fields' );
437
  }
438
 
439
  // Users
440
+ if( $user_fields = ( function_exists( 'woo_ce_get_user_fields' ) ? woo_ce_get_user_fields() : false ) ) {
441
  foreach( $user_fields as $key => $user_field )
442
  $user_fields[$key]['disabled'] = ( isset( $user_field['disabled'] ) ? $user_field['disabled'] : 0 );
443
  add_action( 'woo_ce_export_user_options_after_table', 'woo_ce_user_sorting' );
446
 
447
  // Reviews
448
  if( $review_fields = ( function_exists( 'woo_ce_get_review_fields' ) ? woo_ce_get_review_fields() : false ) ) {
449
+ foreach( $review_fields as $key => $review_field )
450
+ $review_fields[$key]['disabled'] = ( isset( $review_field['disabled'] ) ? $review_field['disabled'] : 0 );
451
  }
452
 
453
  // Coupons
454
+ if( $coupon_fields = ( function_exists( 'woo_ce_get_coupon_fields' ) ? woo_ce_get_coupon_fields() : false ) ) {
455
+ foreach( $coupon_fields as $key => $coupon_field )
456
+ $coupon_fields[$key]['disabled'] = ( isset( $coupon_field['disabled'] ) ? $coupon_field['disabled'] : 0 );
457
  add_action( 'woo_ce_export_coupon_options_before_table', 'woo_ce_coupon_sorting' );
458
  }
459
 
460
  // Subscriptions
461
+ if( $subscription_fields = ( function_exists( 'woo_ce_get_subscription_fields' ) ? woo_ce_get_subscription_fields() : false ) ) {
462
+ foreach( $subscription_fields as $key => $subscription_field )
463
+ $subscription_fields[$key]['disabled'] = ( isset( $subscription_field['disabled'] ) ? $subscription_field['disabled'] : 0 );
464
  add_action( 'woo_ce_export_subscription_options_before_table', 'woo_ce_subscriptions_filter_by_subscription_status' );
465
  add_action( 'woo_ce_export_subscription_options_before_table', 'woo_ce_subscriptions_filter_by_subscription_product' );
466
  }
467
 
468
  // Product Vendors
469
+ if( $product_vendor_fields = ( function_exists( 'woo_ce_get_product_vendor_fields' ) ? woo_ce_get_product_vendor_fields() : false ) ) {
470
+ foreach( $product_vendor_fields as $key => $product_vendor_field )
471
+ $product_vendor_fields[$key]['disabled'] = ( isset( $product_vendor_field['disabled'] ) ? $product_vendor_field['disabled'] : 0 );
472
+ }
473
 
474
  // Commissions
475
+ if( $commission_fields = ( function_exists( 'woo_ce_get_commission_fields' ) ? woo_ce_get_commission_fields() : false ) ) {
476
+ foreach( $commission_fields as $key => $commission_field )
477
+ $commission_fields[$key]['disabled'] = ( isset( $commission_field['disabled'] ) ? $commission_field['disabled'] : 0 );
478
  add_action( 'woo_ce_export_commission_options_before_table', 'woo_ce_commissions_filter_by_date' );
479
  add_action( 'woo_ce_export_commission_options_before_table', 'woo_ce_commissions_filter_by_product_vendor' );
480
  add_action( 'woo_ce_export_commission_options_before_table', 'woo_ce_commissions_filter_by_commission_status' );
482
  }
483
 
484
  // Shipping Classes
485
+ if( $shipping_class_fields = ( function_exists( 'woo_ce_get_shipping_class_fields' ) ? woo_ce_get_shipping_class_fields() : false ) ) {
486
+ foreach( $shipping_class_fields as $key => $shipping_class_field )
487
+ $shipping_class_fields[$key]['disabled'] = ( isset( $shipping_class_field['disabled'] ) ? $shipping_class_field['disabled'] : 0 );
488
  add_action( 'woo_ce_export_shipping_class_options_after_table', 'woo_ce_shipping_class_sorting' );
489
  }
490
 
491
  // Tickets
492
 
493
+ if( $ticket_fields = ( function_exists( 'woo_ce_get_ticket_fields' ) ? woo_ce_get_ticket_fields() : false ) ) {
494
+ foreach( $ticket_fields as $key => $ticket_field )
495
+ $ticket_fields[$key]['disabled'] = ( isset( $ticket_field['disabled'] ) ? $ticket_field['disabled'] : 0 );
496
+ }
497
 
498
  // Bookings
499
+ if( $booking_fields = ( function_exists( 'woo_ce_get_booking_fields' ) ? woo_ce_get_booking_fields() : false ) ) {
500
+ foreach( $booking_fields as $key => $booking_field )
501
+ $booking_fields[$key]['disabled'] = ( isset( $booking_field['disabled'] ) ? $booking_field['disabled'] : 0 );
502
+ }
503
 
504
  // Attributes
505
+ if( $attribute_fields = ( function_exists( 'woo_ce_get_attribute_fields' ) ? woo_ce_get_attribute_fields() : false ) ) {
506
+ foreach( $attribute_fields as $key => $attribute_field )
507
+ $attribute_fields[$key]['disabled'] = ( isset( $attribute_field['disabled'] ) ? $attribute_field['disabled'] : 0 );
508
+ }
 
509
  break;
510
 
511
  case 'fields':
611
  $category = woo_ce_get_export_type_count( 'category' );
612
  $tag = woo_ce_get_export_type_count( 'tag' );
613
  $brand = '999';
614
+ $order = woo_ce_get_export_type_count( 'order' );
615
  $customer = '999';
616
  $user = woo_ce_get_export_type_count( 'user' );
617
  $review = '999';
712
  <label for="order"><?php _e( 'Orders', 'woocommerce-exporter' ); ?></label>
713
  </td>
714
  <td>
715
+ <?php echo $order; ?>
 
716
  </td>
717
  <td width="1%" class="actions">
718
  </td>
includes/admin/brand.php CHANGED
@@ -1,15 +1,11 @@
1
  <?php
2
- if( is_admin() ) {
 
3
 
4
- /* Start of: WordPress Administration */
 
5
 
6
- // HTML template for Coupon Sorting widget on Store Exporter screen
7
- function woo_ce_brand_sorting() {
8
-
9
- $orderby = woo_ce_get_option( 'brand_orderby', 'ID' );
10
- $order = woo_ce_get_option( 'brand_order', 'DESC' );
11
-
12
- ob_start(); ?>
13
  <p><label><?php _e( 'Brand Sorting', 'woocommerce-exporter' ); ?></label></p>
14
  <div>
15
  <select name="brand_orderby" disabled="disabled">
@@ -23,11 +19,7 @@ if( is_admin() ) {
23
  <p class="description"><?php _e( 'Select the sorting of Brands within the exported file. By default this is set to export Product Brands by Term ID in Desending order.', 'woocommerce-exporter' ); ?></p>
24
  </div>
25
  <?php
26
- ob_end_flush();
27
-
28
- }
29
-
30
- /* End of: WordPress Administration */
31
 
32
  }
33
  ?>
1
  <?php
2
+ // HTML template for Coupon Sorting widget on Store Exporter screen
3
+ function woo_ce_brand_sorting() {
4
 
5
+ $orderby = woo_ce_get_option( 'brand_orderby', 'ID' );
6
+ $order = woo_ce_get_option( 'brand_order', 'DESC' );
7
 
8
+ ob_start(); ?>
 
 
 
 
 
 
9
  <p><label><?php _e( 'Brand Sorting', 'woocommerce-exporter' ); ?></label></p>
10
  <div>
11
  <select name="brand_orderby" disabled="disabled">
19
  <p class="description"><?php _e( 'Select the sorting of Brands within the exported file. By default this is set to export Product Brands by Term ID in Desending order.', 'woocommerce-exporter' ); ?></p>
20
  </div>
21
  <?php
22
+ ob_end_flush();
 
 
 
 
23
 
24
  }
25
  ?>
includes/admin/category.php CHANGED
@@ -1,15 +1,11 @@
1
  <?php
2
- if( is_admin() ) {
 
3
 
4
- /* Start of: WordPress Administration */
 
5
 
6
- // HTML template for Category Sorting widget on Store Exporter screen
7
- function woo_ce_category_sorting() {
8
-
9
- $category_orderby = woo_ce_get_option( 'category_orderby', 'ID' );
10
- $category_order = woo_ce_get_option( 'category_order', 'DESC' );
11
-
12
- ob_start(); ?>
13
  <p><label><?php _e( 'Category Sorting', 'woocommerce-exporter' ); ?></label></p>
14
  <div>
15
  <select name="category_orderby">
@@ -23,11 +19,7 @@ if( is_admin() ) {
23
  <p class="description"><?php _e( 'Select the sorting of Categories within the exported file. By default this is set to export Categories by Term ID in Desending order.', 'woocommerce-exporter' ); ?></p>
24
  </div>
25
  <?php
26
- ob_end_flush();
27
-
28
- }
29
-
30
- /* End of: WordPress Administration */
31
 
32
  }
33
  ?>
1
  <?php
2
+ // HTML template for Category Sorting widget on Store Exporter screen
3
+ function woo_ce_category_sorting() {
4
 
5
+ $category_orderby = woo_ce_get_option( 'category_orderby', 'ID' );
6
+ $category_order = woo_ce_get_option( 'category_order', 'DESC' );
7
 
8
+ ob_start(); ?>
 
 
 
 
 
 
9
  <p><label><?php _e( 'Category Sorting', 'woocommerce-exporter' ); ?></label></p>
10
  <div>
11
  <select name="category_orderby">
19
  <p class="description"><?php _e( 'Select the sorting of Categories within the exported file. By default this is set to export Categories by Term ID in Desending order.', 'woocommerce-exporter' ); ?></p>
20
  </div>
21
  <?php
22
+ ob_end_flush();
 
 
 
 
23
 
24
  }
25
  ?>
includes/admin/commission.php CHANGED
@@ -1,24 +1,20 @@
1
  <?php
2
- if( is_admin() ) {
 
3
 
4
- /* Start of: WordPress Administration */
 
5
 
6
- // HTML template for Filter Commissions by Commission Date widget on Store Exporter screen
7
- function woo_ce_commissions_filter_by_date() {
 
 
 
 
 
 
8
 
9
- $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
10
- $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
11
-
12
- $today = date( 'l' );
13
- $yesterday = date( 'l', strtotime( '-1 days' ) );
14
- $current_month = date( 'F' );
15
- $last_month = date( 'F', mktime( 0, 0, 0, date( 'n' )-1, 1, date( 'Y' ) ) );
16
- $commission_dates_variable = '';
17
- $commission_dates_variable_length = '';
18
- $commission_dates_from = woo_ce_get_commission_first_date();
19
- $commission_dates_to = date( 'd/m/Y' );
20
-
21
- ob_start(); ?>
22
  <p><label><input type="checkbox" id="commissions-filters-date" /> <?php _e( 'Filter Commissions by Commission Date', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
23
  <div id="export-commissions-filters-date" class="separator">
24
  <ul>
@@ -73,11 +69,7 @@ if( is_admin() ) {
73
  </div>
74
  <!-- #export-commissions-filters-date -->
75
  <?php
76
- ob_end_flush();
77
-
78
- }
79
-
80
- /* End of: WordPress Administration */
81
 
82
  }
83
  ?>
1
  <?php
2
+ // HTML template for Filter Commissions by Commission Date widget on Store Exporter screen
3
+ function woo_ce_commissions_filter_by_date() {
4
 
5
+ $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
6
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
7
 
8
+ $today = date( 'l' );
9
+ $yesterday = date( 'l', strtotime( '-1 days' ) );
10
+ $current_month = date( 'F' );
11
+ $last_month = date( 'F', mktime( 0, 0, 0, date( 'n' )-1, 1, date( 'Y' ) ) );
12
+ $commission_dates_variable = '';
13
+ $commission_dates_variable_length = '';
14
+ $commission_dates_from = woo_ce_get_commission_first_date();
15
+ $commission_dates_to = date( 'd/m/Y' );
16
 
17
+ ob_start(); ?>
 
 
 
 
 
 
 
 
 
 
 
 
18
  <p><label><input type="checkbox" id="commissions-filters-date" /> <?php _e( 'Filter Commissions by Commission Date', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
19
  <div id="export-commissions-filters-date" class="separator">
20
  <ul>
69
  </div>
70
  <!-- #export-commissions-filters-date -->
71
  <?php
72
+ ob_end_flush();
 
 
 
 
73
 
74
  }
75
  ?>
includes/admin/coupon.php CHANGED
@@ -1,12 +1,8 @@
1
  <?php
2
- if( is_admin() ) {
 
3
 
4
- /* Start of: WordPress Administration */
5
-
6
- // HTML template for disabled Coupon Sorting widget on Store Exporter screen
7
- function woo_ce_coupon_sorting() {
8
-
9
- ob_start(); ?>
10
  <p><label><?php _e( 'Coupon Sorting', 'woocommerce-exporter' ); ?></label></p>
11
  <div>
12
  <select name="coupon_orderby" disabled="disabled">
@@ -23,11 +19,7 @@ if( is_admin() ) {
23
  <p class="description"><?php _e( 'Select the sorting of Coupons within the exported file. By default this is set to export Coupons by Coupon ID in Desending order.', 'woocommerce-exporter' ); ?></p>
24
  </div>
25
  <?php
26
- ob_end_flush();
27
-
28
- }
29
-
30
- /* End of: WordPress Administration */
31
 
32
  }
33
  ?>
1
  <?php
2
+ // HTML template for disabled Coupon Sorting widget on Store Exporter screen
3
+ function woo_ce_coupon_sorting() {
4
 
5
+ ob_start(); ?>
 
 
 
 
 
6
  <p><label><?php _e( 'Coupon Sorting', 'woocommerce-exporter' ); ?></label></p>
7
  <div>
8
  <select name="coupon_orderby" disabled="disabled">
19
  <p class="description"><?php _e( 'Select the sorting of Coupons within the exported file. By default this is set to export Coupons by Coupon ID in Desending order.', 'woocommerce-exporter' ); ?></p>
20
  </div>
21
  <?php
22
+ ob_end_flush();
 
 
 
 
23
 
24
  }
25
  ?>
includes/admin/customer.php CHANGED
@@ -1,17 +1,13 @@
1
  <?php
2
- if( is_admin() ) {
 
3
 
4
- /* Start of: WordPress Administration */
 
5
 
6
- // HTML template for Filter Customers by Order Status widget on Store Exporter screen
7
- function woo_ce_customers_filter_by_status() {
8
 
9
- $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
10
- $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
11
-
12
- $order_statuses = woo_ce_get_order_statuses();
13
-
14
- ob_start(); ?>
15
  <p><label><input type="checkbox" id="customers-filters-status" /> <?php _e( 'Filter Customers by Order Status', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
16
  <div id="export-customers-filters-status" class="separator">
17
  <ul>
@@ -31,19 +27,19 @@ if( is_admin() ) {
31
  </div>
32
  <!-- #export-customers-filters-status -->
33
  <?php
34
- ob_end_flush();
35
 
36
- }
37
 
38
- // HTML template for Filter Customers by User Role widget on Store Exporter screen
39
- function woo_ce_customers_filter_by_user_role() {
40
 
41
- $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
42
- $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
43
 
44
- $user_roles = woo_ce_get_user_roles();
45
 
46
- ob_start(); ?>
47
  <p><label><input type="checkbox" id="customers-filters-user_role" /> <?php _e( 'Filter Customers by User Role', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
48
  <div id="export-customers-filters-user_role" class="separator">
49
  <ul>
@@ -63,21 +59,21 @@ if( is_admin() ) {
63
  </div>
64
  <!-- #export-customers-filters-user_role -->
65
  <?php
66
- ob_end_flush();
67
 
68
- }
69
 
70
- // HTML template for disabled Custom Customers widget on Store Exporter screen
71
- function woo_ce_customers_custom_fields() {
72
 
73
- $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
74
- $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
75
 
76
- $custom_customers = '-';
77
 
78
- $troubleshooting_url = 'http://www.visser.com.au/documentation/store-exporter-deluxe/usage/';
79
 
80
- ob_start(); ?>
81
  <form method="post" id="export-customers-custom-fields" class="export-options customer-options">
82
  <div id="poststuff">
83
 
@@ -114,11 +110,7 @@ if( is_admin() ) {
114
  </form>
115
  <!-- #export-customers-custom-fields -->
116
  <?php
117
- ob_end_flush();
118
-
119
- }
120
-
121
- /* End of: WordPress Administration */
122
 
123
  }
124
  ?>
1
  <?php
2
+ // HTML template for Filter Customers by Order Status widget on Store Exporter screen
3
+ function woo_ce_customers_filter_by_status() {
4
 
5
+ $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
6
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
7
 
8
+ $order_statuses = woo_ce_get_order_statuses();
 
9
 
10
+ ob_start(); ?>
 
 
 
 
 
11
  <p><label><input type="checkbox" id="customers-filters-status" /> <?php _e( 'Filter Customers by Order Status', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
12
  <div id="export-customers-filters-status" class="separator">
13
  <ul>
27
  </div>
28
  <!-- #export-customers-filters-status -->
29
  <?php
30
+ ob_end_flush();
31
 
32
+ }
33
 
34
+ // HTML template for Filter Customers by User Role widget on Store Exporter screen
35
+ function woo_ce_customers_filter_by_user_role() {
36
 
37
+ $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
38
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
39
 
40
+ $user_roles = woo_ce_get_user_roles();
41
 
42
+ ob_start(); ?>
43
  <p><label><input type="checkbox" id="customers-filters-user_role" /> <?php _e( 'Filter Customers by User Role', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
44
  <div id="export-customers-filters-user_role" class="separator">
45
  <ul>
59
  </div>
60
  <!-- #export-customers-filters-user_role -->
61
  <?php
62
+ ob_end_flush();
63
 
64
+ }
65
 
66
+ // HTML template for disabled Custom Customers widget on Store Exporter screen
67
+ function woo_ce_customers_custom_fields() {
68
 
69
+ $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
70
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
71
 
72
+ $custom_customers = '-';
73
 
74
+ $troubleshooting_url = 'http://www.visser.com.au/documentation/store-exporter-deluxe/usage/';
75
 
76
+ ob_start(); ?>
77
  <form method="post" id="export-customers-custom-fields" class="export-options customer-options">
78
  <div id="poststuff">
79
 
110
  </form>
111
  <!-- #export-customers-custom-fields -->
112
  <?php
113
+ ob_end_flush();
 
 
 
 
114
 
115
  }
116
  ?>
includes/admin/order.php CHANGED
@@ -1,44 +1,49 @@
1
  <?php
2
- if( is_admin() ) {
3
-
4
- /* Start of: WordPress Administration */
5
-
6
- // HTML template for Filter Orders by Order Date widget on Store Exporter screen
7
- function woo_ce_orders_filter_by_date() {
8
-
9
- $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
10
- $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
11
-
12
- $today = date( 'l' );
13
- $yesterday = date( 'l', strtotime( '-1 days' ) );
14
- $current_month = date( 'F' );
15
- $last_month = date( 'F', mktime( 0, 0, 0, date( 'n' )-1, 1, date( 'Y' ) ) );
16
- $order_dates_variable = '-';
17
- $order_dates_variable_length = '';
18
- $order_dates_from = '-';
19
- $order_dates_to = '-';
20
-
21
- ob_start(); ?>
22
- <p><label><input type="checkbox" id="orders-filters-date" /> <?php _e( 'Filter Orders by Order Date', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
 
 
23
  <div id="export-orders-filters-date" class="separator">
24
  <ul>
25
  <li>
26
- <label><input type="radio" name="order_dates_filter" value="today" disabled="disabled" /> <?php _e( 'Today', 'woocommerce-exporter' ); ?> (<?php echo $today; ?>)</label>
 
 
 
27
  </li>
28
  <li>
29
- <label><input type="radio" name="order_dates_filter" value="yesterday" disabled="disabled" /> <?php _e( 'Yesterday', 'woocommerce-exporter' ); ?> (<?php echo $yesterday; ?>)</label>
30
  </li>
31
  <li>
32
- <label><input type="radio" name="order_dates_filter" value="current_week" disabled="disabled" /> <?php _e( 'Current week', 'woocommerce-exporter' ); ?></label>
33
  </li>
34
  <li>
35
- <label><input type="radio" name="order_dates_filter" value="last_week" disabled="disabled" /> <?php _e( 'Last week', 'woocommerce-exporter' ); ?></label>
36
  </li>
37
  <li>
38
- <label><input type="radio" name="order_dates_filter" value="current_month" disabled="disabled" /> <?php _e( 'Current month', 'woocommerce-exporter' ); ?> (<?php echo $current_month; ?>)</label>
39
  </li>
40
  <li>
41
- <label><input type="radio" name="order_dates_filter" value="last_month" disabled="disabled" /> <?php _e( 'Last month', 'woocommerce-exporter' ); ?> (<?php echo $last_month; ?>)</label>
42
  </li>
43
  <!--
44
  <li>
@@ -46,7 +51,7 @@ if( is_admin() ) {
46
  </li>
47
  -->
48
  <li>
49
- <label><input type="radio" name="order_dates_filter" value="variable" disabled="disabled" /> <?php _e( 'Variable date', 'woocommerce-exporter' ); ?></label>
50
  <div style="margin-top:0.2em;">
51
  <?php _e( 'Last', 'woocommerce-exporter' ); ?>
52
  <input type="text" name="order_dates_filter_variable" class="text code" size="4" maxlength="4" value="<?php echo $order_dates_variable; ?>" disabled="disabled" />
@@ -63,27 +68,27 @@ if( is_admin() ) {
63
  </div>
64
  </li>
65
  <li>
66
- <label><input type="radio" name="order_dates_filter" value="manual" disabled="disabled" /> <?php _e( 'Fixed date', 'woocommerce-exporter' ); ?></label>
67
  <div style="margin-top:0.2em;">
68
  <input type="text" size="10" maxlength="10" id="order_dates_from" name="order_dates_from" value="<?php echo esc_attr( $order_dates_from ); ?>" class="text" disabled="disabled" /> to <input type="text" size="10" maxlength="10" id="order_dates_to" name="order_dates_to" value="<?php echo esc_attr( $order_dates_to ); ?>" class="text" disabled="disabled" />
69
- <p class="description"><?php _e( 'Filter the dates of Orders to be included in the export. Default is the date of the first order to today.', 'woocommerce-exporter' ); ?></p>
70
  </div>
71
  </li>
72
  </ul>
73
  </div>
74
  <!-- #export-orders-filters-date -->
75
  <?php
76
- ob_end_flush();
77
 
78
- }
79
 
80
- // HTML template for Filter Orders by Customer widget on Store Exporter screen
81
- function woo_ce_orders_filter_by_customer() {
82
 
83
- $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
84
- $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
85
 
86
- ob_start(); ?>
87
  <p><label><input type="checkbox" id="orders-filters-customer" /> <?php _e( 'Filter Orders by Customer', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
88
  <div id="export-orders-filters-customer" class="separator">
89
  <ul>
@@ -97,19 +102,19 @@ if( is_admin() ) {
97
  </div>
98
  <!-- #export-orders-filters-customer -->
99
  <?php
100
- ob_end_flush();
101
 
102
- }
103
 
104
- // HTML template for Filter Orders by Billing Country widget on Store Exporter screen
105
- function woo_ce_orders_filter_by_billing_country() {
106
 
107
- $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
108
- $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
109
 
110
- $countries = woo_ce_allowed_countries();
111
 
112
- ob_start(); ?>
113
  <p><label><input type="checkbox" id="orders-filters-billing_country" /> <?php _e( 'Filter Orders by Billing Country', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
114
  <div id="export-orders-filters-billing_country" class="separator">
115
  <ul>
@@ -132,19 +137,19 @@ if( is_admin() ) {
132
  </div>
133
  <!-- #export-orders-filters-customer -->
134
  <?php
135
- ob_end_flush();
136
 
137
- }
138
 
139
- // HTML template for Filter Orders by Shipping Country widget on Store Exporter screen
140
- function woo_ce_orders_filter_by_shipping_country() {
141
 
142
- $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
143
- $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
144
 
145
- $countries = woo_ce_allowed_countries();
146
 
147
- ob_start(); ?>
148
  <p><label><input type="checkbox" id="orders-filters-shipping_country" /> <?php _e( 'Filter Orders by Shipping Country', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
149
  <div id="export-orders-filters-shipping_country" class="separator">
150
  <ul>
@@ -165,19 +170,19 @@ if( is_admin() ) {
165
  </div>
166
  <!-- #export-orders-filters-customer -->
167
  <?php
168
- ob_end_flush();
169
 
170
- }
171
 
172
- // HTML template for Filter Orders by User Role widget on Store Exporter screen
173
- function woo_ce_orders_filter_by_user_role() {
174
 
175
- $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
176
- $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
177
 
178
- $user_roles = woo_ce_get_user_roles();
179
 
180
- ob_start(); ?>
181
  <p><label><input type="checkbox" id="orders-filters-user_role" /> <?php _e( 'Filter Orders by User Role', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
182
  <div id="export-orders-filters-user_role" class="separator">
183
  <ul>
@@ -197,17 +202,17 @@ if( is_admin() ) {
197
  </div>
198
  <!-- #export-orders-filters-user_role -->
199
  <?php
200
- ob_end_flush();
201
 
202
- }
203
 
204
- // HTML template for Filter Orders by Order ID widget on Store Exporter screen
205
- function woo_ce_orders_filter_by_order_id() {
206
 
207
- $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
208
- $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
209
 
210
- ob_start(); ?>
211
  <p><label><input type="checkbox" id="orders-filters-id" /> <?php _e( 'Filter Orders by Order ID', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
212
  <div id="export-orders-filters-id" class="separator">
213
  <ul>
@@ -220,23 +225,23 @@ if( is_admin() ) {
220
  </div>
221
  <!-- #export-orders-filters-user_role -->
222
  <?php
223
- ob_end_flush();
224
 
225
- }
226
 
227
- // HTML template for Filter Orders by Coupon Code widget on Store Exporter screen
228
- function woo_ce_orders_filter_by_coupon() {
229
 
230
- $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
231
- $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
232
 
233
- $args = array(
234
- 'coupon_orderby' => 'ID',
235
- 'coupon_order' => 'DESC'
236
- );
237
- $coupons = woo_ce_get_coupons( $args );
238
 
239
- ob_start(); ?>
240
  <p><label><input type="checkbox" id="orders-filters-coupon" /> <?php _e( 'Filter Orders by Coupon Code', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
241
  <div id="export-orders-filters-coupon" class="separator">
242
  <ul>
@@ -256,17 +261,17 @@ if( is_admin() ) {
256
  </div>
257
  <!-- #export-orders-filters-coupon -->
258
  <?php
259
- ob_end_flush();
260
 
261
- }
262
 
263
- // HTML template for Filter Orders by Payment Gateway widget on Store Exporter screen
264
- function woo_ce_orders_filter_by_payment_gateway() {
265
 
266
- $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
267
- $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
268
 
269
- ob_start(); ?>
270
  <p><label><input type="checkbox" id="orders-filters-payment_gateway" /> <?php _e( 'Filter Orders by Payment Gateway', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
271
  <div id="export-orders-filters-payment_gateway" class="separator">
272
  <ul>
@@ -280,17 +285,17 @@ if( is_admin() ) {
280
  </div>
281
  <!-- #export-orders-filters-coupon -->
282
  <?php
283
- ob_end_flush();
284
 
285
- }
286
 
287
- // HTML template for Filter Orders by Shipping Gateway widget on Store Exporter screen
288
- function woo_ce_orders_filter_by_shipping_method() {
289
 
290
- $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
291
- $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
292
 
293
- ob_start(); ?>
294
  <p><label><input type="checkbox" id="orders-filters-shipping_method" /> <?php _e( 'Filter Orders by Shipping Method', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
295
  <div id="export-orders-filters-shipping_method" class="separator">
296
  <ul>
@@ -304,23 +309,23 @@ if( is_admin() ) {
304
  </div>
305
  <!-- #export-orders-filters-coupon -->
306
  <?php
307
- ob_end_flush();
308
 
309
- }
310
 
311
- // HTML template for Order Items Formatting on Store Exporter screen
312
- function woo_ce_orders_items_formatting() {
313
 
314
- $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
315
- $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
316
 
317
- ob_start(); ?>
318
  <tr class="export-options order-options">
319
  <th><label for="order_items"><?php _e( 'Order items formatting', 'woocommerce-exporter' ); ?></label></th>
320
  <td>
321
  <ul>
322
  <li>
323
- <label><input type="radio" name="order_items" value="combined" disabled="disabled" />&nbsp;<?php _e( 'Place Order Items within a grouped single Order row', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label>
324
  <p class="description"><?php _e( 'For example: <code>Order Items: SKU</code> cell might contain <code>SPECK-IPHONE|INCASE-NANO|-</code> for 3 Order items within an Order', 'woocommerce-exporter' ); ?></p>
325
  </li>
326
  <li>
@@ -337,19 +342,19 @@ if( is_admin() ) {
337
  </td>
338
  </tr>
339
  <?php
340
- ob_end_flush();
341
 
342
- }
343
 
344
- // HTML template for Max Order Items widget on Store Exporter screen
345
- function woo_ce_orders_max_order_items() {
346
 
347
- $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
348
- $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
349
 
350
- $max_size = 10;
351
 
352
- ob_start(); ?>
353
  <tr id="max_order_items_option" class="export-options order-options">
354
  <th>
355
  <label for="max_order_items"><?php _e( 'Max unique Order items', 'woocommerce-exporter' ); ?>: </label>
@@ -360,23 +365,23 @@ if( is_admin() ) {
360
  </td>
361
  </tr>
362
  <?php
363
- ob_end_flush();
364
 
365
- }
366
 
367
- // HTML template for Order Items Types on Store Exporter screen
368
- function woo_ce_orders_items_types() {
369
 
370
- $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
371
- $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
372
 
373
- $types = woo_ce_get_order_items_types();
374
- $order_items_types = woo_ce_get_option( 'order_items_types', array() );
375
- // Default to Line Item
376
- if( empty( $order_items_types ) )
377
- $order_items_types = array( 'line_item' );
378
 
379
- ob_start(); ?>
380
  <tr class="export-options order-options">
381
  <th><label><?php _e( 'Order item types', 'woocommerce-exporter' ); ?></label></th>
382
  <td>
@@ -389,19 +394,19 @@ if( is_admin() ) {
389
  </td>
390
  </tr>
391
  <?php
392
- ob_end_flush();
393
 
394
- }
395
 
396
- // HTML template for Filter Orders by Order Status widget on Store Exporter screen
397
- function woo_ce_orders_filter_by_status() {
398
 
399
- $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
400
- $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
401
 
402
- $order_statuses = woo_ce_get_order_statuses();
403
 
404
- ob_start(); ?>
405
  <p><label><input type="checkbox" id="orders-filters-status" /> <?php _e( 'Filter Orders by Order Status', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
406
  <div id="export-orders-filters-status" class="separator">
407
  <ul>
@@ -421,22 +426,22 @@ if( is_admin() ) {
421
  </div>
422
  <!-- #export-orders-filters-status -->
423
  <?php
424
- ob_end_flush();
425
 
426
- }
427
 
428
- // HTML template for Filter Orders by Product widget on Store Exporter screen
429
- function woo_ce_orders_filter_by_product() {
430
 
431
- $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
432
- $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
433
 
434
- $args = array(
435
- 'hide_empty' => 1
436
- );
437
- $products = woo_ce_get_products( $args );
438
 
439
- ob_start(); ?>
440
  <p><label><input type="checkbox" id="orders-filters-product" /> <?php _e( 'Filter Orders by Product', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
441
  <div id="export-orders-filters-product" class="separator">
442
  <ul>
@@ -456,22 +461,22 @@ if( is_admin() ) {
456
  </div>
457
  <!-- #export-orders-filters-product -->
458
  <?php
459
- ob_end_flush();
460
 
461
- }
462
 
463
- // HTML template for Filter Orders by Product Category widget on Store Exporter screen
464
- function woo_ce_orders_filter_by_product_category() {
465
 
466
- $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
467
- $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
468
 
469
- $args = array(
470
- 'hide_empty' => 1
471
- );
472
- $product_categories = woo_ce_get_product_categories( $args );
473
 
474
- ob_start(); ?>
475
  <p><label><input type="checkbox" id="orders-filters-category" /> <?php _e( 'Filter Orders by Product Category', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
476
  <div id="export-orders-filters-category" class="separator">
477
  <ul>
@@ -491,22 +496,22 @@ if( is_admin() ) {
491
  </div>
492
  <!-- #export-orders-filters-category -->
493
  <?php
494
- ob_end_flush();
495
 
496
- }
497
 
498
- // HTML template for Filter Orders by Product Tag widget on Store Exporter screen
499
- function woo_ce_orders_filter_by_product_tag() {
500
 
501
- $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
502
- $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
503
 
504
- $args = array(
505
- 'hide_empty' => 1
506
- );
507
- $product_tags = woo_ce_get_product_tags( $args );
508
 
509
- ob_start(); ?>
510
  <p><label><input type="checkbox" id="orders-filters-tag" /> <?php _e( 'Filter Orders by Product Tag', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
511
  <div id="export-orders-filters-tag" class="separator">
512
  <ul>
@@ -526,27 +531,27 @@ if( is_admin() ) {
526
  </div>
527
  <!-- #export-orders-filters-tag -->
528
  <?php
529
- ob_end_flush();
530
 
531
- }
532
 
533
- // HTML template for Filter Orders by Brand widget on Store Exporter screen
534
- function woo_ce_orders_filter_by_product_brand() {
535
 
536
- $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
537
- $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
538
 
539
- // WooCommerce Brands Addon - http://woothemes.com/woocommerce/
540
- // WooCommerce Brands - http://proword.net/Woocommerce_Brands/
541
- if( woo_ce_detect_product_brands() == false )
542
- return;
543
 
544
- $args = array(
545
- 'hide_empty' => 1
546
- );
547
- $product_brands = woo_ce_get_product_brands( $args );
548
 
549
- ob_start(); ?>
550
  <p><label><input type="checkbox" id="orders-filters-brand" /> <?php _e( 'Filter Orders by Product Brand', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
551
  <div id="export-orders-filters-brand" class="separator">
552
  <ul>
@@ -566,14 +571,14 @@ if( is_admin() ) {
566
  </div>
567
  <!-- #export-orders-filters-brand -->
568
  <?php
569
- ob_end_flush();
570
 
571
- }
572
 
573
- // HTML template for Order Sorting widget on Store Exporter screen
574
- function woo_ce_order_sorting() {
575
 
576
- ob_start(); ?>
577
  <p><label><?php _e( 'Order Sorting', 'woocommerce-exporter' ); ?></label></p>
578
  <div>
579
  <select name="order_orderby" disabled="disabled">
@@ -590,22 +595,22 @@ if( is_admin() ) {
590
  <p class="description"><?php _e( 'Select the sorting of Orders within the exported file. By default this is set to export Orders by Order ID in Desending order.', 'woocommerce-exporter' ); ?></p>
591
  </div>
592
  <?php
593
- ob_end_flush();
594
 
595
- }
596
 
597
- // HTML template for Custom Orders widget on Store Exporter screen
598
- function woo_ce_orders_custom_fields() {
599
 
600
- $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
601
- $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
602
 
603
- $custom_orders = '-';
604
- $custom_order_items = '-';
605
 
606
- $troubleshooting_url = 'http://www.visser.com.au/documentation/store-exporter-deluxe/usage/';
607
 
608
- ob_start(); ?>
609
  <form method="post" id="export-orders-custom-fields" class="export-options order-options">
610
  <div id="poststuff">
611
 
@@ -653,11 +658,7 @@ if( is_admin() ) {
653
  </form>
654
  <!-- #export-orders-custom-fields -->
655
  <?php
656
- ob_end_flush();
657
-
658
- }
659
-
660
- /* End of: WordPress Administration */
661
 
662
  }
663
  ?>
1
  <?php
2
+ // HTML template for Filter Orders by Order Date widget on Store Exporter screen
3
+ function woo_ce_orders_filter_by_date() {
4
+
5
+ $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
6
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
7
+
8
+ $today = date( 'l' );
9
+ $yesterday = date( 'l', strtotime( '-1 days' ) );
10
+ $current_month = date( 'F' );
11
+ $last_month = date( 'F', mktime( 0, 0, 0, date( 'n' )-1, 1, date( 'Y' ) ) );
12
+ $order_dates_variable = '-';
13
+ $order_dates_variable_length = '';
14
+ $date_format = woo_ce_get_option( 'date_format', 'd/m/Y' );
15
+ $order_dates_from = '-';
16
+ $order_dates_to = '-';
17
+ $order_dates_first_order = woo_ce_get_order_first_date( $date_format );
18
+ $order_dates_last_order = woo_ce_get_order_date_filter( 'today', 'from', $date_format );
19
+ $types = woo_ce_get_option( 'order_dates_filter' );
20
+ if( empty( $types ) )
21
+ $types = 'current_week';
22
+
23
+ ob_start(); ?>
24
+ <p><label><input type="checkbox" id="orders-filters-date"<?php checked( !empty( $types ), true ); ?> /> <?php _e( 'Filter Orders by Order Date', 'woocommerce-exporter' ); ?></label></p>
25
  <div id="export-orders-filters-date" class="separator">
26
  <ul>
27
  <li>
28
+ <label><input type="radio" name="order_dates_filter" value="" disabled="disabled" /> <?php _e( 'All dates', 'woocommerce-exporter' ); ?> (<?php echo $order_dates_first_order; ?> - <?php echo $order_dates_last_order; ?>)</label>
29
+ </li>
30
+ <li>
31
+ <label><input type="radio" name="order_dates_filter" value="today"<?php checked( $types, 'today' ); ?> /> <?php _e( 'Today', 'woocommerce-exporter' ); ?> (<?php echo $today; ?>)</label>
32
  </li>
33
  <li>
34
+ <label><input type="radio" name="order_dates_filter" value="yesterday"<?php checked( $types, 'yesterday' ); ?> /> <?php _e( 'Yesterday', 'woocommerce-exporter' ); ?> (<?php echo $yesterday; ?>)</label>
35
  </li>
36
  <li>
37
+ <label><input type="radio" name="order_dates_filter" value="current_week"<?php checked( $types, 'current_week' ); ?> /> <?php _e( 'Current week', 'woocommerce-exporter' ); ?></label>
38
  </li>
39
  <li>
40
+ <label><input type="radio" name="order_dates_filter" value="last_week"<?php checked( $types, 'last_week' ); ?> /> <?php _e( 'Last week', 'woocommerce-exporter' ); ?></label>
41
  </li>
42
  <li>
43
+ <label><input type="radio" name="order_dates_filter" value="current_month" disabled="disabled" /> <?php _e( 'Current month', 'woocommerce-exporter' ); ?> (<?php echo $current_month; ?>) <span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label>
44
  </li>
45
  <li>
46
+ <label><input type="radio" name="order_dates_filter" value="last_month" disabled="disabled" /> <?php _e( 'Last month', 'woocommerce-exporter' ); ?> (<?php echo $last_month; ?>) <span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label>
47
  </li>
48
  <!--
49
  <li>
51
  </li>
52
  -->
53
  <li>
54
+ <label><input type="radio" name="order_dates_filter" value="variable" disabled="disabled" /> <?php _e( 'Variable date', 'woocommerce-exporter' ); ?> <span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label>
55
  <div style="margin-top:0.2em;">
56
  <?php _e( 'Last', 'woocommerce-exporter' ); ?>
57
  <input type="text" name="order_dates_filter_variable" class="text code" size="4" maxlength="4" value="<?php echo $order_dates_variable; ?>" disabled="disabled" />
68
  </div>
69
  </li>
70
  <li>
71
+ <label><input type="radio" name="order_dates_filter" value="manual" disabled="disabled" /> <?php _e( 'Fixed date', 'woocommerce-exporter' ); ?> <span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label>
72
  <div style="margin-top:0.2em;">
73
  <input type="text" size="10" maxlength="10" id="order_dates_from" name="order_dates_from" value="<?php echo esc_attr( $order_dates_from ); ?>" class="text" disabled="disabled" /> to <input type="text" size="10" maxlength="10" id="order_dates_to" name="order_dates_to" value="<?php echo esc_attr( $order_dates_to ); ?>" class="text" disabled="disabled" />
74
+ <p class="description"><?php _e( 'Filter the dates of Orders to be included in the export. Default is this current week.', 'woocommerce-exporter' ); ?></p>
75
  </div>
76
  </li>
77
  </ul>
78
  </div>
79
  <!-- #export-orders-filters-date -->
80
  <?php
81
+ ob_end_flush();
82
 
83
+ }
84
 
85
+ // HTML template for Filter Orders by Customer widget on Store Exporter screen
86
+ function woo_ce_orders_filter_by_customer() {
87
 
88
+ $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
89
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
90
 
91
+ ob_start(); ?>
92
  <p><label><input type="checkbox" id="orders-filters-customer" /> <?php _e( 'Filter Orders by Customer', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
93
  <div id="export-orders-filters-customer" class="separator">
94
  <ul>
102
  </div>
103
  <!-- #export-orders-filters-customer -->
104
  <?php
105
+ ob_end_flush();
106
 
107
+ }
108
 
109
+ // HTML template for Filter Orders by Billing Country widget on Store Exporter screen
110
+ function woo_ce_orders_filter_by_billing_country() {
111
 
112
+ $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
113
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
114
 
115
+ $countries = woo_ce_allowed_countries();
116
 
117
+ ob_start(); ?>
118
  <p><label><input type="checkbox" id="orders-filters-billing_country" /> <?php _e( 'Filter Orders by Billing Country', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
119
  <div id="export-orders-filters-billing_country" class="separator">
120
  <ul>
137
  </div>
138
  <!-- #export-orders-filters-customer -->
139
  <?php
140
+ ob_end_flush();
141
 
142
+ }
143
 
144
+ // HTML template for Filter Orders by Shipping Country widget on Store Exporter screen
145
+ function woo_ce_orders_filter_by_shipping_country() {
146
 
147
+ $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
148
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
149
 
150
+ $countries = woo_ce_allowed_countries();
151
 
152
+ ob_start(); ?>
153
  <p><label><input type="checkbox" id="orders-filters-shipping_country" /> <?php _e( 'Filter Orders by Shipping Country', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
154
  <div id="export-orders-filters-shipping_country" class="separator">
155
  <ul>
170
  </div>
171
  <!-- #export-orders-filters-customer -->
172
  <?php
173
+ ob_end_flush();
174
 
175
+ }
176
 
177
+ // HTML template for Filter Orders by User Role widget on Store Exporter screen
178
+ function woo_ce_orders_filter_by_user_role() {
179
 
180
+ $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
181
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
182
 
183
+ $user_roles = woo_ce_get_user_roles();
184
 
185
+ ob_start(); ?>
186
  <p><label><input type="checkbox" id="orders-filters-user_role" /> <?php _e( 'Filter Orders by User Role', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
187
  <div id="export-orders-filters-user_role" class="separator">
188
  <ul>
202
  </div>
203
  <!-- #export-orders-filters-user_role -->
204
  <?php
205
+ ob_end_flush();
206
 
207
+ }
208
 
209
+ // HTML template for Filter Orders by Order ID widget on Store Exporter screen
210
+ function woo_ce_orders_filter_by_order_id() {
211
 
212
+ $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
213
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
214
 
215
+ ob_start(); ?>
216
  <p><label><input type="checkbox" id="orders-filters-id" /> <?php _e( 'Filter Orders by Order ID', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
217
  <div id="export-orders-filters-id" class="separator">
218
  <ul>
225
  </div>
226
  <!-- #export-orders-filters-user_role -->
227
  <?php
228
+ ob_end_flush();
229
 
230
+ }
231
 
232
+ // HTML template for Filter Orders by Coupon Code widget on Store Exporter screen
233
+ function woo_ce_orders_filter_by_coupon() {
234
 
235
+ $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
236
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
237
 
238
+ $args = array(
239
+ 'coupon_orderby' => 'ID',
240
+ 'coupon_order' => 'DESC'
241
+ );
242
+ $coupons = woo_ce_get_coupons( $args );
243
 
244
+ ob_start(); ?>
245
  <p><label><input type="checkbox" id="orders-filters-coupon" /> <?php _e( 'Filter Orders by Coupon Code', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
246
  <div id="export-orders-filters-coupon" class="separator">
247
  <ul>
261
  </div>
262
  <!-- #export-orders-filters-coupon -->
263
  <?php
264
+ ob_end_flush();
265
 
266
+ }
267
 
268
+ // HTML template for Filter Orders by Payment Gateway widget on Store Exporter screen
269
+ function woo_ce_orders_filter_by_payment_gateway() {
270
 
271
+ $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
272
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
273
 
274
+ ob_start(); ?>
275
  <p><label><input type="checkbox" id="orders-filters-payment_gateway" /> <?php _e( 'Filter Orders by Payment Gateway', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
276
  <div id="export-orders-filters-payment_gateway" class="separator">
277
  <ul>
285
  </div>
286
  <!-- #export-orders-filters-coupon -->
287
  <?php
288
+ ob_end_flush();
289
 
290
+ }
291
 
292
+ // HTML template for Filter Orders by Shipping Gateway widget on Store Exporter screen
293
+ function woo_ce_orders_filter_by_shipping_method() {
294
 
295
+ $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
296
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
297
 
298
+ ob_start(); ?>
299
  <p><label><input type="checkbox" id="orders-filters-shipping_method" /> <?php _e( 'Filter Orders by Shipping Method', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
300
  <div id="export-orders-filters-shipping_method" class="separator">
301
  <ul>
309
  </div>
310
  <!-- #export-orders-filters-coupon -->
311
  <?php
312
+ ob_end_flush();
313
 
314
+ }
315
 
316
+ // HTML template for Order Items Formatting on Store Exporter screen
317
+ function woo_ce_orders_items_formatting() {
318
 
319
+ $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
320
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
321
 
322
+ ob_start(); ?>
323
  <tr class="export-options order-options">
324
  <th><label for="order_items"><?php _e( 'Order items formatting', 'woocommerce-exporter' ); ?></label></th>
325
  <td>
326
  <ul>
327
  <li>
328
+ <label><input type="radio" name="order_items" value="combined" checked="checked" />&nbsp;<?php _e( 'Place Order Items within a grouped single Order row', 'woocommerce-exporter' ); ?></label>
329
  <p class="description"><?php _e( 'For example: <code>Order Items: SKU</code> cell might contain <code>SPECK-IPHONE|INCASE-NANO|-</code> for 3 Order items within an Order', 'woocommerce-exporter' ); ?></p>
330
  </li>
331
  <li>
342
  </td>
343
  </tr>
344
  <?php
345
+ ob_end_flush();
346
 
347
+ }
348
 
349
+ // HTML template for Max Order Items widget on Store Exporter screen
350
+ function woo_ce_orders_max_order_items() {
351
 
352
+ $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
353
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
354
 
355
+ $max_size = 10;
356
 
357
+ ob_start(); ?>
358
  <tr id="max_order_items_option" class="export-options order-options">
359
  <th>
360
  <label for="max_order_items"><?php _e( 'Max unique Order items', 'woocommerce-exporter' ); ?>: </label>
365
  </td>
366
  </tr>
367
  <?php
368
+ ob_end_flush();
369
 
370
+ }
371
 
372
+ // HTML template for Order Items Types on Store Exporter screen
373
+ function woo_ce_orders_items_types() {
374
 
375
+ $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
376
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
377
 
378
+ $types = woo_ce_get_order_items_types();
379
+ $order_items_types = woo_ce_get_option( 'order_items_types', array() );
380
+ // Default to Line Item
381
+ if( empty( $order_items_types ) )
382
+ $order_items_types = array( 'line_item' );
383
 
384
+ ob_start(); ?>
385
  <tr class="export-options order-options">
386
  <th><label><?php _e( 'Order item types', 'woocommerce-exporter' ); ?></label></th>
387
  <td>
394
  </td>
395
  </tr>
396
  <?php
397
+ ob_end_flush();
398
 
399
+ }
400
 
401
+ // HTML template for Filter Orders by Order Status widget on Store Exporter screen
402
+ function woo_ce_orders_filter_by_status() {
403
 
404
+ $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
405
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
406
 
407
+ $order_statuses = woo_ce_get_order_statuses();
408
 
409
+ ob_start(); ?>
410
  <p><label><input type="checkbox" id="orders-filters-status" /> <?php _e( 'Filter Orders by Order Status', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
411
  <div id="export-orders-filters-status" class="separator">
412
  <ul>
426
  </div>
427
  <!-- #export-orders-filters-status -->
428
  <?php
429
+ ob_end_flush();
430
 
431
+ }
432
 
433
+ // HTML template for Filter Orders by Product widget on Store Exporter screen
434
+ function woo_ce_orders_filter_by_product() {
435
 
436
+ $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
437
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
438
 
439
+ $args = array(
440
+ 'hide_empty' => 1
441
+ );
442
+ $products = woo_ce_get_products( $args );
443
 
444
+ ob_start(); ?>
445
  <p><label><input type="checkbox" id="orders-filters-product" /> <?php _e( 'Filter Orders by Product', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
446
  <div id="export-orders-filters-product" class="separator">
447
  <ul>
461
  </div>
462
  <!-- #export-orders-filters-product -->
463
  <?php
464
+ ob_end_flush();
465
 
466
+ }
467
 
468
+ // HTML template for Filter Orders by Product Category widget on Store Exporter screen
469
+ function woo_ce_orders_filter_by_product_category() {
470
 
471
+ $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
472
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
473
 
474
+ $args = array(
475
+ 'hide_empty' => 1
476
+ );
477
+ $product_categories = woo_ce_get_product_categories( $args );
478
 
479
+ ob_start(); ?>
480
  <p><label><input type="checkbox" id="orders-filters-category" /> <?php _e( 'Filter Orders by Product Category', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
481
  <div id="export-orders-filters-category" class="separator">
482
  <ul>
496
  </div>
497
  <!-- #export-orders-filters-category -->
498
  <?php
499
+ ob_end_flush();
500
 
501
+ }
502
 
503
+ // HTML template for Filter Orders by Product Tag widget on Store Exporter screen
504
+ function woo_ce_orders_filter_by_product_tag() {
505
 
506
+ $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
507
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
508
 
509
+ $args = array(
510
+ 'hide_empty' => 1
511
+ );
512
+ $product_tags = woo_ce_get_product_tags( $args );
513
 
514
+ ob_start(); ?>
515
  <p><label><input type="checkbox" id="orders-filters-tag" /> <?php _e( 'Filter Orders by Product Tag', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
516
  <div id="export-orders-filters-tag" class="separator">
517
  <ul>
531
  </div>
532
  <!-- #export-orders-filters-tag -->
533
  <?php
534
+ ob_end_flush();
535
 
536
+ }
537
 
538
+ // HTML template for Filter Orders by Brand widget on Store Exporter screen
539
+ function woo_ce_orders_filter_by_product_brand() {
540
 
541
+ $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
542
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
543
 
544
+ // WooCommerce Brands Addon - http://woothemes.com/woocommerce/
545
+ // WooCommerce Brands - http://proword.net/Woocommerce_Brands/
546
+ if( woo_ce_detect_product_brands() == false )
547
+ return;
548
 
549
+ $args = array(
550
+ 'hide_empty' => 1
551
+ );
552
+ $product_brands = woo_ce_get_product_brands( $args );
553
 
554
+ ob_start(); ?>
555
  <p><label><input type="checkbox" id="orders-filters-brand" /> <?php _e( 'Filter Orders by Product Brand', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
556
  <div id="export-orders-filters-brand" class="separator">
557
  <ul>
571
  </div>
572
  <!-- #export-orders-filters-brand -->
573
  <?php
574
+ ob_end_flush();
575
 
576
+ }
577
 
578
+ // HTML template for Order Sorting widget on Store Exporter screen
579
+ function woo_ce_order_sorting() {
580
 
581
+ ob_start(); ?>
582
  <p><label><?php _e( 'Order Sorting', 'woocommerce-exporter' ); ?></label></p>
583
  <div>
584
  <select name="order_orderby" disabled="disabled">
595
  <p class="description"><?php _e( 'Select the sorting of Orders within the exported file. By default this is set to export Orders by Order ID in Desending order.', 'woocommerce-exporter' ); ?></p>
596
  </div>
597
  <?php
598
+ ob_end_flush();
599
 
600
+ }
601
 
602
+ // HTML template for Custom Orders widget on Store Exporter screen
603
+ function woo_ce_orders_custom_fields() {
604
 
605
+ $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
606
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
607
 
608
+ $custom_orders = '-';
609
+ $custom_order_items = '-';
610
 
611
+ $troubleshooting_url = 'http://www.visser.com.au/documentation/store-exporter-deluxe/usage/';
612
 
613
+ ob_start(); ?>
614
  <form method="post" id="export-orders-custom-fields" class="export-options order-options">
615
  <div id="poststuff">
616
 
658
  </form>
659
  <!-- #export-orders-custom-fields -->
660
  <?php
661
+ ob_end_flush();
 
 
 
 
662
 
663
  }
664
  ?>
includes/admin/product.php CHANGED
@@ -1,17 +1,13 @@
1
  <?php
2
- if( is_admin() ) {
 
3
 
4
- /* Start of: WordPress Administration */
 
 
 
5
 
6
- // HTML template for Filter Products by Product Category widget on Store Exporter screen
7
- function woo_ce_products_filter_by_product_category() {
8
-
9
- $args = array(
10
- 'hide_empty' => 1
11
- );
12
- $product_categories = woo_ce_get_product_categories( $args );
13
-
14
- ob_start(); ?>
15
  <p><label><input type="checkbox" id="products-filters-categories" /> <?php _e( 'Filter Products by Product Category', 'woocommerce-exporter' ); ?></label></p>
16
  <div id="export-products-filters-categories" class="separator">
17
  <ul>
@@ -31,19 +27,19 @@ if( is_admin() ) {
31
  </div>
32
  <!-- #export-products-filters-categories -->
33
  <?php
34
- ob_end_flush();
35
 
36
- }
37
 
38
- // HTML template for Filter Products by Product Tag widget on Store Exporter screen
39
- function woo_ce_products_filter_by_product_tag() {
40
 
41
- $args = array(
42
- 'hide_empty' => 1
43
- );
44
- $product_tags = woo_ce_get_product_tags( $args );
45
 
46
- ob_start(); ?>
47
  <p><label><input type="checkbox" id="products-filters-tags" /> <?php _e( 'Filter Products by Product Tag', 'woocommerce-exporter' ); ?></label></p>
48
  <div id="export-products-filters-tags" class="separator">
49
  <ul>
@@ -63,27 +59,27 @@ if( is_admin() ) {
63
  </div>
64
  <!-- #export-products-filters-tags -->
65
  <?php
66
- ob_end_flush();
67
 
68
- }
69
 
70
- // HTML template for Filter Products by Product Brand widget on Store Exporter screen
71
- function woo_ce_products_filter_by_product_brand() {
72
 
73
- // Check if Brands is available
74
- if( woo_ce_detect_product_brands() == false )
75
- return;
76
 
77
- $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
78
- $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
79
 
80
- $args = array(
81
- 'hide_empty' => 1,
82
- 'orderby' => 'term_group'
83
- );
84
- $product_brands = woo_ce_get_product_brands( $args );
85
 
86
- ob_start(); ?>
87
  <p><label><input type="checkbox" id="products-filters-brands" /> <?php _e( 'Filter Products by Product Brands', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
88
  <div id="export-products-filters-brands" class="separator">
89
  <ul>
@@ -103,25 +99,25 @@ if( is_admin() ) {
103
  </div>
104
  <!-- #export-products-filters-brands -->
105
  <?php
106
- ob_end_flush();
107
 
108
- }
109
 
110
- // HTML template for Filter Products by Product Vendor widget on Store Exporter screen
111
- function woo_ce_products_filter_by_product_vendor() {
112
 
113
- if( class_exists( 'WooCommerce_Product_Vendors' ) == false )
114
- return;
115
 
116
- $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
117
- $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
118
 
119
- $args = array(
120
- 'hide_empty' => 1
121
- );
122
- $product_vendors = woo_ce_get_product_vendors( $args, 'full' );
123
 
124
- ob_start(); ?>
125
  <p><label><input type="checkbox" id="products-filters-vendors" /> <?php _e( 'Filter Products by Product Vendors', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
126
  <div id="export-products-filters-vendors" class="separator">
127
  <?php if( $product_vendors ) { ?>
@@ -140,18 +136,18 @@ if( is_admin() ) {
140
  </div>
141
  <!-- #export-products-filters-vendors -->
142
  <?php
143
- ob_end_flush();
144
 
145
- }
146
 
147
- // HTML template for Filter Products by Product Status widget on Store Exporter screen
148
- function woo_ce_products_filter_by_product_status() {
149
 
150
- $product_statuses = get_post_statuses();
151
- if( !isset( $product_statuses['trash'] ) )
152
- $product_statuses['trash'] = __( 'Trash', 'woocommerce-exporter' );
153
 
154
- ob_start(); ?>
155
  <p><label><input type="checkbox" id="products-filters-status" /> <?php _e( 'Filter Products by Product Status', 'woocommerce-exporter' ); ?></label></p>
156
  <div id="export-products-filters-status" class="separator">
157
  <ul>
@@ -171,16 +167,16 @@ if( is_admin() ) {
171
  </div>
172
  <!-- #export-products-filters-status -->
173
  <?php
174
- ob_end_flush();
175
 
176
- }
177
 
178
- // HTML template for Filter Products by Product Type widget on Store Exporter screen
179
- function woo_ce_products_filter_by_product_type() {
180
 
181
- $product_types = woo_ce_get_product_types();
182
 
183
- ob_start(); ?>
184
  <p><label><input type="checkbox" id="products-filters-type" /> <?php _e( 'Filter Products by Product Type', 'woocommerce-exporter' ); ?></label></p>
185
  <div id="export-products-filters-type" class="separator">
186
  <ul>
@@ -200,18 +196,18 @@ if( is_admin() ) {
200
  </div>
201
  <!-- #export-products-filters-type -->
202
  <?php
203
- ob_end_flush();
204
 
205
- }
206
 
207
- // HTML template for Filter Products by Product Type widget on Store Exporter screen
208
- function woo_ce_products_filter_by_stock_status() {
209
 
210
- // Store Exporter Deluxe
211
- $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
212
- $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
213
 
214
- ob_start(); ?>
215
  <p><label><input type="checkbox" id="products-filters-stock" /> <?php _e( 'Filter Products by Stock Status', 'woocommerce-exporter' ); ?></label></p>
216
  <div id="export-products-filters-stock" class="separator">
217
  <ul>
@@ -223,17 +219,17 @@ if( is_admin() ) {
223
  </div>
224
  <!-- #export-products-filters-stock -->
225
  <?php
226
- ob_end_flush();
227
 
228
- }
229
 
230
- // HTML template for Product Sorting widget on Store Exporter screen
231
- function woo_ce_product_sorting() {
232
 
233
- $product_orderby = woo_ce_get_option( 'product_orderby', 'ID' );
234
- $product_order = woo_ce_get_option( 'product_order', 'DESC' );
235
 
236
- ob_start(); ?>
237
  <p><label><?php _e( 'Product Sorting', 'woocommerce-exporter' ); ?></label></p>
238
  <div>
239
  <select name="product_orderby">
@@ -252,16 +248,16 @@ if( is_admin() ) {
252
  <p class="description"><?php _e( 'Select the sorting of Products within the exported file. By default this is set to export Products by Product ID in Desending order.', 'woocommerce-exporter' ); ?></p>
253
  </div>
254
  <?php
255
- ob_end_flush();
256
 
257
- }
258
 
259
- // HTML template for Up-sells formatting on Store Exporter screen
260
- function woo_ce_products_upsells_formatting() {
261
 
262
- $upsell_formatting = woo_ce_get_option( 'upsell_formatting', 1 );
263
 
264
- ob_start(); ?>
265
  <tr class="export-options product-options">
266
  <th><label for=""><?php _e( 'Up-sells formatting', 'woocommerce-exporter' ); ?></label></th>
267
  <td>
@@ -272,16 +268,16 @@ if( is_admin() ) {
272
  </tr>
273
 
274
  <?php
275
- ob_end_flush();
276
 
277
- }
278
 
279
- // HTML template for Cross-sells formatting on Store Exporter screen
280
- function woo_ce_products_crosssells_formatting() {
281
 
282
- $crosssell_formatting = woo_ce_get_option( 'crosssell_formatting', 1 );
283
 
284
- ob_start(); ?>
285
  <tr class="export-options product-options">
286
  <th><label for=""><?php _e( 'Cross-sells formatting', 'woocommerce-exporter' ); ?></label></th>
287
  <td>
@@ -292,24 +288,24 @@ if( is_admin() ) {
292
  </tr>
293
 
294
  <?php
295
- ob_end_flush();
296
 
297
- }
298
 
299
- // HTML template for Custom Products widget on Store Exporter screen
300
- function woo_ce_products_custom_fields() {
301
 
302
- // Store Exporter Deluxe
303
- $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
304
- $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
305
 
306
- if( $custom_products = woo_ce_get_option( 'custom_products', '' ) )
307
- $custom_products = implode( "\n", $custom_products );
308
- $custom_attributes = '';
309
 
310
- $troubleshooting_url = 'http://www.visser.com.au/documentation/store-exporter-deluxe/usage/';
311
 
312
- ob_start(); ?>
313
  <form method="post" id="export-products-custom-fields" class="export-options product-options">
314
  <div id="poststuff">
315
 
@@ -357,16 +353,16 @@ if( is_admin() ) {
357
  </form>
358
  <!-- #export-products-custom-fields -->
359
  <?php
360
- ob_end_flush();
361
 
362
- }
363
 
364
- function woo_ce_export_options_gallery_format() {
365
 
366
- $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
367
- $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
368
 
369
- ob_start(); ?>
370
  <tr class="export-options product-options">
371
  <th><label for=""><?php _e( 'Product gallery formatting', 'woocommerce-exporter' ); ?></label></th>
372
  <td>
@@ -380,11 +376,7 @@ if( is_admin() ) {
380
  </td>
381
  </tr>
382
  <?php
383
- ob_end_flush();
384
-
385
- }
386
-
387
- /* End of: WordPress Administration */
388
 
389
  }
390
  ?>
1
  <?php
2
+ // HTML template for Filter Products by Product Category widget on Store Exporter screen
3
+ function woo_ce_products_filter_by_product_category() {
4
 
5
+ $args = array(
6
+ 'hide_empty' => 1
7
+ );
8
+ $product_categories = woo_ce_get_product_categories( $args );
9
 
10
+ ob_start(); ?>
 
 
 
 
 
 
 
 
11
  <p><label><input type="checkbox" id="products-filters-categories" /> <?php _e( 'Filter Products by Product Category', 'woocommerce-exporter' ); ?></label></p>
12
  <div id="export-products-filters-categories" class="separator">
13
  <ul>
27
  </div>
28
  <!-- #export-products-filters-categories -->
29
  <?php
30
+ ob_end_flush();
31
 
32
+ }
33
 
34
+ // HTML template for Filter Products by Product Tag widget on Store Exporter screen
35
+ function woo_ce_products_filter_by_product_tag() {
36
 
37
+ $args = array(
38
+ 'hide_empty' => 1
39
+ );
40
+ $product_tags = woo_ce_get_product_tags( $args );
41
 
42
+ ob_start(); ?>
43
  <p><label><input type="checkbox" id="products-filters-tags" /> <?php _e( 'Filter Products by Product Tag', 'woocommerce-exporter' ); ?></label></p>
44
  <div id="export-products-filters-tags" class="separator">
45
  <ul>
59
  </div>
60
  <!-- #export-products-filters-tags -->
61
  <?php
62
+ ob_end_flush();
63
 
64
+ }
65
 
66
+ // HTML template for Filter Products by Product Brand widget on Store Exporter screen
67
+ function woo_ce_products_filter_by_product_brand() {
68
 
69
+ // Check if Brands is available
70
+ if( woo_ce_detect_product_brands() == false )
71
+ return;
72
 
73
+ $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
74
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
75
 
76
+ $args = array(
77
+ 'hide_empty' => 1,
78
+ 'orderby' => 'term_group'
79
+ );
80
+ $product_brands = woo_ce_get_product_brands( $args );
81
 
82
+ ob_start(); ?>
83
  <p><label><input type="checkbox" id="products-filters-brands" /> <?php _e( 'Filter Products by Product Brands', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
84
  <div id="export-products-filters-brands" class="separator">
85
  <ul>
99
  </div>
100
  <!-- #export-products-filters-brands -->
101
  <?php
102
+ ob_end_flush();
103
 
104
+ }
105
 
106
+ // HTML template for Filter Products by Product Vendor widget on Store Exporter screen
107
+ function woo_ce_products_filter_by_product_vendor() {
108
 
109
+ if( class_exists( 'WooCommerce_Product_Vendors' ) == false )
110
+ return;
111
 
112
+ $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
113
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
114
 
115
+ $args = array(
116
+ 'hide_empty' => 1
117
+ );
118
+ $product_vendors = woo_ce_get_product_vendors( $args, 'full' );
119
 
120
+ ob_start(); ?>
121
  <p><label><input type="checkbox" id="products-filters-vendors" /> <?php _e( 'Filter Products by Product Vendors', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
122
  <div id="export-products-filters-vendors" class="separator">
123
  <?php if( $product_vendors ) { ?>
136
  </div>
137
  <!-- #export-products-filters-vendors -->
138
  <?php
139
+ ob_end_flush();
140
 
141
+ }
142
 
143
+ // HTML template for Filter Products by Product Status widget on Store Exporter screen
144
+ function woo_ce_products_filter_by_product_status() {
145
 
146
+ $product_statuses = get_post_statuses();
147
+ if( !isset( $product_statuses['trash'] ) )
148
+ $product_statuses['trash'] = __( 'Trash', 'woocommerce-exporter' );
149
 
150
+ ob_start(); ?>
151
  <p><label><input type="checkbox" id="products-filters-status" /> <?php _e( 'Filter Products by Product Status', 'woocommerce-exporter' ); ?></label></p>
152
  <div id="export-products-filters-status" class="separator">
153
  <ul>
167
  </div>
168
  <!-- #export-products-filters-status -->
169
  <?php
170
+ ob_end_flush();
171
 
172
+ }
173
 
174
+ // HTML template for Filter Products by Product Type widget on Store Exporter screen
175
+ function woo_ce_products_filter_by_product_type() {
176
 
177
+ $product_types = woo_ce_get_product_types();
178
 
179
+ ob_start(); ?>
180
  <p><label><input type="checkbox" id="products-filters-type" /> <?php _e( 'Filter Products by Product Type', 'woocommerce-exporter' ); ?></label></p>
181
  <div id="export-products-filters-type" class="separator">
182
  <ul>
196
  </div>
197
  <!-- #export-products-filters-type -->
198
  <?php
199
+ ob_end_flush();
200
 
201
+ }
202
 
203
+ // HTML template for Filter Products by Product Type widget on Store Exporter screen
204
+ function woo_ce_products_filter_by_stock_status() {
205
 
206
+ // Store Exporter Deluxe
207
+ $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
208
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
209
 
210
+ ob_start(); ?>
211
  <p><label><input type="checkbox" id="products-filters-stock" /> <?php _e( 'Filter Products by Stock Status', 'woocommerce-exporter' ); ?></label></p>
212
  <div id="export-products-filters-stock" class="separator">
213
  <ul>
219
  </div>
220
  <!-- #export-products-filters-stock -->
221
  <?php
222
+ ob_end_flush();
223
 
224
+ }
225
 
226
+ // HTML template for Product Sorting widget on Store Exporter screen
227
+ function woo_ce_product_sorting() {
228
 
229
+ $product_orderby = woo_ce_get_option( 'product_orderby', 'ID' );
230
+ $product_order = woo_ce_get_option( 'product_order', 'DESC' );
231
 
232
+ ob_start(); ?>
233
  <p><label><?php _e( 'Product Sorting', 'woocommerce-exporter' ); ?></label></p>
234
  <div>
235
  <select name="product_orderby">
248
  <p class="description"><?php _e( 'Select the sorting of Products within the exported file. By default this is set to export Products by Product ID in Desending order.', 'woocommerce-exporter' ); ?></p>
249
  </div>
250
  <?php
251
+ ob_end_flush();
252
 
253
+ }
254
 
255
+ // HTML template for Up-sells formatting on Store Exporter screen
256
+ function woo_ce_products_upsell_formatting() {
257
 
258
+ $upsell_formatting = woo_ce_get_option( 'upsell_formatting', 1 );
259
 
260
+ ob_start(); ?>
261
  <tr class="export-options product-options">
262
  <th><label for=""><?php _e( 'Up-sells formatting', 'woocommerce-exporter' ); ?></label></th>
263
  <td>
268
  </tr>
269
 
270
  <?php
271
+ ob_end_flush();
272
 
273
+ }
274
 
275
+ // HTML template for Cross-sells formatting on Store Exporter screen
276
+ function woo_ce_products_crosssell_formatting() {
277
 
278
+ $crosssell_formatting = woo_ce_get_option( 'crosssell_formatting', 1 );
279
 
280
+ ob_start(); ?>
281
  <tr class="export-options product-options">
282
  <th><label for=""><?php _e( 'Cross-sells formatting', 'woocommerce-exporter' ); ?></label></th>
283
  <td>
288
  </tr>
289
 
290
  <?php
291
+ ob_end_flush();
292
 
293
+ }
294
 
295
+ // HTML template for Custom Products widget on Store Exporter screen
296
+ function woo_ce_products_custom_fields() {
297
 
298
+ // Store Exporter Deluxe
299
+ $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
300
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
301
 
302
+ if( $custom_products = woo_ce_get_option( 'custom_products', '' ) )
303
+ $custom_products = implode( "\n", $custom_products );
304
+ $custom_attributes = '';
305
 
306
+ $troubleshooting_url = 'http://www.visser.com.au/documentation/store-exporter-deluxe/usage/';
307
 
308
+ ob_start(); ?>
309
  <form method="post" id="export-products-custom-fields" class="export-options product-options">
310
  <div id="poststuff">
311
 
353
  </form>
354
  <!-- #export-products-custom-fields -->
355
  <?php
356
+ ob_end_flush();
357
 
358
+ }
359
 
360
+ function woo_ce_export_options_product_gallery_formatting() {
361
 
362
+ $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
363
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
364
 
365
+ ob_start(); ?>
366
  <tr class="export-options product-options">
367
  <th><label for=""><?php _e( 'Product gallery formatting', 'woocommerce-exporter' ); ?></label></th>
368
  <td>
376
  </td>
377
  </tr>
378
  <?php
379
+ ob_end_flush();
 
 
 
 
380
 
381
  }
382
  ?>
includes/admin/shipping_class.php CHANGED
@@ -1,15 +1,11 @@
1
  <?php
2
- if( is_admin() ) {
 
3
 
4
- /* Start of: WordPress Administration */
 
5
 
6
- // HTML template for disabled Shipping Class Sorting widget on Store Exporter screen
7
- function woo_ce_shipping_class_sorting() {
8
-
9
- $shipping_class_orderby = 'ID';
10
- $shipping_class_order = 'DESC';
11
-
12
- ob_start(); ?>
13
  <p><label><?php _e( 'Shipping Class Sorting', 'woo_ce' ); ?></label></p>
14
  <div>
15
  <select name="shipping_class_orderby" disabled="disabled">
@@ -23,11 +19,7 @@ if( is_admin() ) {
23
  <p class="description"><?php _e( 'Select the sorting of Shipping Classes within the exported file. By default this is set to export Shipping Classes by Term ID in Desending order.', 'woo_ce' ); ?></p>
24
  </div>
25
  <?php
26
- ob_end_flush();
27
-
28
- }
29
-
30
- /* End of: WordPress Administration */
31
 
32
  }
33
  ?>
1
  <?php
2
+ // HTML template for disabled Shipping Class Sorting widget on Store Exporter screen
3
+ function woo_ce_shipping_class_sorting() {
4
 
5
+ $shipping_class_orderby = 'ID';
6
+ $shipping_class_order = 'DESC';
7
 
8
+ ob_start(); ?>
 
 
 
 
 
 
9
  <p><label><?php _e( 'Shipping Class Sorting', 'woo_ce' ); ?></label></p>
10
  <div>
11
  <select name="shipping_class_orderby" disabled="disabled">
19
  <p class="description"><?php _e( 'Select the sorting of Shipping Classes within the exported file. By default this is set to export Shipping Classes by Term ID in Desending order.', 'woo_ce' ); ?></p>
20
  </div>
21
  <?php
22
+ ob_end_flush();
 
 
 
 
23
 
24
  }
25
  ?>
includes/admin/subscription.php CHANGED
@@ -1,17 +1,13 @@
1
  <?php
2
- if( is_admin() ) {
 
3
 
4
- /* Start of: WordPress Administration */
 
5
 
6
- // HTML template for Filter Subscriptions by Subscription Status widget on Store Exporter screen
7
- function woo_ce_subscriptions_filter_by_subscription_status() {
8
 
9
- $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
10
- $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
11
-
12
- $subscription_statuses = woo_ce_get_subscription_statuses();
13
-
14
- ob_start(); ?>
15
  <p><label><input type="checkbox" id="subscriptions-filters-status" /> <?php _e( 'Filter Subscriptions by Subscription Status', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
16
  <div id="export-subscriptions-filters-status" class="separator">
17
  <ul>
@@ -31,19 +27,19 @@ if( is_admin() ) {
31
  </div>
32
  <!-- #export-subscriptions-filters-status -->
33
  <?php
34
- ob_end_flush();
35
 
36
- }
37
 
38
- // HTML template for Filter Subscriptions by Subscription Product widget on Store Exporter screen
39
- function woo_ce_subscriptions_filter_by_subscription_product() {
40
 
41
- $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
42
- $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
43
 
44
- $products = woo_ce_get_subscription_products();
45
 
46
- ob_start(); ?>
47
  <p><label><input type="checkbox" id="subscriptions-filters-product" /> <?php _e( 'Filter Subscriptions by Subscription Product', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
48
  <div id="export-subscriptions-filters-product" class="separator">
49
  <ul>
@@ -63,11 +59,7 @@ if( is_admin() ) {
63
  </div>
64
  <!-- #export-subscriptions-filters-status -->
65
  <?php
66
- ob_end_flush();
67
-
68
- }
69
-
70
- /* End of: WordPress Administration */
71
 
72
  }
73
  ?>
1
  <?php
2
+ // HTML template for Filter Subscriptions by Subscription Status widget on Store Exporter screen
3
+ function woo_ce_subscriptions_filter_by_subscription_status() {
4
 
5
+ $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
6
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
7
 
8
+ $subscription_statuses = woo_ce_get_subscription_statuses();
 
9
 
10
+ ob_start(); ?>
 
 
 
 
 
11
  <p><label><input type="checkbox" id="subscriptions-filters-status" /> <?php _e( 'Filter Subscriptions by Subscription Status', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
12
  <div id="export-subscriptions-filters-status" class="separator">
13
  <ul>
27
  </div>
28
  <!-- #export-subscriptions-filters-status -->
29
  <?php
30
+ ob_end_flush();
31
 
32
+ }
33
 
34
+ // HTML template for Filter Subscriptions by Subscription Product widget on Store Exporter screen
35
+ function woo_ce_subscriptions_filter_by_subscription_product() {
36
 
37
+ $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
38
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
39
 
40
+ $products = woo_ce_get_subscription_products();
41
 
42
+ ob_start(); ?>
43
  <p><label><input type="checkbox" id="subscriptions-filters-product" /> <?php _e( 'Filter Subscriptions by Subscription Product', 'woocommerce-exporter' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span></label></p>
44
  <div id="export-subscriptions-filters-product" class="separator">
45
  <ul>
59
  </div>
60
  <!-- #export-subscriptions-filters-status -->
61
  <?php
62
+ ob_end_flush();
 
 
 
 
63
 
64
  }
65
  ?>
includes/admin/tag.php CHANGED
@@ -1,15 +1,11 @@
1
  <?php
2
- if( is_admin() ) {
 
3
 
4
- /* Start of: WordPress Administration */
 
5
 
6
- // HTML template for Tag Sorting widget on Store Exporter screen
7
- function woo_ce_tag_sorting() {
8
-
9
- $tag_orderby = woo_ce_get_option( 'tag_orderby', 'ID' );
10
- $tag_order = woo_ce_get_option( 'tag_order', 'DESC' );
11
-
12
- ob_start(); ?>
13
  <p><label><?php _e( 'Product Tag Sorting', 'woocommerce-exporter' ); ?></label></p>
14
  <div>
15
  <select name="tag_orderby">
@@ -23,11 +19,7 @@ if( is_admin() ) {
23
  <p class="description"><?php _e( 'Select the sorting of Product Tags within the exported file. By default this is set to export Product Tags by Term ID in Desending order.', 'woocommerce-exporter' ); ?></p>
24
  </div>
25
  <?php
26
- ob_end_flush();
27
-
28
- }
29
-
30
- /* End of: WordPress Administration */
31
 
32
  }
33
  ?>
1
  <?php
2
+ // HTML template for Tag Sorting widget on Store Exporter screen
3
+ function woo_ce_tag_sorting() {
4
 
5
+ $tag_orderby = woo_ce_get_option( 'tag_orderby', 'ID' );
6
+ $tag_order = woo_ce_get_option( 'tag_order', 'DESC' );
7
 
8
+ ob_start(); ?>
 
 
 
 
 
 
9
  <p><label><?php _e( 'Product Tag Sorting', 'woocommerce-exporter' ); ?></label></p>
10
  <div>
11
  <select name="tag_orderby">
19
  <p class="description"><?php _e( 'Select the sorting of Product Tags within the exported file. By default this is set to export Product Tags by Term ID in Desending order.', 'woocommerce-exporter' ); ?></p>
20
  </div>
21
  <?php
22
+ ob_end_flush();
 
 
 
 
23
 
24
  }
25
  ?>
includes/admin/user.php CHANGED
@@ -1,15 +1,11 @@
1
  <?php
2
- if( is_admin() ) {
 
3
 
4
- /* Start of: WordPress Administration */
 
5
 
6
- // HTML template for User Sorting widget on Store Exporter screen
7
- function woo_ce_user_sorting() {
8
-
9
- $orderby = woo_ce_get_option( 'user_orderby', 'ID' );
10
- $order = woo_ce_get_option( 'user_order', 'ASC' );
11
-
12
- ob_start(); ?>
13
  <p><label><?php _e( 'User Sorting', 'woocommerce-exporter' ); ?></label></p>
14
  <div>
15
  <select name="user_orderby">
@@ -30,21 +26,21 @@ if( is_admin() ) {
30
  <p class="description"><?php _e( 'Select the sorting of Users within the exported file. By default this is set to export User by User ID in Desending order.', 'woocommerce-exporter' ); ?></p>
31
  </div>
32
  <?php
33
- ob_end_flush();
34
 
35
- }
36
 
37
- // HTML template for disabled Custom Users widget on Store Exporter screen
38
- function woo_ce_users_custom_fields() {
39
 
40
- $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
41
- $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
42
 
43
- $custom_users = ' - ';
44
 
45
- $troubleshooting_url = 'http://www.visser.com.au/documentation/store-exporter-deluxe/usage/';
46
 
47
- ob_start(); ?>
48
  <form method="post" id="export-users-custom-fields" class="export-options user-options">
49
  <div id="poststuff">
50
 
@@ -81,11 +77,7 @@ if( is_admin() ) {
81
  </form>
82
  <!-- #export-users-custom-fields -->
83
  <?php
84
- ob_end_flush();
85
-
86
- }
87
-
88
- /* End of: WordPress Administration */
89
 
90
  }
91
  ?>
1
  <?php
2
+ // HTML template for User Sorting widget on Store Exporter screen
3
+ function woo_ce_user_sorting() {
4
 
5
+ $orderby = woo_ce_get_option( 'user_orderby', 'ID' );
6
+ $order = woo_ce_get_option( 'user_order', 'ASC' );
7
 
8
+ ob_start(); ?>
 
 
 
 
 
 
9
  <p><label><?php _e( 'User Sorting', 'woocommerce-exporter' ); ?></label></p>
10
  <div>
11
  <select name="user_orderby">
26
  <p class="description"><?php _e( 'Select the sorting of Users within the exported file. By default this is set to export User by User ID in Desending order.', 'woocommerce-exporter' ); ?></p>
27
  </div>
28
  <?php
29
+ ob_end_flush();
30
 
31
+ }
32
 
33
+ // HTML template for disabled Custom Users widget on Store Exporter screen
34
+ function woo_ce_users_custom_fields() {
35
 
36
+ $woo_cd_url = 'https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc';
37
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woocommerce-exporter' ) . '</a>', $woo_cd_url );
38
 
39
+ $custom_users = ' - ';
40
 
41
+ $troubleshooting_url = 'http://www.visser.com.au/documentation/store-exporter-deluxe/usage/';
42
 
43
+ ob_start(); ?>
44
  <form method="post" id="export-users-custom-fields" class="export-options user-options">
45
  <div id="poststuff">
46
 
77
  </form>
78
  <!-- #export-users-custom-fields -->
79
  <?php
80
+ ob_end_flush();
 
 
 
 
81
 
82
  }
83
  ?>
includes/category.php CHANGED
@@ -167,6 +167,7 @@ function woo_ce_get_category_fields( $format = 'full' ) {
167
 
168
  }
169
 
 
170
  function woo_ce_override_category_field_labels( $fields = array() ) {
171
 
172
  $labels = woo_ce_get_option( 'category_labels', array() );
@@ -245,9 +246,51 @@ function woo_ce_get_product_categories( $args = array() ) {
245
 
246
  }
247
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
248
  function woo_ce_get_category_thumbnail_url( $category_id = 0, $size = 'full' ) {
249
 
250
- if ( $thumbnail_id = get_woocommerce_term_meta( $category_id, 'thumbnail_id', true ) ) {
251
  $image_attributes = wp_get_attachment_image_src( $thumbnail_id, $size );
252
  if( is_array( $image_attributes ) )
253
  return current( $image_attributes );
167
 
168
  }
169
 
170
+ // Check if we should override field labels from the Field Editor
171
  function woo_ce_override_category_field_labels( $fields = array() ) {
172
 
173
  $labels = woo_ce_get_option( 'category_labels', array() );
246
 
247
  }
248
 
249
+ function woo_ce_export_dataset_override_category( $output = null, $export_type = null ) {
250
+
251
+ global $export;
252
+
253
+ $args = array(
254
+ 'orderby' => ( isset( $export->args['category_orderby'] ) ? $export->args['category_orderby'] : 'ID' ),
255
+ 'order' => ( isset( $export->args['category_order'] ) ? $export->args['category_order'] : 'ASC' ),
256
+ );
257
+ if( $categories = woo_ce_get_product_categories( $args ) ) {
258
+ $separator = $export->delimiter;
259
+ $size = $export->total_columns;
260
+ $export->total_rows = count( $categories );
261
+ // Generate the export headers
262
+ if( in_array( $export->export_format, array( 'csv' ) ) ) {
263
+ for( $i = 0; $i < $size; $i++ ) {
264
+ if( $i == ( $size - 1 ) )
265
+ $output .= woo_ce_escape_csv_value( $export->columns[$i], $export->delimiter, $export->escape_formatting ) . "\n";
266
+ else
267
+ $output .= woo_ce_escape_csv_value( $export->columns[$i], $export->delimiter, $export->escape_formatting ) . $separator;
268
+ }
269
+ }
270
+ if( !empty( $export->fields ) ) {
271
+ foreach( $categories as $category ) {
272
+
273
+ foreach( $export->fields as $key => $field ) {
274
+ if( isset( $category->$key ) ) {
275
+ if( in_array( $export->export_format, array( 'csv' ) ) )
276
+ $output .= woo_ce_escape_csv_value( $category->$key, $export->delimiter, $export->escape_formatting );
277
+ }
278
+ if( in_array( $export->export_format, array( 'csv' ) ) )
279
+ $output .= $separator;
280
+ }
281
+ if( in_array( $export->export_format, array( 'csv' ) ) )
282
+ $output = substr( $output, 0, -1 ) . "\n";
283
+ }
284
+ }
285
+ unset( $categories, $category );
286
+ }
287
+ return $output;
288
+
289
+ }
290
+
291
  function woo_ce_get_category_thumbnail_url( $category_id = 0, $size = 'full' ) {
292
 
293
+ if( $thumbnail_id = get_woocommerce_term_meta( $category_id, 'thumbnail_id', true ) ) {
294
  $image_attributes = wp_get_attachment_image_src( $thumbnail_id, $size );
295
  if( is_array( $image_attributes ) )
296
  return current( $image_attributes );
includes/coupon.php CHANGED
@@ -170,7 +170,14 @@ function woo_ce_get_coupon_fields( $format = 'full' ) {
170
  // Check if we should override field labels from the Field Editor
171
  function woo_ce_override_coupon_field_labels( $fields = array() ) {
172
 
173
- $labels = woo_ce_get_option( 'coupon_labels', array() );
 
 
 
 
 
 
 
174
  if( !empty( $labels ) ) {
175
  foreach( $fields as $key => $field ) {
176
  if( isset( $labels[$field['name']] ) )
170
  // Check if we should override field labels from the Field Editor
171
  function woo_ce_override_coupon_field_labels( $fields = array() ) {
172
 
173
+ $export_type = 'coupon';
174
+
175
+ $labels = false;
176
+
177
+ // Default to Quick Export labels
178
+ if( empty( $labels ) )
179
+ $labels = woo_ce_get_option( sprintf( '%s_labels', $export_type ), array() );
180
+
181
  if( !empty( $labels ) ) {
182
  foreach( $fields as $key => $field ) {
183
  if( isset( $labels[$field['name']] ) )
includes/formatting.php CHANGED
@@ -71,7 +71,7 @@ function woo_ce_escape_csv_value( $string = '', $delimiter = ',', $format = 'all
71
 
72
  }
73
 
74
- function woo_ce_attribute_escape( $safe_text = '', $text = '' ) {
75
 
76
  if( substr( $safe_text, 0, 1 ) == '=' ) {
77
  $safe_text = ltrim( $safe_text, '=' );
71
 
72
  }
73
 
74
+ function woo_ce_filter_attribute_escape( $safe_text = '', $text = '' ) {
75
 
76
  if( substr( $safe_text, 0, 1 ) == '=' ) {
77
  $safe_text = ltrim( $safe_text, '=' );
includes/functions.php CHANGED
@@ -1,6 +1,16 @@
1
  <?php
2
- // Only load these resources if we are running an export
3
- function woo_ce_load_export_types() {
 
 
 
 
 
 
 
 
 
 
4
 
5
  include_once( WOO_CE_PATH . 'includes/product.php' );
6
  include_once( WOO_CE_PATH . 'includes/product-extend.php' );
@@ -22,17 +32,19 @@ function woo_ce_load_export_types() {
22
  include_once( WOO_CE_PATH . 'includes/booking.php' );
23
 
24
  // Load the export type resources first
25
- include_once( WOO_CE_PATH . 'includes/admin/product.php' );
26
- include_once( WOO_CE_PATH . 'includes/admin/category.php' );
27
- include_once( WOO_CE_PATH . 'includes/admin/tag.php' );
28
- include_once( WOO_CE_PATH . 'includes/admin/brand.php' );
29
- include_once( WOO_CE_PATH . 'includes/admin/order.php' );
30
- include_once( WOO_CE_PATH . 'includes/admin/customer.php' );
31
- include_once( WOO_CE_PATH . 'includes/admin/user.php' );
32
- include_once( WOO_CE_PATH . 'includes/admin/coupon.php' );
33
- include_once( WOO_CE_PATH . 'includes/admin/subscription.php' );
34
- include_once( WOO_CE_PATH . 'includes/admin/commission.php' );
35
- include_once( WOO_CE_PATH . 'includes/admin/shipping_class.php' );
 
 
36
 
37
  }
38
 
@@ -49,6 +61,7 @@ if( is_admin() ) {
49
  /* Start of: WordPress Administration */
50
 
51
  include_once( WOO_CE_PATH . 'includes/admin.php' );
 
52
  // WordPress Admin Pointers
53
  include_once( WOO_CE_PATH . 'includes/settings.php' );
54
 
@@ -286,7 +299,7 @@ if( is_admin() ) {
286
  woo_ce_admin_notice_html( $message, 'error' );
287
  }
288
 
289
- // Displays a HTML notice where the maximum execution time cannot be set
290
  if( !woo_ce_get_option( 'dismiss_execution_time_prompt', 0 ) ) {
291
  $max_execution_time = absint( ini_get( 'max_execution_time' ) );
292
  $response = @ini_set( 'max_execution_time', 120 );
@@ -297,7 +310,7 @@ if( is_admin() ) {
297
  }
298
  }
299
 
300
- // Displays a HTML notice where the memory allocated to WordPress falls below 64MB
301
  if( !woo_ce_get_option( 'dismiss_memory_prompt', 0 ) ) {
302
  $memory_limit = absint( ini_get( 'memory_limit' ) );
303
  $minimum_memory_limit = 64;
@@ -308,14 +321,14 @@ if( is_admin() ) {
308
  }
309
  }
310
 
311
- // Displays a HTML notice if PHP 5.2 or lower is installed
312
  if( version_compare( phpversion(), '5.3', '<' ) && !woo_ce_get_option( 'dismiss_php_legacy', 0 ) ) {
313
  $dismiss_url = esc_url( add_query_arg( array( 'action' => 'dismiss_php_legacy', '_wpnonce' => wp_create_nonce( 'woo_ce_dismiss_php_legacy' ) ) ) );
314
  $message = '<span style="float:right;"><a href="' . $dismiss_url . '">' . __( 'Dismiss', 'woocommerce-exporter' ) . '</a></span>' . sprintf( __( 'Your PHP version (%s) is not supported and is very much out of date, since 2010 all users are strongly encouraged to upgrade to PHP 5.3+ and above. Contact your hosting provider to make this happen. See: <a href="%s" target="_blank">Migrating from PHP 5.2 to 5.3</a>', 'woocommerce-exporter' ), phpversion(), $troubleshooting_url );
315
  woo_ce_admin_notice_html( $message, 'error' );
316
  }
317
 
318
- // Displays HTML notice if there are more than 2500 Subscriptions
319
  if( !woo_ce_get_option( 'dismiss_subscription_prompt', 0 ) ) {
320
  if( class_exists( 'WC_Subscriptions' ) ) {
321
  $wcs_version = woo_ce_get_wc_subscriptions_version();
@@ -338,7 +351,7 @@ if( is_admin() ) {
338
  woo_ce_admin_notice_html( $message, 'error' );
339
  delete_transient( WOO_CE_PREFIX . '_running' );
340
  }
341
- // Displays a HTML notice if Archives is disabled and the Archives tab is opened
342
  if(
343
  woo_ce_get_option( 'delete_file', '1' ) == 1
344
  && ( isset( $_GET['tab'] ) ? sanitize_text_field( $_GET['tab'] ) : '' ) == 'archive'
@@ -350,7 +363,7 @@ if( is_admin() ) {
350
  woo_ce_admin_notice_html( $message );
351
  }
352
 
353
- // Displays a HTML notice if Archives are detected without a Post Status of private
354
  if( woo_ce_get_unprotected_archives( array( 'count' => true ) ) && !woo_ce_get_option( 'dismiss_archives_privacy_prompt', 0 ) ) {
355
  $dismiss_url = esc_url( add_query_arg( array( 'action' => 'dismiss_archives_privacy_prompt', '_wpnonce' => wp_create_nonce( 'woo_ce_dismiss_archives_privacy_prompt' ) ) ) );
356
  $override_url = esc_url( add_query_arg( array( 'action' => 'override_archives_privacy', '_wpnonce' => wp_create_nonce( 'woo_ce_override_archives_privacy' ) ) ) );
@@ -725,7 +738,7 @@ function woo_ce_export_dataset( $export_type = null, &$output = null ) {
725
 
726
  // Drop in our content filters here
727
  add_filter( 'sanitize_key', 'woo_ce_filter_sanitize_key' );
728
- add_filter( 'attribute_escape', 'woo_ce_attribute_escape', 10, 2 );
729
 
730
  switch( $export_type ) {
731
 
@@ -736,52 +749,11 @@ function woo_ce_export_dataset( $export_type = null, &$output = null ) {
736
  foreach( $export->fields as $key => $field )
737
  $export->columns[] = woo_ce_get_product_field( $key );
738
  }
739
- $export->total_columns = $size = count( $export->columns );
740
  $export->data_memory_start = woo_ce_current_memory_usage();
741
- if( $products = woo_ce_get_products( $export->args ) ) {
742
- $export->total_rows = count( $products );
743
- // Generate the export headers
744
- if( in_array( $export->export_format, array( 'csv' ) ) ) {
745
- for( $i = 0; $i < $size; $i++ ) {
746
- if( $i == ( $size - 1 ) )
747
- $output .= woo_ce_escape_csv_value( $export->columns[$i], $export->delimiter, $export->escape_formatting ) . "\n";
748
- else
749
- $output .= woo_ce_escape_csv_value( $export->columns[$i], $export->delimiter, $export->escape_formatting ) . $separator;
750
- }
751
- }
752
- $weight_unit = get_option( 'woocommerce_weight_unit' );
753
- $dimension_unit = get_option( 'woocommerce_dimension_unit' );
754
- $height_unit = $dimension_unit;
755
- $width_unit = $dimension_unit;
756
- $length_unit = $dimension_unit;
757
- if( !empty( $export->fields ) ) {
758
- foreach( $products as $product ) {
759
-
760
- $product = woo_ce_get_product_data( $product, $export->args );
761
- foreach( $export->fields as $key => $field ) {
762
- if( isset( $product->$key ) ) {
763
- if( is_array( $field ) ) {
764
- foreach( $field as $array_key => $array_value ) {
765
- if( !is_array( $array_value ) ) {
766
- if( in_array( $export->export_format, array( 'csv' ) ) )
767
- $output .= woo_ce_escape_csv_value( $array_value, $export->delimiter, $export->escape_formatting );
768
- }
769
- }
770
- } else {
771
- if( in_array( $export->export_format, array( 'csv' ) ) )
772
- $output .= woo_ce_escape_csv_value( $product->$key, $export->delimiter, $export->escape_formatting );
773
- }
774
- }
775
- if( in_array( $export->export_format, array( 'csv' ) ) )
776
- $output .= $separator;
777
- }
778
-
779
- if( in_array( $export->export_format, array( 'csv' ) ) )
780
- $output = substr( $output, 0, -1 ) . "\n";
781
- }
782
- }
783
- unset( $products, $product );
784
- }
785
  $export->data_memory_end = woo_ce_current_memory_usage();
786
  break;
787
 
@@ -792,40 +764,11 @@ function woo_ce_export_dataset( $export_type = null, &$output = null ) {
792
  foreach( $export->fields as $key => $field )
793
  $export->columns[] = woo_ce_get_category_field( $key );
794
  }
795
- $export->total_columns = $size = count( $export->columns );
796
  $export->data_memory_start = woo_ce_current_memory_usage();
797
- $category_args = array(
798
- 'orderby' => ( isset( $export->args['category_orderby'] ) ? $export->args['category_orderby'] : 'ID' ),
799
- 'order' => ( isset( $export->args['category_order'] ) ? $export->args['category_order'] : 'ASC' ),
800
- );
801
- if( $categories = woo_ce_get_product_categories( $category_args ) ) {
802
- $export->total_rows = count( $categories );
803
- // Generate the export headers
804
- if( in_array( $export->export_format, array( 'csv' ) ) ) {
805
- for( $i = 0; $i < $size; $i++ ) {
806
- if( $i == ( $size - 1 ) )
807
- $output .= woo_ce_escape_csv_value( $export->columns[$i], $export->delimiter, $export->escape_formatting ) . "\n";
808
- else
809
- $output .= woo_ce_escape_csv_value( $export->columns[$i], $export->delimiter, $export->escape_formatting ) . $separator;
810
- }
811
- }
812
- if( !empty( $export->fields ) ) {
813
- foreach( $categories as $category ) {
814
-
815
- foreach( $export->fields as $key => $field ) {
816
- if( isset( $category->$key ) ) {
817
- if( in_array( $export->export_format, array( 'csv' ) ) )
818
- $output .= woo_ce_escape_csv_value( $category->$key, $export->delimiter, $export->escape_formatting );
819
- }
820
- if( in_array( $export->export_format, array( 'csv' ) ) )
821
- $output .= $separator;
822
- }
823
- if( in_array( $export->export_format, array( 'csv' ) ) )
824
- $output = substr( $output, 0, -1 ) . "\n";
825
- }
826
- }
827
- unset( $categories, $category );
828
- }
829
  $export->data_memory_end = woo_ce_current_memory_usage();
830
  break;
831
 
@@ -836,40 +779,26 @@ function woo_ce_export_dataset( $export_type = null, &$output = null ) {
836
  foreach( $export->fields as $key => $field )
837
  $export->columns[] = woo_ce_get_tag_field( $key );
838
  }
839
- $export->total_columns = $size = count( $export->columns );
840
  $export->data_memory_start = woo_ce_current_memory_usage();
841
- $tag_args = array(
842
- 'orderby' => ( isset( $export->args['tag_orderby'] ) ? $export->args['tag_orderby'] : 'ID' ),
843
- 'order' => ( isset( $export->args['tag_order'] ) ? $export->args['tag_order'] : 'ASC' ),
844
- );
845
- if( $tags = woo_ce_get_product_tags( $tag_args ) ) {
846
- $export->total_rows = count( $tags );
847
- // Generate the export headers
848
- if( in_array( $export->export_format, array( 'csv' ) ) ) {
849
- for( $i = 0; $i < $size; $i++ ) {
850
- if( $i == ( $size - 1 ) )
851
- $output .= woo_ce_escape_csv_value( $export->columns[$i], $export->delimiter, $export->escape_formatting ) . "\n";
852
- else
853
- $output .= woo_ce_escape_csv_value( $export->columns[$i], $export->delimiter, $export->escape_formatting ) . $separator;
854
- }
855
- }
856
- if( !empty( $export->fields ) ) {
857
- foreach( $tags as $tag ) {
858
-
859
- foreach( $export->fields as $key => $field ) {
860
- if( isset( $tag->$key ) ) {
861
- if( in_array( $export->export_format, array( 'csv' ) ) )
862
- $output .= woo_ce_escape_csv_value( $tag->$key, $export->delimiter, $export->escape_formatting );
863
- }
864
- if( in_array( $export->export_format, array( 'csv' ) ) )
865
- $output .= $separator;
866
- }
867
- if( in_array( $export->export_format, array( 'csv' ) ) )
868
- $output = substr( $output, 0, -1 ) . "\n";
869
- }
870
- }
871
- unset( $tags, $tag );
872
  }
 
 
 
 
 
873
  $export->data_memory_end = woo_ce_current_memory_usage();
874
  break;
875
 
@@ -880,40 +809,11 @@ function woo_ce_export_dataset( $export_type = null, &$output = null ) {
880
  foreach( $export->fields as $key => $field )
881
  $export->columns[] = woo_ce_get_user_field( $key );
882
  }
883
- $export->total_columns = $size = count( $export->columns );
884
  $export->data_memory_start = woo_ce_current_memory_usage();
885
- if( $users = woo_ce_get_users( $export->args ) ) {
886
- // Generate the export headers
887
- if( in_array( $export->export_format, array( 'csv' ) ) ) {
888
- $i = 0;
889
- foreach( $export->columns as $column ) {
890
- if( $i == ( $size - 1 ) )
891
- $output .= woo_ce_escape_csv_value( $column, $export->delimiter, $export->escape_formatting ) . "\n";
892
- else
893
- $output .= woo_ce_escape_csv_value( $column, $export->delimiter, $export->escape_formatting ) . $separator;
894
- $i++;
895
- }
896
- }
897
- if( !empty( $export->fields ) ) {
898
- foreach( $users as $user ) {
899
-
900
- $user = woo_ce_get_user_data( $user, $export->args );
901
-
902
- foreach( $export->fields as $key => $field ) {
903
- if( isset( $user->$key ) ) {
904
- if( in_array( $export->export_format, array( 'csv' ) ) )
905
- $output .= woo_ce_escape_csv_value( $user->$key, $export->delimiter, $export->escape_formatting );
906
- }
907
- if( in_array( $export->export_format, array( 'csv' ) ) )
908
- $output .= $separator;
909
- }
910
- if( in_array( $export->export_format, array( 'csv' ) ) )
911
- $output = substr( $output, 0, -1 ) . "\n";
912
-
913
- }
914
- }
915
- unset( $users, $user );
916
- }
917
  $export->data_memory_end = woo_ce_current_memory_usage();
918
  break;
919
 
@@ -921,7 +821,7 @@ function woo_ce_export_dataset( $export_type = null, &$output = null ) {
921
 
922
  // Remove our content filters here to play nice with other Plugins
923
  remove_filter( 'sanitize_key', 'woo_ce_filter_sanitize_key' );
924
- remove_filter( 'attribute_escape', 'woo_ce_attribute_escape' );
925
 
926
  // Remove our fatal error notice so not to conflict with the CRON or scheduled export engine
927
  remove_action( 'shutdown', 'woo_ce_fatal_error' );
@@ -1012,6 +912,7 @@ function woo_ce_get_export_types( $plural = true ) {
1012
  'booking' => ( $plural ? __( 'Bookings', 'woocommerce-exporter' ) : __( 'Booking', 'woocommerce-exporter' ) ),
1013
  'attribute' => ( $plural ? __( 'Attributes', 'woocommerce-exporter' ) : __( 'Attribute', 'woocommerce-exporter' ) )
1014
  );
 
1015
  return $export_types;
1016
 
1017
  }
@@ -1111,7 +1012,7 @@ function woo_ce_post_statuses( $extra_status = array(), $override = false ) {
1111
  'private',
1112
  'trash'
1113
  );
1114
- if( $override ) {
1115
  $output = $extra_status;
1116
  } else {
1117
  if( $extra_status )
@@ -1131,6 +1032,10 @@ function woo_ce_get_mime_types() {
1131
  'xml' => 'application/xml',
1132
  'rss' => 'application/rss+xml'
1133
  );
 
 
 
 
1134
  return $mime_types;
1135
 
1136
  }
@@ -1168,6 +1073,10 @@ function woo_ce_add_missing_mime_type( $mime_types = array() ) {
1168
  // Add RSS mime type if it has been removed
1169
  if( !isset( $mime_types['rss'] ) )
1170
  $mime_types['rss'] = 'application/rss+xml';
 
 
 
 
1171
  return $mime_types;
1172
 
1173
  }
@@ -1260,9 +1169,9 @@ function woo_ce_modules_list( $module_status = false ) {
1260
  );
1261
  $modules[] = array(
1262
  'name' => 'gpf',
1263
- 'title' => __( 'Advanced Google Product Feed', 'woocommerce-exporter' ),
1264
  'description' => __( 'Easily configure data to be added to your Google Merchant Centre feed.', 'woocommerce-exporter' ),
1265
- 'url' => 'http://www.leewillis.co.uk/wordpress-plugins/',
1266
  'function' => 'woocommerce_gpf_install'
1267
  );
1268
  $modules[] = array(
@@ -1711,7 +1620,6 @@ function woo_ce_modules_list( $module_status = false ) {
1711
  'url' => 'http://yithemes.com/themes/plugins/yith-woocommerce-product-vendors/',
1712
  'function' => 'YITH_Vendors'
1713
  );
1714
-
1715
  $modules[] = array(
1716
  'name' => 'wc_memberships',
1717
  'title' => __( 'WooCommerce Memberships', 'woocommerce-exporter' ),
@@ -1719,7 +1627,6 @@ function woo_ce_modules_list( $module_status = false ) {
1719
  'url' => 'http://www.woothemes.com/products/woocommerce-memberships/',
1720
  'function' => 'init_woocommerce_memberships'
1721
  );
1722
-
1723
  $modules[] = array(
1724
  'name' => 'wc_product_bundles',
1725
  'title' => __( 'WooCommerce Product Bundles', 'woocommerce-exporter' ),
@@ -2004,6 +1911,13 @@ function woo_ce_modules_list( $module_status = false ) {
2004
  'slug' => 'yith-woocommerce-pdf-invoice',
2005
  'function' => 'yith_ywpi_init'
2006
  );
 
 
 
 
 
 
 
2007
  $modules[] = array(
2008
  'name' => 'alg_con',
2009
  'title' => __( 'Custom Order Numbers for WooCommerce', 'woocommerce-exporter' ),
@@ -2042,6 +1956,27 @@ function woo_ce_modules_list( $module_status = false ) {
2042
  'slug' => 'ecr-google-customer-reviews',
2043
  'function' => 'ecr_gcr_missing_wc_notice'
2044
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2045
 
2046
  // Ship to Multiple Addresses - WC_Ship_Multiple
2047
 
1
  <?php
2
+ // Only load these resources if we are running an export, can be limited to a single export type
3
+ function woo_ce_load_export_types( $export_type = false ) {
4
+
5
+ if( !empty( $export_type ) ) {
6
+ if( file_exists( WOO_CE_PATH . 'includes/' . $export_type . '.php' ) )
7
+ include_once( WOO_CE_PATH . 'includes/' . $export_type . '.php' );
8
+ if( file_exists( WOO_CE_PATH . 'includes/' . $export_type . '-extend.php' ) )
9
+ include_once( WOO_CE_PATH . 'includes/' . $export_type . '-extend.php' );
10
+ if( file_exists( WOO_CE_PATH . 'includes/admin/' . $export_type . '.php' ) )
11
+ include_once( WOO_CE_PATH . 'includes/admin/' . $export_type . '.php' );
12
+ return;
13
+ }
14
 
15
  include_once( WOO_CE_PATH . 'includes/product.php' );
16
  include_once( WOO_CE_PATH . 'includes/product-extend.php' );
32
  include_once( WOO_CE_PATH . 'includes/booking.php' );
33
 
34
  // Load the export type resources first
35
+ if( is_admin() ) {
36
+ include_once( WOO_CE_PATH . 'includes/admin/product.php' );
37
+ include_once( WOO_CE_PATH . 'includes/admin/category.php' );
38
+ include_once( WOO_CE_PATH . 'includes/admin/tag.php' );
39
+ include_once( WOO_CE_PATH . 'includes/admin/brand.php' );
40
+ include_once( WOO_CE_PATH . 'includes/admin/order.php' );
41
+ include_once( WOO_CE_PATH . 'includes/admin/customer.php' );
42
+ include_once( WOO_CE_PATH . 'includes/admin/user.php' );
43
+ include_once( WOO_CE_PATH . 'includes/admin/coupon.php' );
44
+ include_once( WOO_CE_PATH . 'includes/admin/subscription.php' );
45
+ include_once( WOO_CE_PATH . 'includes/admin/commission.php' );
46
+ include_once( WOO_CE_PATH . 'includes/admin/shipping_class.php' );
47
+ }
48
 
49
  }
50
 
61
  /* Start of: WordPress Administration */
62
 
63
  include_once( WOO_CE_PATH . 'includes/admin.php' );
64
+
65
  // WordPress Admin Pointers
66
  include_once( WOO_CE_PATH . 'includes/settings.php' );
67
 
299
  woo_ce_admin_notice_html( $message, 'error' );
300
  }
301
 
302
+ // Displays a notice where the maximum execution time cannot be set
303
  if( !woo_ce_get_option( 'dismiss_execution_time_prompt', 0 ) ) {
304
  $max_execution_time = absint( ini_get( 'max_execution_time' ) );
305
  $response = @ini_set( 'max_execution_time', 120 );
310
  }
311
  }
312
 
313
+ // Displays a notice where the memory allocated to WordPress falls below 64MB
314
  if( !woo_ce_get_option( 'dismiss_memory_prompt', 0 ) ) {
315
  $memory_limit = absint( ini_get( 'memory_limit' ) );
316
  $minimum_memory_limit = 64;
321
  }
322
  }
323
 
324
+ // Displays a notice if PHP 5.2 or lower is installed
325
  if( version_compare( phpversion(), '5.3', '<' ) && !woo_ce_get_option( 'dismiss_php_legacy', 0 ) ) {
326
  $dismiss_url = esc_url( add_query_arg( array( 'action' => 'dismiss_php_legacy', '_wpnonce' => wp_create_nonce( 'woo_ce_dismiss_php_legacy' ) ) ) );
327
  $message = '<span style="float:right;"><a href="' . $dismiss_url . '">' . __( 'Dismiss', 'woocommerce-exporter' ) . '</a></span>' . sprintf( __( 'Your PHP version (%s) is not supported and is very much out of date, since 2010 all users are strongly encouraged to upgrade to PHP 5.3+ and above. Contact your hosting provider to make this happen. See: <a href="%s" target="_blank">Migrating from PHP 5.2 to 5.3</a>', 'woocommerce-exporter' ), phpversion(), $troubleshooting_url );
328
  woo_ce_admin_notice_html( $message, 'error' );
329
  }
330
 
331
+ // Displays notice if there are more than 2500 Subscriptions
332
  if( !woo_ce_get_option( 'dismiss_subscription_prompt', 0 ) ) {
333
  if( class_exists( 'WC_Subscriptions' ) ) {
334
  $wcs_version = woo_ce_get_wc_subscriptions_version();
351
  woo_ce_admin_notice_html( $message, 'error' );
352
  delete_transient( WOO_CE_PREFIX . '_running' );
353
  }
354
+ // Displays a notice if Archives is disabled and the Archives tab is opened
355
  if(
356
  woo_ce_get_option( 'delete_file', '1' ) == 1
357
  && ( isset( $_GET['tab'] ) ? sanitize_text_field( $_GET['tab'] ) : '' ) == 'archive'
363
  woo_ce_admin_notice_html( $message );
364
  }
365
 
366
+ // Displays a notice if Archives are detected without a Post Status of private
367
  if( woo_ce_get_unprotected_archives( array( 'count' => true ) ) && !woo_ce_get_option( 'dismiss_archives_privacy_prompt', 0 ) ) {
368
  $dismiss_url = esc_url( add_query_arg( array( 'action' => 'dismiss_archives_privacy_prompt', '_wpnonce' => wp_create_nonce( 'woo_ce_dismiss_archives_privacy_prompt' ) ) ) );
369
  $override_url = esc_url( add_query_arg( array( 'action' => 'override_archives_privacy', '_wpnonce' => wp_create_nonce( 'woo_ce_override_archives_privacy' ) ) ) );
738
 
739
  // Drop in our content filters here
740
  add_filter( 'sanitize_key', 'woo_ce_filter_sanitize_key' );
741
+ add_filter( 'attribute_escape', 'woo_ce_filter_attribute_escape', 10, 2 );
742
 
743
  switch( $export_type ) {
744
 
749
  foreach( $export->fields as $key => $field )
750
  $export->columns[] = woo_ce_get_product_field( $key );
751
  }
752
+ $export->total_columns = count( $export->columns );
753
  $export->data_memory_start = woo_ce_current_memory_usage();
754
+ add_filter( 'woo_ce_export_dataset_product', 'woo_ce_export_dataset_override_product', 10, 2 );
755
+ $output = apply_filters( 'woo_ce_export_dataset_product', $output, $export_type );
756
+ remove_filter( 'woo_ce_export_dataset_product', 'woo_ce_export_dataset_override_product' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
757
  $export->data_memory_end = woo_ce_current_memory_usage();
758
  break;
759
 
764
  foreach( $export->fields as $key => $field )
765
  $export->columns[] = woo_ce_get_category_field( $key );
766
  }
767
+ $export->total_columns = count( $export->columns );
768
  $export->data_memory_start = woo_ce_current_memory_usage();
769
+ add_filter( 'woo_ce_export_dataset_category', 'woo_ce_export_dataset_override_category', 10, 2 );
770
+ $output = apply_filters( 'woo_ce_export_dataset_category', $output, $export_type );
771
+ remove_filter( 'woo_ce_export_dataset_category', 'woo_ce_export_dataset_override_category' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
772
  $export->data_memory_end = woo_ce_current_memory_usage();
773
  break;
774
 
779
  foreach( $export->fields as $key => $field )
780
  $export->columns[] = woo_ce_get_tag_field( $key );
781
  }
782
+ $export->total_columns = count( $export->columns );
783
  $export->data_memory_start = woo_ce_current_memory_usage();
784
+ add_filter( 'woo_ce_export_dataset_tag', 'woo_ce_export_dataset_override_tag', 10, 2 );
785
+ $output = apply_filters( 'woo_ce_export_dataset_tag', $output, $export_type );
786
+ remove_filter( 'woo_ce_export_dataset_tag', 'woo_ce_export_dataset_override_tag' );
787
+ $export->data_memory_end = woo_ce_current_memory_usage();
788
+ break;
789
+
790
+ // Orders
791
+ case 'order':
792
+ $fields = woo_ce_get_order_fields( 'summary' );
793
+ if( $export->fields = array_intersect_assoc( (array)$export->fields, $fields ) ) {
794
+ foreach( $export->fields as $key => $field )
795
+ $export->columns[] = woo_ce_get_order_field( $key );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
796
  }
797
+ $export->total_columns = count( $export->columns );
798
+ $export->data_memory_start = woo_ce_current_memory_usage();
799
+ add_filter( 'woo_ce_export_dataset_order', 'woo_ce_export_dataset_override_order', 10, 2 );
800
+ $output = apply_filters( 'woo_ce_export_dataset_order', $output, $export_type );
801
+ remove_filter( 'woo_ce_export_dataset_order', 'woo_ce_export_dataset_override_order' );
802
  $export->data_memory_end = woo_ce_current_memory_usage();
803
  break;
804
 
809
  foreach( $export->fields as $key => $field )
810
  $export->columns[] = woo_ce_get_user_field( $key );
811
  }
812
+ $export->total_columns = count( $export->columns );
813
  $export->data_memory_start = woo_ce_current_memory_usage();
814
+ add_filter( 'woo_ce_export_dataset_user', 'woo_ce_export_dataset_override_user', 10, 2 );
815
+ $output = apply_filters( 'woo_ce_export_dataset_user', $output, $export_type );
816
+ remove_filter( 'woo_ce_export_dataset_user', 'woo_ce_export_dataset_override_user' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
817
  $export->data_memory_end = woo_ce_current_memory_usage();
818
  break;
819
 
821
 
822
  // Remove our content filters here to play nice with other Plugins
823
  remove_filter( 'sanitize_key', 'woo_ce_filter_sanitize_key' );
824
+ remove_filter( 'attribute_escape', 'woo_ce_filter_attribute_escape' );
825
 
826
  // Remove our fatal error notice so not to conflict with the CRON or scheduled export engine
827
  remove_action( 'shutdown', 'woo_ce_fatal_error' );
912
  'booking' => ( $plural ? __( 'Bookings', 'woocommerce-exporter' ) : __( 'Booking', 'woocommerce-exporter' ) ),
913
  'attribute' => ( $plural ? __( 'Attributes', 'woocommerce-exporter' ) : __( 'Attribute', 'woocommerce-exporter' ) )
914
  );
915
+ $export_types = apply_filters( 'woo_ce_export_types', $export_types, $plural );
916
  return $export_types;
917
 
918
  }
1012
  'private',
1013
  'trash'
1014
  );
1015
+ if( $override && !empty( $extra_status ) ) {
1016
  $output = $extra_status;
1017
  } else {
1018
  if( $extra_status )
1032
  'xml' => 'application/xml',
1033
  'rss' => 'application/rss+xml'
1034
  );
1035
+
1036
+ // Allow Plugin/Theme authors to add support for additional export formats
1037
+ $mime_types = apply_filters( 'woo_ce_get_mime_types', $mime_types );
1038
+
1039
  return $mime_types;
1040
 
1041
  }
1073
  // Add RSS mime type if it has been removed
1074
  if( !isset( $mime_types['rss'] ) )
1075
  $mime_types['rss'] = 'application/rss+xml';
1076
+
1077
+ // Allow Plugin/Theme authors to add support for additional export formats
1078
+ $mime_types = apply_filters( 'woo_ce_add_missing_mime_type', $mime_types );
1079
+
1080
  return $mime_types;
1081
 
1082
  }
1169
  );
1170
  $modules[] = array(
1171
  'name' => 'gpf',
1172
+ 'title' => __( 'WooCommerce Google Product Feed', 'woocommerce-exporter' ),
1173
  'description' => __( 'Easily configure data to be added to your Google Merchant Centre feed.', 'woocommerce-exporter' ),
1174
+ 'url' => 'https://woocommerce.com/products/google-product-feed/',
1175
  'function' => 'woocommerce_gpf_install'
1176
  );
1177
  $modules[] = array(
1620
  'url' => 'http://yithemes.com/themes/plugins/yith-woocommerce-product-vendors/',
1621
  'function' => 'YITH_Vendors'
1622
  );
 
1623
  $modules[] = array(
1624
  'name' => 'wc_memberships',
1625
  'title' => __( 'WooCommerce Memberships', 'woocommerce-exporter' ),
1627
  'url' => 'http://www.woothemes.com/products/woocommerce-memberships/',
1628
  'function' => 'init_woocommerce_memberships'
1629
  );
 
1630
  $modules[] = array(
1631
  'name' => 'wc_product_bundles',
1632
  'title' => __( 'WooCommerce Product Bundles', 'woocommerce-exporter' ),
1911
  'slug' => 'yith-woocommerce-pdf-invoice',
1912
  'function' => 'yith_ywpi_init'
1913
  );
1914
+ $modules[] = array(
1915
+ 'name' => 'yith_pdf_invoice',
1916
+ 'title' => __( 'YITH WooCommerce PDF Invoice and Shipping List Premium', 'woocommerce-exporter' ),
1917
+ 'description' => __( 'Generate PDF invoices, credit notes, pro-forma invoice and packing slip for WooCommerce orders.', 'woocommerce-exporter' ),
1918
+ 'url' => 'http://yithemes.com/themes/plugins/yith-woocommerce-pdf-invoice/',
1919
+ 'function' => 'YITH_PDF_Invoice'
1920
+ );
1921
  $modules[] = array(
1922
  'name' => 'alg_con',
1923
  'title' => __( 'Custom Order Numbers for WooCommerce', 'woocommerce-exporter' ),
1956
  'slug' => 'ecr-google-customer-reviews',
1957
  'function' => 'ecr_gcr_missing_wc_notice'
1958
  );
1959
+ $modules[] = array(
1960
+ 'name' => 'wpla_wplister',
1961
+ 'title' => __( 'WP-Lister Pro for Amazon', 'woocommerce-exporter' ),
1962
+ 'description' => __( 'List your products on Amazon the easy way.', 'woocommerce-exporter' ),
1963
+ 'url' => 'https://www.wplab.com/plugins/wp-lister-for-amazon/',
1964
+ 'class' => 'WPLA_WPLister'
1965
+ );
1966
+ $modules[] = array(
1967
+ 'name' => 'wple_wplister',
1968
+ 'title' => __( 'WP-Lister Pro for eBay', 'woocommerce-exporter' ),
1969
+ 'description' => __( 'List your products on eBay the easy way.', 'woocommerce-exporter' ),
1970
+ 'url' => 'https://www.wplab.com/plugins/wp-lister/',
1971
+ 'class' => 'WPL_WPLister'
1972
+ );
1973
+ $modules[] = array(
1974
+ 'name' => 'alidropship',
1975
+ 'title' => __( 'AliDropship for WooCommerce', 'woocommerce-exporter' ),
1976
+ 'description' => __( 'AliDropship is a WordPress Plugin to import AliExpress products into your WooCommerce Shop.', 'woocommerce-exporter' ),
1977
+ 'url' => 'https://alidropship.com/',
1978
+ 'function' => 'adsw_check_server'
1979
+ );
1980
 
1981
  // Ship to Multiple Addresses - WC_Ship_Multiple
1982
 
includes/order.php CHANGED
@@ -3,12 +3,10 @@ if( is_admin() ) {
3
 
4
  /* Start of: WordPress Administration */
5
 
6
- function woo_ce_get_export_type_order_count() {
 
7
 
8
- $count = 0;
9
- // Check if the existing Transient exists
10
- $cached = get_transient( WOO_CE_PREFIX . '_order_count' );
11
- if( $cached == false ) {
12
  $post_type = 'shop_order';
13
  $woocommerce_version = woo_get_woo_version();
14
  // Check if this is a WooCommerce 2.2+ instance (new Post Status)
@@ -16,22 +14,46 @@ if( is_admin() ) {
16
  $post_status = ( function_exists( 'wc_get_order_statuses' ) ? apply_filters( 'woo_ce_order_post_status', array_keys( wc_get_order_statuses() ) ) : 'any' );
17
  else
18
  $post_status = apply_filters( 'woo_ce_order_post_status', woo_ce_post_statuses() );
19
- $args = array(
20
- 'post_type' => $post_type,
21
- 'posts_per_page' => 1,
22
- 'post_status' => $post_status,
23
- 'fields' => 'ids'
24
- );
25
- $count_query = new WP_Query( $args );
26
- $count = $count_query->found_posts;
27
- set_transient( WOO_CE_PREFIX . '_order_count', $count, HOUR_IN_SECONDS );
28
- } else {
29
- $count = $cached;
30
- }
31
- return $count;
 
 
 
32
 
 
33
  }
34
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
  /* End of: WordPress Administration */
37
 
@@ -57,7 +79,8 @@ function woo_ce_get_order_fields( $format = 'full', $post_ID = 0 ) {
57
  );
58
  $fields[] = array(
59
  'name' => 'purchase_subtotal',
60
- 'label' => __( 'Order Subtotal', 'woocommerce-exporter' )
 
61
  );
62
  $fields[] = array(
63
  'name' => 'order_currency',
@@ -65,23 +88,28 @@ function woo_ce_get_order_fields( $format = 'full', $post_ID = 0 ) {
65
  );
66
  $fields[] = array(
67
  'name' => 'order_discount',
68
- 'label' => __( 'Order Discount', 'woocommerce-exporter' )
 
69
  );
70
  $fields[] = array(
71
  'name' => 'coupon_code',
72
- 'label' => __( 'Coupon Code', 'woocommerce-exporter' )
 
73
  );
74
  $fields[] = array(
75
  'name' => 'coupon_expiry_date',
76
- 'label' => __( 'Coupon Expiry Date', 'woocommerce-exporter' )
 
77
  );
78
  $fields[] = array(
79
  'name' => 'coupon_description',
80
- 'label' => __( 'Coupon Description', 'woocommerce-exporter' )
 
81
  );
82
  $fields[] = array(
83
  'name' => 'purchase_total_tax',
84
- 'label' => __( 'Order Total Tax', 'woocommerce-exporter' )
 
85
  );
86
  /*
87
  $fields[] = array(
@@ -91,7 +119,8 @@ function woo_ce_get_order_fields( $format = 'full', $post_ID = 0 ) {
91
  */
92
  $fields[] = array(
93
  'name' => 'order_subtotal_excl_tax',
94
- 'label' => __( 'Order Subtotal Excl. Tax', 'woocommerce-exporter' )
 
95
  );
96
  /*
97
  $fields[] = array(
@@ -101,31 +130,38 @@ function woo_ce_get_order_fields( $format = 'full', $post_ID = 0 ) {
101
  */
102
  $fields[] = array(
103
  'name' => 'order_sales_tax',
104
- 'label' => __( 'Sales Tax Total', 'woocommerce-exporter' )
 
105
  );
106
  $fields[] = array(
107
  'name' => 'order_shipping_tax',
108
- 'label' => __( 'Shipping Tax Total', 'woocommerce-exporter' )
 
109
  );
110
  $fields[] = array(
111
  'name' => 'shipping_incl_tax',
112
- 'label' => __( 'Shipping Incl. Tax', 'woocommerce-exporter' )
 
113
  );
114
  $fields[] = array(
115
  'name' => 'shipping_excl_tax',
116
- 'label' => __( 'Shipping Excl. Tax', 'woocommerce-exporter' )
 
117
  );
118
  $fields[] = array(
119
  'name' => 'refund_total',
120
- 'label' => __( 'Refund Total', 'woocommerce-exporter' )
 
121
  );
122
  $fields[] = array(
123
  'name' => 'refund_date',
124
- 'label' => __( 'Refund Date', 'woocommerce-exporter' )
 
125
  );
126
  $fields[] = array(
127
  'name' => 'order_tax_percentage',
128
- 'label' => __( 'Order Tax Percentage', 'woocommerce-exporter' )
 
129
  );
130
  $fields[] = array(
131
  'name' => 'payment_gateway_id',
@@ -145,11 +181,13 @@ function woo_ce_get_order_fields( $format = 'full', $post_ID = 0 ) {
145
  );
146
  $fields[] = array(
147
  'name' => 'shipping_cost',
148
- 'label' => __( 'Shipping Cost', 'woocommerce-exporter' )
 
149
  );
150
  $fields[] = array(
151
  'name' => 'shipping_weight_total',
152
- 'label' => __( 'Shipping Weight', 'woocommerce-exporter' )
 
153
  );
154
  $fields[] = array(
155
  'name' => 'payment_status',
@@ -157,23 +195,28 @@ function woo_ce_get_order_fields( $format = 'full', $post_ID = 0 ) {
157
  );
158
  $fields[] = array(
159
  'name' => 'post_status',
160
- 'label' => __( 'Post Status', 'woocommerce-exporter' )
 
161
  );
162
  $fields[] = array(
163
  'name' => 'order_key',
164
- 'label' => __( 'Order Key', 'woocommerce-exporter' )
 
165
  );
166
  $fields[] = array(
167
  'name' => 'transaction_id',
168
- 'label' => __( 'Transaction ID', 'woocommerce-exporter' )
 
169
  );
170
  $fields[] = array(
171
  'name' => 'created_via',
172
- 'label' => __( 'Created Via', 'woocommerce-exporter' )
 
173
  );
174
  $fields[] = array(
175
  'name' => 'cart_hash',
176
- 'label' => __( 'Cart Hash', 'woocommerce-exporter' )
 
177
  );
178
  $fields[] = array(
179
  'name' => 'purchase_date',
@@ -181,86 +224,105 @@ function woo_ce_get_order_fields( $format = 'full', $post_ID = 0 ) {
181
  );
182
  $fields[] = array(
183
  'name' => 'purchase_time',
184
- 'label' => __( 'Order Time', 'woocommerce-exporter' )
 
185
  );
186
  $fields[] = array(
187
  'name' => 'customer_message',
188
- 'label' => __( 'Customer Message', 'woocommerce-exporter' )
 
189
  );
190
  $fields[] = array(
191
  'name' => 'customer_notes',
192
- 'label' => __( 'Customer Notes', 'woocommerce-exporter' )
 
193
  );
194
  $fields[] = array(
195
  'name' => 'order_notes',
196
- 'label' => __( 'Order Notes', 'woocommerce-exporter' )
 
197
  );
198
  // PayPal
199
  $fields[] = array(
200
  'name' => 'paypal_payer_paypal_address',
201
  'label' => __( 'PayPal: Payer PayPal Address', 'woocommerce-exporter' ),
202
- 'hover' => __( 'PayPal', 'woocommerce-exporter' )
 
203
  );
204
  $fields[] = array(
205
  'name' => 'paypal_payer_first_name',
206
  'label' => __( 'PayPal: Payer first name', 'woocommerce-exporter' ),
207
- 'hover' => __( 'PayPal', 'woocommerce-exporter' )
 
208
  );
209
  $fields[] = array(
210
  'name' => 'paypal_payer_last_name',
211
  'label' => __( 'PayPal: Payer last name', 'woocommerce-exporter' ),
212
- 'hover' => __( 'PayPal', 'woocommerce-exporter' )
 
213
  );
214
  $fields[] = array(
215
  'name' => 'paypal_payment_type',
216
  'label' => __( 'PayPal: Payment type', 'woocommerce-exporter' ),
217
- 'hover' => __( 'PayPal', 'woocommerce-exporter' )
 
218
  );
219
  $fields[] = array(
220
  'name' => 'paypal_payment_status',
221
  'label' => __( 'PayPal: Payment status', 'woocommerce-exporter' ),
222
- 'hover' => __( 'PayPal', 'woocommerce-exporter' )
 
223
  );
224
 
225
  $fields[] = array(
226
  'name' => 'total_quantity',
227
- 'label' => __( 'Total Quantity', 'woocommerce-exporter' )
 
228
  );
229
  $fields[] = array(
230
  'name' => 'total_order_items',
231
- 'label' => __( 'Total Order Items', 'woocommerce-exporter' )
 
232
  );
233
  $fields[] = array(
234
  'name' => 'user_id',
235
- 'label' => __( 'User ID', 'woocommerce-exporter' )
 
236
  );
237
  $fields[] = array(
238
  'name' => 'user_name',
239
- 'label' => __( 'Username', 'woocommerce-exporter' )
 
240
  );
241
  $fields[] = array(
242
  'name' => 'user_role',
243
- 'label' => __( 'User Role', 'woocommerce-exporter' )
 
244
  );
245
  $fields[] = array(
246
  'name' => 'ip_address',
247
- 'label' => __( 'Checkout IP Address', 'woocommerce-exporter' )
 
248
  );
249
  $fields[] = array(
250
  'name' => 'browser_agent',
251
- 'label' => __( 'Checkout Browser Agent', 'woocommerce-exporter' )
 
252
  );
253
  $fields[] = array(
254
  'name' => 'has_downloads',
255
- 'label' => __( 'Has Downloads', 'woocommerce-exporter' )
 
256
  );
257
  $fields[] = array(
258
  'name' => 'has_downloaded',
259
- 'label' => __( 'Has Downloaded', 'woocommerce-exporter' )
 
260
  );
261
  $fields[] = array(
262
  'name' => 'billing_full_name',
263
- 'label' => __( 'Billing: Full Name', 'woocommerce-exporter' )
 
264
  );
265
  $fields[] = array(
266
  'name' => 'billing_first_name',
@@ -276,7 +338,8 @@ function woo_ce_get_order_fields( $format = 'full', $post_ID = 0 ) {
276
  );
277
  $fields[] = array(
278
  'name' => 'billing_address',
279
- 'label' => __( 'Billing: Street Address (Full)', 'woocommerce-exporter' )
 
280
  );
281
  $fields[] = array(
282
  'name' => 'billing_address_1',
@@ -300,7 +363,8 @@ function woo_ce_get_order_fields( $format = 'full', $post_ID = 0 ) {
300
  );
301
  $fields[] = array(
302
  'name' => 'billing_state_full',
303
- 'label' => __( 'Billing: State', 'woocommerce-exporter' )
 
304
  );
305
  $fields[] = array(
306
  'name' => 'billing_country',
@@ -308,67 +372,83 @@ function woo_ce_get_order_fields( $format = 'full', $post_ID = 0 ) {
308
  );
309
  $fields[] = array(
310
  'name' => 'billing_country_full',
311
- 'label' => __( 'Billing: Country', 'woocommerce-exporter' )
 
312
  );
313
  $fields[] = array(
314
  'name' => 'billing_phone',
315
- 'label' => __( 'Billing: Phone Number', 'woocommerce-exporter' )
 
316
  );
317
  $fields[] = array(
318
  'name' => 'billing_email',
319
- 'label' => __( 'Billing: E-mail Address', 'woocommerce-exporter' )
 
320
  );
321
  $fields[] = array(
322
  'name' => 'shipping_full_name',
323
- 'label' => __( 'Shipping: Full Name', 'woocommerce-exporter' )
 
324
  );
325
  $fields[] = array(
326
  'name' => 'shipping_first_name',
327
- 'label' => __( 'Shipping: First Name', 'woocommerce-exporter' )
 
328
  );
329
  $fields[] = array(
330
  'name' => 'shipping_last_name',
331
- 'label' => __( 'Shipping: Last Name', 'woocommerce-exporter' )
 
332
  );
333
  $fields[] = array(
334
  'name' => 'shipping_company',
335
- 'label' => __( 'Shipping: Company', 'woocommerce-exporter' )
 
336
  );
337
  $fields[] = array(
338
  'name' => 'shipping_address',
339
- 'label' => __( 'Shipping: Street Address (Full)', 'woocommerce-exporter' )
 
340
  );
341
  $fields[] = array(
342
  'name' => 'shipping_address_1',
343
- 'label' => __( 'Shipping: Street Address 1', 'woocommerce-exporter' )
 
344
  );
345
  $fields[] = array(
346
  'name' => 'shipping_address_2',
347
- 'label' => __( 'Shipping: Street Address 2', 'woocommerce-exporter' )
 
348
  );
349
  $fields[] = array(
350
  'name' => 'shipping_city',
351
- 'label' => __( 'Shipping: City', 'woocommerce-exporter' )
 
352
  );
353
  $fields[] = array(
354
  'name' => 'shipping_postcode',
355
- 'label' => __( 'Shipping: ZIP Code', 'woocommerce-exporter' )
 
356
  );
357
  $fields[] = array(
358
  'name' => 'shipping_state',
359
- 'label' => __( 'Shipping: State (prefix)', 'woocommerce-exporter' )
 
360
  );
361
  $fields[] = array(
362
  'name' => 'shipping_state_full',
363
- 'label' => __( 'Shipping: State', 'woocommerce-exporter' )
 
364
  );
365
  $fields[] = array(
366
  'name' => 'shipping_country',
367
- 'label' => __( 'Shipping: Country (prefix)', 'woocommerce-exporter' )
 
368
  );
369
  $fields[] = array(
370
  'name' => 'shipping_country_full',
371
- 'label' => __( 'Shipping: Country', 'woocommerce-exporter' )
 
372
  );
373
 
374
  /*
@@ -393,15 +473,18 @@ function woo_ce_get_order_fields( $format = 'full', $post_ID = 0 ) {
393
  );
394
  $fields[] = array(
395
  'name' => 'order_items_product_id',
396
- 'label' => __( 'Order Items: Product ID', 'woocommerce-exporter' )
 
397
  );
398
  $fields[] = array(
399
  'name' => 'order_items_variation_id',
400
- 'label' => __( 'Order Items: Variation ID', 'woocommerce-exporter' )
 
401
  );
402
  $fields[] = array(
403
  'name' => 'order_items_sku',
404
- 'label' => __( 'Order Items: SKU', 'woocommerce-exporter' )
 
405
  );
406
  $fields[] = array(
407
  'name' => 'order_items_name',
@@ -409,31 +492,38 @@ function woo_ce_get_order_fields( $format = 'full', $post_ID = 0 ) {
409
  );
410
  $fields[] = array(
411
  'name' => 'order_items_variation',
412
- 'label' => __( 'Order Items: Product Variation', 'woocommerce-exporter' )
 
413
  );
414
  $fields[] = array(
415
  'name' => 'order_items_image_embed',
416
- 'label' => __( 'Order Items: Featured Image (Embed)', 'woocommerce-exporter' )
 
417
  );
418
  $fields[] = array(
419
  'name' => 'order_items_description',
420
- 'label' => __( 'Order Items: Product Description', 'woocommerce-exporter' )
 
421
  );
422
  $fields[] = array(
423
  'name' => 'order_items_excerpt',
424
- 'label' => __( 'Order Items: Product Excerpt', 'woocommerce-exporter' )
 
425
  );
426
  $fields[] = array(
427
  'name' => 'order_items_publish_date',
428
- 'label' => __( 'Order Items: Publish Date', 'woocommerce-exporter' )
 
429
  );
430
  $fields[] = array(
431
  'name' => 'order_items_modified_date',
432
- 'label' => __( 'Order Items: Modified Date', 'woocommerce-exporter' )
 
433
  );
434
  $fields[] = array(
435
  'name' => 'order_items_tax_class',
436
- 'label' => __( 'Order Items: Tax Class', 'woocommerce-exporter' )
 
437
  );
438
  $fields[] = array(
439
  'name' => 'order_items_quantity',
@@ -445,31 +535,38 @@ function woo_ce_get_order_fields( $format = 'full', $post_ID = 0 ) {
445
  );
446
  $fields[] = array(
447
  'name' => 'order_items_subtotal',
448
- 'label' => __( 'Order Items: Subtotal', 'woocommerce-exporter' )
 
449
  );
450
  $fields[] = array(
451
  'name' => 'order_items_rrp',
452
- 'label' => __( 'Order Items: RRP', 'woocommerce-exporter' )
 
453
  );
454
  $fields[] = array(
455
  'name' => 'order_items_stock',
456
- 'label' => __( 'Order Items: Stock', 'woocommerce-exporter' )
 
457
  );
458
  $fields[] = array(
459
  'name' => 'order_items_shipping_class',
460
- 'label' => __( 'Order Items: Shipping Class', 'woocommerce-exporter' )
 
461
  );
462
  $fields[] = array(
463
  'name' => 'order_items_tax',
464
- 'label' => __( 'Order Items: Tax', 'woocommerce-exporter' )
 
465
  );
466
  $fields[] = array(
467
  'name' => 'order_items_tax_percentage',
468
- 'label' => __( 'Order Items: Tax Percentage', 'woocommerce-exporter' )
 
469
  );
470
  $fields[] = array(
471
  'name' => 'order_items_tax_subtotal',
472
- 'label' => __( 'Order Items: Tax Subtotal', 'woocommerce-exporter' )
 
473
  );
474
  // Order Item: Tax Rate - ...
475
  $tax_rates = woo_ce_get_order_tax_rates();
@@ -477,58 +574,71 @@ function woo_ce_get_order_fields( $format = 'full', $post_ID = 0 ) {
477
  foreach( $tax_rates as $tax_rate ) {
478
  $fields[] = array(
479
  'name' => sprintf( 'order_items_tax_rate_%d', $tax_rate['rate_id'] ),
480
- 'label' => sprintf( __( 'Order Items: Tax Rate - %s', 'woocommerce-exporter' ), $tax_rate['label'] )
 
481
  );
482
  }
483
  }
484
  unset( $tax_rates, $tax_rate );
485
  $fields[] = array(
486
  'name' => 'order_items_refund_subtotal',
487
- 'label' => __( 'Order Items: Refund Subtotal', 'woocommerce-exporter' )
 
488
  );
489
  $fields[] = array(
490
  'name' => 'order_items_refund_quantity',
491
- 'label' => __( 'Order Items: Refund Quantity', 'woocommerce-exporter' )
 
492
  );
493
  $fields[] = array(
494
  'name' => 'order_items_type',
495
- 'label' => __( 'Order Items: Type', 'woocommerce-exporter' )
 
496
  );
497
  $fields[] = array(
498
  'name' => 'order_items_type_id',
499
- 'label' => __( 'Order Items: Type ID', 'woocommerce-exporter' )
 
500
  );
501
  $fields[] = array(
502
  'name' => 'order_items_category',
503
- 'label' => __( 'Order Items: Category', 'woocommerce-exporter' )
 
504
  );
505
  $fields[] = array(
506
  'name' => 'order_items_tag',
507
- 'label' => __( 'Order Items: Tag', 'woocommerce-exporter' )
 
508
  );
509
  $fields[] = array(
510
  'name' => 'order_items_total_sales',
511
- 'label' => __( 'Order Items: Total Sales', 'woocommerce-exporter' )
 
512
  );
513
  $fields[] = array(
514
  'name' => 'order_items_weight',
515
- 'label' => __( 'Order Items: Weight', 'woocommerce-exporter' )
 
516
  );
517
  $fields[] = array(
518
  'name' => 'order_items_height',
519
- 'label' => __( 'Order Items: Height', 'woocommerce-exporter' )
 
520
  );
521
  $fields[] = array(
522
  'name' => 'order_items_width',
523
- 'label' => __( 'Order Items: Width', 'woocommerce-exporter' )
 
524
  );
525
  $fields[] = array(
526
  'name' => 'order_items_length',
527
- 'label' => __( 'Order Items: Length', 'woocommerce-exporter' )
 
528
  );
529
  $fields[] = array(
530
  'name' => 'order_items_total_weight',
531
- 'label' => __( 'Order Items: Total Weight', 'woocommerce-exporter' )
 
532
  );
533
 
534
  // Drop in our content filters here
@@ -547,8 +657,10 @@ function woo_ce_get_order_fields( $format = 'full', $post_ID = 0 ) {
547
  $output = array();
548
  $size = count( $fields );
549
  for( $i = 0; $i < $size; $i++ ) {
550
- if( isset( $fields[$i] ) )
551
- $output[$fields[$i]['name']] = 'on';
 
 
552
  }
553
  return $output;
554
  break;
@@ -580,7 +692,14 @@ function woo_ce_get_order_fields( $format = 'full', $post_ID = 0 ) {
580
  // Check if we should override field labels from the Field Editor
581
  function woo_ce_override_order_field_labels( $fields = array() ) {
582
 
583
- $labels = woo_ce_get_option( 'order_labels', array() );
 
 
 
 
 
 
 
584
  if( !empty( $labels ) ) {
585
  foreach( $fields as $key => $field ) {
586
  if( isset( $labels[$field['name']] ) )
@@ -593,25 +712,353 @@ function woo_ce_override_order_field_labels( $fields = array() ) {
593
  add_filter( 'woo_ce_order_fields', 'woo_ce_override_order_field_labels', 11 );
594
  add_filter( 'woo_ce_order_items_fields', 'woo_ce_override_order_field_labels', 11 );
595
 
596
- // Returns a list of WooCommerce Tax Rates based on existing Orders
597
- function woo_ce_get_order_tax_rates( $order_id = 0 ) {
598
 
599
- global $wpdb;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
600
 
601
- $order_item_type = 'tax';
602
- $tax_rates_sql = $wpdb->prepare( "SELECT order_items.order_item_id as item_id FROM " . $wpdb->prefix . "woocommerce_order_items as order_items WHERE order_items.order_item_type = %s", $order_item_type );
603
  if( !empty( $order_id ) ) {
604
- $tax_rates_sql .= $wpdb->prepare( " AND order_items.order_id = %d", $order_id );
 
 
 
 
 
 
 
605
  }
606
- $tax_rates_sql .= " GROUP BY order_items.order_item_name";
607
- $tax_rates = $wpdb->get_results( $tax_rates_sql, 'ARRAY_A' );
608
- if( !empty( $tax_rates ) ) {
609
- $meta_type = 'order_item';
610
- foreach( $tax_rates as $key => $tax_rate ) {
611
- $tax_rates[$key]['rate_id'] = get_metadata( $meta_type, $tax_rate['item_id'], 'rate_id', true );
612
- $tax_rates[$key]['label'] = get_metadata( $meta_type, $tax_rate['item_id'], 'label', true );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
613
  }
614
- return $tax_rates;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
615
  }
616
 
617
  }
@@ -683,39 +1130,227 @@ function woo_ce_get_extra_product_option_fields() {
683
 
684
  }
685
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
686
  // Returns a list of WooCommerce Order statuses
687
  function woo_ce_get_order_statuses() {
688
 
689
  $terms = false;
690
- // Check if this is a WooCommerce 2.2+ instance (new Post Status)
691
- $woocommerce_version = woo_get_woo_version();
692
- if( version_compare( $woocommerce_version, '2.2' ) >= 0 ) {
693
- // Convert Order Status array into our magic sauce
694
- $order_statuses = ( function_exists( 'wc_get_order_statuses' ) ? wc_get_order_statuses() : false );
695
- if( !empty( $order_statuses ) ) {
696
- $terms = array();
697
- $post_type = 'shop_order';
698
- $posts_count = wp_count_posts( $post_type );
699
- foreach( $order_statuses as $key => $order_status ) {
700
- $terms[] = (object)array(
701
- 'name' => $order_status,
702
- 'slug' => $key,
703
- 'count' => ( isset( $posts_count->$key ) ? $posts_count->$key : 0 )
704
- );
 
 
 
 
 
 
705
  }
 
 
 
 
 
 
 
706
  }
 
 
707
  } else {
708
- $args = array(
709
- 'hide_empty' => false
710
- );
711
- $terms = get_terms( 'shop_order_status', $args );
712
- if( empty( $terms ) || ( is_wp_error( $terms ) == true ) )
713
- $terms = false;
714
  }
715
  return $terms;
716
 
717
  }
718
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
719
  // Returns a list of WooCommerce Order Item Types
720
  function woo_ce_get_order_items_types() {
721
 
@@ -731,6 +1366,52 @@ function woo_ce_get_order_items_types() {
731
  $order_item_types = apply_filters( 'woo_ce_order_item_types', $order_item_types );
732
 
733
  return $order_item_types;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
734
 
735
  }
736
  ?>
3
 
4
  /* Start of: WordPress Administration */
5
 
6
+ if( !function_exists( 'woo_ce_get_export_type_order_count' ) ) {
7
+ function woo_ce_get_export_type_order_count() {
8
 
9
+ $count = 0;
 
 
 
10
  $post_type = 'shop_order';
11
  $woocommerce_version = woo_get_woo_version();
12
  // Check if this is a WooCommerce 2.2+ instance (new Post Status)
14
  $post_status = ( function_exists( 'wc_get_order_statuses' ) ? apply_filters( 'woo_ce_order_post_status', array_keys( wc_get_order_statuses() ) ) : 'any' );
15
  else
16
  $post_status = apply_filters( 'woo_ce_order_post_status', woo_ce_post_statuses() );
17
+ // Check if the existing Transient exists
18
+ $cached = get_transient( WOO_CE_PREFIX . '_order_count' );
19
+ if( $cached == false ) {
20
+ $args = array(
21
+ 'post_type' => $post_type,
22
+ 'posts_per_page' => 1,
23
+ 'post_status' => $post_status,
24
+ 'fields' => 'ids'
25
+ );
26
+ $count_query = new WP_Query( $args );
27
+ $count = $count_query->found_posts;
28
+ set_transient( WOO_CE_PREFIX . '_order_count', $count, HOUR_IN_SECONDS );
29
+ } else {
30
+ $count = $cached;
31
+ }
32
+ return $count;
33
 
34
+ }
35
  }
36
 
37
+ function woo_ce_order_dataset_args( $args, $export_type = '' ) {
38
+
39
+ // Check if we're dealing with the Order Export Type
40
+ if( $export_type <> 'order' )
41
+ return $args;
42
+
43
+ // Merge in the form data for this dataset
44
+ $defaults = array(
45
+ 'order_dates_filter' => ( isset( $_POST['order_dates_filter'] ) ? sanitize_text_field( $_POST['order_dates_filter'] ) : false )
46
+ );
47
+ $args = wp_parse_args( $args, $defaults );
48
+
49
+ // Save dataset export specific options
50
+ if( $args['order_dates_filter'] <> woo_ce_get_option( 'order_dates_filter' ) )
51
+ woo_ce_update_option( 'order_dates_filter', $args['order_dates_filter'] );
52
+
53
+ return $args;
54
+
55
+ }
56
+ add_filter( 'woo_ce_extend_dataset_args', 'woo_ce_order_dataset_args', 10, 2 );
57
 
58
  /* End of: WordPress Administration */
59
 
79
  );
80
  $fields[] = array(
81
  'name' => 'purchase_subtotal',
82
+ 'label' => __( 'Order Subtotal', 'woocommerce-exporter' ),
83
+ 'disabled' => 1
84
  );
85
  $fields[] = array(
86
  'name' => 'order_currency',
88
  );
89
  $fields[] = array(
90
  'name' => 'order_discount',
91
+ 'label' => __( 'Order Discount', 'woocommerce-exporter' ),
92
+ 'disabled' => 1
93
  );
94
  $fields[] = array(
95
  'name' => 'coupon_code',
96
+ 'label' => __( 'Coupon Code', 'woocommerce-exporter' ),
97
+ 'disabled' => 1
98
  );
99
  $fields[] = array(
100
  'name' => 'coupon_expiry_date',
101
+ 'label' => __( 'Coupon Expiry Date', 'woocommerce-exporter' ),
102
+ 'disabled' => 1
103
  );
104
  $fields[] = array(
105
  'name' => 'coupon_description',
106
+ 'label' => __( 'Coupon Description', 'woocommerce-exporter' ),
107
+ 'disabled' => 1
108
  );
109
  $fields[] = array(
110
  'name' => 'purchase_total_tax',
111
+ 'label' => __( 'Order Total Tax', 'woocommerce-exporter' ),
112
+ 'disabled' => 1
113
  );
114
  /*
115
  $fields[] = array(
119
  */
120
  $fields[] = array(
121
  'name' => 'order_subtotal_excl_tax',
122
+ 'label' => __( 'Order Subtotal Excl. Tax', 'woocommerce-exporter' ),
123
+ 'disabled' => 1
124
  );
125
  /*
126
  $fields[] = array(
130
  */
131
  $fields[] = array(
132
  'name' => 'order_sales_tax',
133
+ 'label' => __( 'Sales Tax Total', 'woocommerce-exporter' ),
134
+ 'disabled' => 1
135
  );
136
  $fields[] = array(
137
  'name' => 'order_shipping_tax',
138
+ 'label' => __( 'Shipping Tax Total', 'woocommerce-exporter' ),
139
+ 'disabled' => 1
140
  );
141
  $fields[] = array(
142
  'name' => 'shipping_incl_tax',
143
+ 'label' => __( 'Shipping Incl. Tax', 'woocommerce-exporter' ),
144
+ 'disabled' => 1
145
  );
146
  $fields[] = array(
147
  'name' => 'shipping_excl_tax',
148
+ 'label' => __( 'Shipping Excl. Tax', 'woocommerce-exporter' ),
149
+ 'disabled' => 1
150
  );
151
  $fields[] = array(
152
  'name' => 'refund_total',
153
+ 'label' => __( 'Refund Total', 'woocommerce-exporter' ),
154
+ 'disabled' => 1
155
  );
156
  $fields[] = array(
157
  'name' => 'refund_date',
158
+ 'label' => __( 'Refund Date', 'woocommerce-exporter' ),
159
+ 'disabled' => 1
160
  );
161
  $fields[] = array(
162
  'name' => 'order_tax_percentage',
163
+ 'label' => __( 'Order Tax Percentage', 'woocommerce-exporter' ),
164
+ 'disabled' => 1
165
  );
166
  $fields[] = array(
167
  'name' => 'payment_gateway_id',
181
  );
182
  $fields[] = array(
183
  'name' => 'shipping_cost',
184
+ 'label' => __( 'Shipping Cost', 'woocommerce-exporter' ),
185
+ 'disabled' => 1
186
  );
187
  $fields[] = array(
188
  'name' => 'shipping_weight_total',
189
+ 'label' => __( 'Shipping Weight', 'woocommerce-exporter' ),
190
+ 'disabled' => 1
191
  );
192
  $fields[] = array(
193
  'name' => 'payment_status',
195
  );
196
  $fields[] = array(
197
  'name' => 'post_status',
198
+ 'label' => __( 'Post Status', 'woocommerce-exporter' ),
199
+ 'disabled' => 1
200
  );
201
  $fields[] = array(
202
  'name' => 'order_key',
203
+ 'label' => __( 'Order Key', 'woocommerce-exporter' ),
204
+ 'disabled' => 1
205
  );
206
  $fields[] = array(
207
  'name' => 'transaction_id',
208
+ 'label' => __( 'Transaction ID', 'woocommerce-exporter' ),
209
+ 'disabled' => 1
210
  );
211
  $fields[] = array(
212
  'name' => 'created_via',
213
+ 'label' => __( 'Created Via', 'woocommerce-exporter' ),
214
+ 'disabled' => 1
215
  );
216
  $fields[] = array(
217
  'name' => 'cart_hash',
218
+ 'label' => __( 'Cart Hash', 'woocommerce-exporter' ),
219
+ 'disabled' => 1
220
  );
221
  $fields[] = array(
222
  'name' => 'purchase_date',
224
  );
225
  $fields[] = array(
226
  'name' => 'purchase_time',
227
+ 'label' => __( 'Order Time', 'woocommerce-exporter' ),
228
+ 'disabled' => 1
229
  );
230
  $fields[] = array(
231
  'name' => 'customer_message',
232
+ 'label' => __( 'Customer Message', 'woocommerce-exporter' ),
233
+ 'disabled' => 1
234
  );
235
  $fields[] = array(
236
  'name' => 'customer_notes',
237
+ 'label' => __( 'Customer Notes', 'woocommerce-exporter' ),
238
+ 'disabled' => 1
239
  );
240
  $fields[] = array(
241
  'name' => 'order_notes',
242
+ 'label' => __( 'Order Notes', 'woocommerce-exporter' ),
243
+ 'disabled' => 1
244
  );
245
  // PayPal
246
  $fields[] = array(
247
  'name' => 'paypal_payer_paypal_address',
248
  'label' => __( 'PayPal: Payer PayPal Address', 'woocommerce-exporter' ),
249
+ 'hover' => __( 'PayPal', 'woocommerce-exporter' ),
250
+ 'disabled' => 1
251
  );
252
  $fields[] = array(
253
  'name' => 'paypal_payer_first_name',
254
  'label' => __( 'PayPal: Payer first name', 'woocommerce-exporter' ),
255
+ 'hover' => __( 'PayPal', 'woocommerce-exporter' ),
256
+ 'disabled' => 1
257
  );
258
  $fields[] = array(
259
  'name' => 'paypal_payer_last_name',
260
  'label' => __( 'PayPal: Payer last name', 'woocommerce-exporter' ),
261
+ 'hover' => __( 'PayPal', 'woocommerce-exporter' ),
262
+ 'disabled' => 1
263
  );
264
  $fields[] = array(
265
  'name' => 'paypal_payment_type',
266
  'label' => __( 'PayPal: Payment type', 'woocommerce-exporter' ),
267
+ 'hover' => __( 'PayPal', 'woocommerce-exporter' ),
268
+ 'disabled' => 1
269
  );
270
  $fields[] = array(
271
  'name' => 'paypal_payment_status',
272
  'label' => __( 'PayPal: Payment status', 'woocommerce-exporter' ),
273
+ 'hover' => __( 'PayPal', 'woocommerce-exporter' ),
274
+ 'disabled' => 1
275
  );
276
 
277
  $fields[] = array(
278
  'name' => 'total_quantity',
279
+ 'label' => __( 'Total Quantity', 'woocommerce-exporter' ),
280
+ 'disabled' => 1
281
  );
282
  $fields[] = array(
283
  'name' => 'total_order_items',
284
+ 'label' => __( 'Total Order Items', 'woocommerce-exporter' ),
285
+ 'disabled' => 1
286
  );
287
  $fields[] = array(
288
  'name' => 'user_id',
289
+ 'label' => __( 'User ID', 'woocommerce-exporter' ),
290
+ 'disabled' => 1
291
  );
292
  $fields[] = array(
293
  'name' => 'user_name',
294
+ 'label' => __( 'Username', 'woocommerce-exporter' ),
295
+ 'disabled' => 1
296
  );
297
  $fields[] = array(
298
  'name' => 'user_role',
299
+ 'label' => __( 'User Role', 'woocommerce-exporter' ),
300
+ 'disabled' => 1
301
  );
302
  $fields[] = array(
303
  'name' => 'ip_address',
304
+ 'label' => __( 'Checkout IP Address', 'woocommerce-exporter' ),
305
+ 'disabled' => 1
306
  );
307
  $fields[] = array(
308
  'name' => 'browser_agent',
309
+ 'label' => __( 'Checkout Browser Agent', 'woocommerce-exporter' ),
310
+ 'disabled' => 1
311
  );
312
  $fields[] = array(
313
  'name' => 'has_downloads',
314
+ 'label' => __( 'Has Downloads', 'woocommerce-exporter' ),
315
+ 'disabled' => 1
316
  );
317
  $fields[] = array(
318
  'name' => 'has_downloaded',
319
+ 'label' => __( 'Has Downloaded', 'woocommerce-exporter' ),
320
+ 'disabled' => 1
321
  );
322
  $fields[] = array(
323
  'name' => 'billing_full_name',
324
+ 'label' => __( 'Billing: Full Name', 'woocommerce-exporter' ),
325
+ 'disabled' => 1
326
  );
327
  $fields[] = array(
328
  'name' => 'billing_first_name',
338
  );
339
  $fields[] = array(
340
  'name' => 'billing_address',
341
+ 'label' => __( 'Billing: Street Address (Full)', 'woocommerce-exporter' ),
342
+ 'disabled' => 1
343
  );
344
  $fields[] = array(
345
  'name' => 'billing_address_1',
363
  );
364
  $fields[] = array(
365
  'name' => 'billing_state_full',
366
+ 'label' => __( 'Billing: State', 'woocommerce-exporter' ),
367
+ 'disabled' => 1
368
  );
369
  $fields[] = array(
370
  'name' => 'billing_country',
372
  );
373
  $fields[] = array(
374
  'name' => 'billing_country_full',
375
+ 'label' => __( 'Billing: Country', 'woocommerce-exporter' ),
376
+ 'disabled' => 1
377
  );
378
  $fields[] = array(
379
  'name' => 'billing_phone',
380
+ 'label' => __( 'Billing: Phone Number', 'woocommerce-exporter' ),
381
+ 'disabled' => 1
382
  );
383
  $fields[] = array(
384
  'name' => 'billing_email',
385
+ 'label' => __( 'Billing: E-mail Address', 'woocommerce-exporter' ),
386
+ 'disabled' => 1
387
  );
388
  $fields[] = array(
389
  'name' => 'shipping_full_name',
390
+ 'label' => __( 'Shipping: Full Name', 'woocommerce-exporter' ),
391
+ 'disabled' => 1
392
  );
393
  $fields[] = array(
394
  'name' => 'shipping_first_name',
395
+ 'label' => __( 'Shipping: First Name', 'woocommerce-exporter' ),
396
+ 'disabled' => 1
397
  );
398
  $fields[] = array(
399
  'name' => 'shipping_last_name',
400
+ 'label' => __( 'Shipping: Last Name', 'woocommerce-exporter' ),
401
+ 'disabled' => 1
402
  );
403
  $fields[] = array(
404
  'name' => 'shipping_company',
405
+ 'label' => __( 'Shipping: Company', 'woocommerce-exporter' ),
406
+ 'disabled' => 1
407
  );
408
  $fields[] = array(
409
  'name' => 'shipping_address',
410
+ 'label' => __( 'Shipping: Street Address (Full)', 'woocommerce-exporter' ),
411
+ 'disabled' => 1
412
  );
413
  $fields[] = array(
414
  'name' => 'shipping_address_1',
415
+ 'label' => __( 'Shipping: Street Address 1', 'woocommerce-exporter' ),
416
+ 'disabled' => 1
417
  );
418
  $fields[] = array(
419
  'name' => 'shipping_address_2',
420
+ 'label' => __( 'Shipping: Street Address 2', 'woocommerce-exporter' ),
421
+ 'disabled' => 1
422
  );
423
  $fields[] = array(
424
  'name' => 'shipping_city',
425
+ 'label' => __( 'Shipping: City', 'woocommerce-exporter' ),
426
+ 'disabled' => 1
427
  );
428
  $fields[] = array(
429
  'name' => 'shipping_postcode',
430
+ 'label' => __( 'Shipping: ZIP Code', 'woocommerce-exporter' ),
431
+ 'disabled' => 1
432
  );
433
  $fields[] = array(
434
  'name' => 'shipping_state',
435
+ 'label' => __( 'Shipping: State (prefix)', 'woocommerce-exporter' ),
436
+ 'disabled' => 1
437
  );
438
  $fields[] = array(
439
  'name' => 'shipping_state_full',
440
+ 'label' => __( 'Shipping: State', 'woocommerce-exporter' ),
441
+ 'disabled' => 1
442
  );
443
  $fields[] = array(
444
  'name' => 'shipping_country',
445
+ 'label' => __( 'Shipping: Country (prefix)', 'woocommerce-exporter' ),
446
+ 'disabled' => 1
447
  );
448
  $fields[] = array(
449
  'name' => 'shipping_country_full',
450
+ 'label' => __( 'Shipping: Country', 'woocommerce-exporter' ),
451
+ 'disabled' => 1
452
  );
453
 
454
  /*
473
  );
474
  $fields[] = array(
475
  'name' => 'order_items_product_id',
476
+ 'label' => __( 'Order Items: Product ID', 'woocommerce-exporter' ),
477
+ 'disabled' => 1
478
  );
479
  $fields[] = array(
480
  'name' => 'order_items_variation_id',
481
+ 'label' => __( 'Order Items: Variation ID', 'woocommerce-exporter' ),
482
+ 'disabled' => 1
483
  );
484
  $fields[] = array(
485
  'name' => 'order_items_sku',
486
+ 'label' => __( 'Order Items: SKU', 'woocommerce-exporter' ),
487
+ 'disabled' => 1
488
  );
489
  $fields[] = array(
490
  'name' => 'order_items_name',
492
  );
493
  $fields[] = array(
494
  'name' => 'order_items_variation',
495
+ 'label' => __( 'Order Items: Product Variation', 'woocommerce-exporter' ),
496
+ 'disabled' => 1
497
  );
498
  $fields[] = array(
499
  'name' => 'order_items_image_embed',
500
+ 'label' => __( 'Order Items: Featured Image (Embed)', 'woocommerce-exporter' ),
501
+ 'disabled' => 1
502
  );
503
  $fields[] = array(
504
  'name' => 'order_items_description',
505
+ 'label' => __( 'Order Items: Product Description', 'woocommerce-exporter' ),
506
+ 'disabled' => 1
507
  );
508
  $fields[] = array(
509
  'name' => 'order_items_excerpt',
510
+ 'label' => __( 'Order Items: Product Excerpt', 'woocommerce-exporter' ),
511
+ 'disabled' => 1
512
  );
513
  $fields[] = array(
514
  'name' => 'order_items_publish_date',
515
+ 'label' => __( 'Order Items: Publish Date', 'woocommerce-exporter' ),
516
+ 'disabled' => 1
517
  );
518
  $fields[] = array(
519
  'name' => 'order_items_modified_date',
520
+ 'label' => __( 'Order Items: Modified Date', 'woocommerce-exporter' ),
521
+ 'disabled' => 1
522
  );
523
  $fields[] = array(
524
  'name' => 'order_items_tax_class',
525
+ 'label' => __( 'Order Items: Tax Class', 'woocommerce-exporter' ),
526
+ 'disabled' => 1
527
  );
528
  $fields[] = array(
529
  'name' => 'order_items_quantity',
535
  );
536
  $fields[] = array(
537
  'name' => 'order_items_subtotal',
538
+ 'label' => __( 'Order Items: Subtotal', 'woocommerce-exporter' ),
539
+ 'disabled' => 1
540
  );
541
  $fields[] = array(
542
  'name' => 'order_items_rrp',
543
+ 'label' => __( 'Order Items: RRP', 'woocommerce-exporter' ),
544
+ 'disabled' => 1
545
  );
546
  $fields[] = array(
547
  'name' => 'order_items_stock',
548
+ 'label' => __( 'Order Items: Stock', 'woocommerce-exporter' ),
549
+ 'disabled' => 1
550
  );
551
  $fields[] = array(
552
  'name' => 'order_items_shipping_class',
553
+ 'label' => __( 'Order Items: Shipping Class', 'woocommerce-exporter' ),
554
+ 'disabled' => 1
555
  );
556
  $fields[] = array(
557
  'name' => 'order_items_tax',
558
+ 'label' => __( 'Order Items: Tax', 'woocommerce-exporter' ),
559
+ 'disabled' => 1
560
  );
561
  $fields[] = array(
562
  'name' => 'order_items_tax_percentage',
563
+ 'label' => __( 'Order Items: Tax Percentage', 'woocommerce-exporter' ),
564
+ 'disabled' => 1
565
  );
566
  $fields[] = array(
567
  'name' => 'order_items_tax_subtotal',
568
+ 'label' => __( 'Order Items: Tax Subtotal', 'woocommerce-exporter' ),
569
+ 'disabled' => 1
570
  );
571
  // Order Item: Tax Rate - ...
572
  $tax_rates = woo_ce_get_order_tax_rates();
574
  foreach( $tax_rates as $tax_rate ) {
575
  $fields[] = array(
576
  'name' => sprintf( 'order_items_tax_rate_%d', $tax_rate['rate_id'] ),
577
+ 'label' => sprintf( __( 'Order Items: Tax Rate - %s', 'woocommerce-exporter' ), $tax_rate['label'] ),
578
+ 'disabled' => 1
579
  );
580
  }
581
  }
582
  unset( $tax_rates, $tax_rate );
583
  $fields[] = array(
584
  'name' => 'order_items_refund_subtotal',
585
+ 'label' => __( 'Order Items: Refund Subtotal', 'woocommerce-exporter' ),
586
+ 'disabled' => 1
587
  );
588
  $fields[] = array(
589
  'name' => 'order_items_refund_quantity',
590
+ 'label' => __( 'Order Items: Refund Quantity', 'woocommerce-exporter' ),
591
+ 'disabled' => 1
592
  );
593
  $fields[] = array(
594
  'name' => 'order_items_type',
595
+ 'label' => __( 'Order Items: Type', 'woocommerce-exporter' ),
596
+ 'disabled' => 1
597
  );
598
  $fields[] = array(
599
  'name' => 'order_items_type_id',
600
+ 'label' => __( 'Order Items: Type ID', 'woocommerce-exporter' ),
601
+ 'disabled' => 1
602
  );
603
  $fields[] = array(
604
  'name' => 'order_items_category',
605
+ 'label' => __( 'Order Items: Category', 'woocommerce-exporter' ),
606
+ 'disabled' => 1
607
  );
608
  $fields[] = array(
609
  'name' => 'order_items_tag',
610
+ 'label' => __( 'Order Items: Tag', 'woocommerce-exporter' ),
611
+ 'disabled' => 1
612
  );
613
  $fields[] = array(
614
  'name' => 'order_items_total_sales',
615
+ 'label' => __( 'Order Items: Total Sales', 'woocommerce-exporter' ),
616
+ 'disabled' => 1
617
  );
618
  $fields[] = array(
619
  'name' => 'order_items_weight',
620
+ 'label' => __( 'Order Items: Weight', 'woocommerce-exporter' ),
621
+ 'disabled' => 1
622
  );
623
  $fields[] = array(
624
  'name' => 'order_items_height',
625
+ 'label' => __( 'Order Items: Height', 'woocommerce-exporter' ),
626
+ 'disabled' => 1
627
  );
628
  $fields[] = array(
629
  'name' => 'order_items_width',
630
+ 'label' => __( 'Order Items: Width', 'woocommerce-exporter' ),
631
+ 'disabled' => 1
632
  );
633
  $fields[] = array(
634
  'name' => 'order_items_length',
635
+ 'label' => __( 'Order Items: Length', 'woocommerce-exporter' ),
636
+ 'disabled' => 1
637
  );
638
  $fields[] = array(
639
  'name' => 'order_items_total_weight',
640
+ 'label' => __( 'Order Items: Total Weight', 'woocommerce-exporter' ),
641
+ 'disabled' => 1
642
  );
643
 
644
  // Drop in our content filters here
657
  $output = array();
658
  $size = count( $fields );
659
  for( $i = 0; $i < $size; $i++ ) {
660
+ if( isset( $fields[$i] ) ) {
661
+ if( !isset( $fields[$i]['disabled'] ) )
662
+ $output[$fields[$i]['name']] = 'on';
663
+ }
664
  }
665
  return $output;
666
  break;
692
  // Check if we should override field labels from the Field Editor
693
  function woo_ce_override_order_field_labels( $fields = array() ) {
694
 
695
+ $export_type = 'order';
696
+
697
+ $labels = false;
698
+
699
+ // Default to Quick Export labels
700
+ if( empty( $labels ) )
701
+ $labels = woo_ce_get_option( sprintf( '%s_labels', $export_type ), array() );
702
+
703
  if( !empty( $labels ) ) {
704
  foreach( $fields as $key => $field ) {
705
  if( isset( $labels[$field['name']] ) )
712
  add_filter( 'woo_ce_order_fields', 'woo_ce_override_order_field_labels', 11 );
713
  add_filter( 'woo_ce_order_items_fields', 'woo_ce_override_order_field_labels', 11 );
714
 
715
+ // Returns the export column header label based on an export column slug
716
+ function woo_ce_get_order_field( $name = null, $format = 'name' ) {
717
 
718
+ $output = '';
719
+ if( $name ) {
720
+ $fields = woo_ce_get_order_fields();
721
+ $size = count( $fields );
722
+ for( $i = 0; $i < $size; $i++ ) {
723
+ if( $fields[$i]['name'] == $name ) {
724
+ switch( $format ) {
725
+
726
+ case 'name':
727
+ $output = $fields[$i]['label'];
728
+ break;
729
+
730
+ case 'full':
731
+ $output = $fields[$i];
732
+ break;
733
+
734
+ }
735
+ $i = $size;
736
+ }
737
+ }
738
+ }
739
+ return $output;
740
+
741
+ }
742
+
743
+ // Returns a list of Order IDs
744
+ function woo_ce_get_orders( $export_type = 'order', $args = array() ) {
745
+
746
+ global $export;
747
+
748
+ $limit_volume = -1;
749
+ $offset = 0;
750
+
751
+ if( $args ) {
752
+ $limit_volume = ( isset( $args['limit_volume'] ) ? $args['limit_volume'] : false );
753
+ $offset = $args['offset'];
754
+ $orderby = ( isset( $args['order_orderby'] ) ? $args['order_orderby'] : 'ID' );
755
+ $order = ( isset( $args['order_order'] ) ? $args['order_order'] : 'ASC' );
756
+ $order_dates_filter = ( isset( $args['order_dates_filter'] ) ? $args['order_dates_filter'] : false );
757
+ if( empty( $order_dates_filter ) )
758
+ $order_dates_filter = 'current_week';
759
+ switch( $order_dates_filter ) {
760
+
761
+ case 'today':
762
+ $order_dates_from = woo_ce_get_order_date_filter( 'today', 'from' );
763
+ $order_dates_to = woo_ce_get_order_date_filter( 'today', 'to' );
764
+ break;
765
+
766
+ case 'yesterday':
767
+ $order_dates_from = woo_ce_get_order_date_filter( 'yesterday', 'from' );
768
+ $order_dates_to = woo_ce_get_order_date_filter( 'yesterday', 'to' );
769
+ break;
770
+
771
+ case 'current_week':
772
+ $order_dates_from = woo_ce_get_order_date_filter( 'current_week', 'from' );
773
+ $order_dates_to = woo_ce_get_order_date_filter( 'current_week', 'to' );
774
+ break;
775
+
776
+ case 'last_week':
777
+ $order_dates_from = woo_ce_get_order_date_filter( 'last_week', 'from' );
778
+ $order_dates_to = woo_ce_get_order_date_filter( 'last_week', 'to' );
779
+ break;
780
+
781
+ default:
782
+ $order_dates_from = false;
783
+ $order_dates_to = false;
784
+ break;
785
+
786
+ }
787
+ if( !empty( $order_dates_from ) && !empty( $order_dates_to ) ) {
788
+ // From
789
+ $order_dates_from = explode( '-', $order_dates_from );
790
+ // Check that a valid date was provided
791
+ if( isset( $order_dates_from[0] ) && isset( $order_dates_from[1] ) && isset( $order_dates_from[2] ) ) {
792
+ $order_dates_from = array(
793
+ 'year' => absint( $order_dates_from[2] ),
794
+ 'month' => absint( $order_dates_from[1] ),
795
+ 'day' => absint( $order_dates_from[0] ),
796
+ 'hour' => ( isset( $order_dates_from[3] ) ? $order_dates_from[3] : 0 ),
797
+ 'minute' => ( isset( $order_dates_from[4] ) ? $order_dates_from[4] : 0 ),
798
+ 'second' => ( isset( $order_dates_from[5] ) ? $order_dates_from[5] : 0 )
799
+ );
800
+ } else {
801
+ $order_dates_from = false;
802
+ }
803
+ // To
804
+ $order_dates_to = explode( '-', $order_dates_to );
805
+ // Check that a valid date was provided
806
+ if( isset( $order_dates_to[0] ) && isset( $order_dates_to[1] ) && isset( $order_dates_to[2] ) ) {
807
+ $order_dates_to = array(
808
+ 'year' => absint( $order_dates_to[2] ),
809
+ 'month' => absint( $order_dates_to[1] ),
810
+ 'day' => absint( $order_dates_to[0] ),
811
+ 'hour' => ( isset( $order_dates_to[3] ) ? $order_dates_to[3] : 23 ),
812
+ 'minute' => ( isset( $order_dates_to[4] ) ? $order_dates_to[4] : 59 ),
813
+ 'second' => ( isset( $order_dates_to[5] ) ? $order_dates_to[5] : 59 )
814
+ );
815
+ } else {
816
+ $order_dates_to = false;
817
+ }
818
+ }
819
+ }
820
+ $post_type = 'shop_order';
821
+ $args = array(
822
+ 'post_type' => $post_type,
823
+ 'orderby' => $orderby,
824
+ 'order' => $order,
825
+ 'offset' => $offset,
826
+ 'posts_per_page' => $limit_volume,
827
+ 'fields' => 'ids',
828
+ 'suppress_filters' => false
829
+ );
830
+ $woocommerce_version = woo_get_woo_version();
831
+ // Check if this is a pre-WooCommerce 2.2 instance
832
+ if( version_compare( $woocommerce_version, '2.2' ) >= 0 )
833
+ $args['post_status'] = ( function_exists( 'wc_get_order_statuses' ) ? apply_filters( 'woo_ce_order_post_status', array_keys( wc_get_order_statuses() ) ) : 'any' );
834
+ else
835
+ $args['post_status'] = apply_filters( 'woo_ce_order_post_status', 'publish' );
836
+
837
+ // Filter Order dates
838
+ if( !empty( $order_dates_from ) && !empty( $order_dates_to ) ) {
839
+ $args['date_query'] = array(
840
+ array(
841
+ 'column' => apply_filters( 'woo_ce_get_orders_filter_order_dates_column', 'post_date' ),
842
+ 'before' => $order_dates_to,
843
+ 'after' => $order_dates_from,
844
+ 'inclusive' => true
845
+ )
846
+ );
847
+ }
848
+
849
+ $orders = array();
850
+
851
+ $order_ids = new WP_Query( $args );
852
+
853
+ if( $order_ids->posts ) {
854
+
855
+ foreach( $order_ids->posts as $order_id ) {
856
+
857
+ // Check that a WP_Post didn't sneak through...
858
+ if( is_object( $order_id ) )
859
+ $order_id = ( isset( $order_id->ID ) ? absint( $order_id->ID ) : $order_id );
860
+
861
+ $order_id = apply_filters( 'woo_ce_get_order_id', $order_id );
862
+ if( $order_id )
863
+ $orders[] = $order_id;
864
+
865
+ }
866
+
867
+ // Only populate the $export Global if it is an export
868
+ if( isset( $export ) ) {
869
+ $export->total_rows = count( $orders );
870
+ }
871
+ unset( $order_ids, $order_id );
872
+
873
+ }
874
+ return $orders;
875
+
876
+ }
877
+
878
+ // Returns WooCommerce Order data associated to a specific Order
879
+ function woo_ce_get_order_wc_data( $order_id = 0 ) {
880
 
 
 
881
  if( !empty( $order_id ) ) {
882
+ if( version_compare( woo_get_woo_version(), '2.7', '>=' ) ) {
883
+ $order = ( class_exists( 'WC_Order' ) ? new WC_Order( $order_id ) : get_post( $order_id ) );
884
+ $order->status = ( method_exists( $order, 'get_status' ) ? $order->get_status() : false );
885
+ $order->order_date = ( method_exists( $order, 'get_date_created' ) ? $order->get_date_created() : false );
886
+ } else {
887
+ $order = ( class_exists( 'WC_Order' ) ? new WC_Order( $order_id ) : get_post( $order_id ) );
888
+ }
889
+ return $order;
890
  }
891
+
892
+ }
893
+
894
+ function woo_ce_get_order_data( $order_id = 0, $export_type = 'order', $args = array(), $fields = array() ) {
895
+
896
+ global $export;
897
+
898
+ // Check if this is a pre-WooCommerce 2.2 instance
899
+ $woocommerce_version = woo_get_woo_version();
900
+
901
+ $defaults = array(
902
+ 'order_items' => 'combined',
903
+ 'order_items_types' => array_keys( woo_ce_get_order_items_types() )
904
+ );
905
+ $args = wp_parse_args( $args, $defaults );
906
+
907
+ // Get WooCommerce Order details
908
+ $order = woo_ce_get_order_wc_data( $order_id );
909
+
910
+ $date_format = woo_ce_get_option( 'date_format', 'd/m/Y' );
911
+
912
+ $order->payment_status = $order->status;
913
+
914
+ $order->purchase_total = get_post_meta( $order_id, '_order_total', true );
915
+ $order->order_currency = get_post_meta( $order_id, '_order_currency', true );
916
+
917
+ // Order billing details
918
+ if( !apply_filters( 'woo_ce_get_order_data_legacy_billing_address', version_compare( $woocommerce_version, '3.0', '<' ) ) ) {
919
+ // WC: 3.0+ Order billing address
920
+ $billing_address = $order->get_address( 'billing' );
921
+ if( !empty( $billing_address ) ) {
922
+ $order->billing_first_name = $billing_address['first_name'];
923
+ $order->billing_last_name = $billing_address['last_name'];
924
+ $order->billing_company = $billing_address['company'];
925
+ $order->billing_address_1 = $billing_address['address_1'];
926
+ $order->billing_address_2 = $billing_address['address_2'];
927
+ $order->billing_city = $billing_address['city'];
928
+ $order->billing_postcode = $billing_address['postcode'];
929
+ $order->billing_state = $billing_address['state'];
930
+ $order->billing_country = $billing_address['country'];
931
+ }
932
+ unset( $billing_address );
933
+ } else {
934
+ // WC: Pre-3.0 Order billing address
935
+ $order->billing_first_name = get_post_meta( $order_id, '_billing_first_name', true );
936
+ $order->billing_last_name = get_post_meta( $order_id, '_billing_last_name', true );
937
+ $order->billing_company = get_post_meta( $order_id, '_billing_company', true );
938
+ $order->billing_address_1 = get_post_meta( $order_id, '_billing_address_1', true );
939
+ $order->billing_address_2 = get_post_meta( $order_id, '_billing_address_2', true );
940
+ $order->billing_city = get_post_meta( $order_id, '_billing_city', true );
941
+ $order->billing_postcode = get_post_meta( $order_id, '_billing_postcode', true );
942
+ $order->billing_state = get_post_meta( $order_id, '_billing_state', true );
943
+ $order->billing_country = get_post_meta( $order_id, '_billing_country', true );
944
+ }
945
+
946
+ if( $export_type == 'order' ) {
947
+
948
+ $order->payment_gateway_id = get_post_meta( $order_id, '_payment_method', true );
949
+ $order->payment_gateway = woo_ce_format_order_payment_gateway( $order->payment_gateway_id );
950
+ // WooCommerce 2.1+ stores the shipping method in Order Items, includes fallback support
951
+ if( version_compare( woo_get_woo_version(), '2.1', '>=' ) ) {
952
+ $order->shipping_method_id = woo_ce_get_order_assoc_shipping_method_id( $order_id );
953
+ $order->shipping_method = $order->get_shipping_method();
954
+ } else {
955
+ $order->shipping_method_id = woo_ce_get_order_assoc_shipping_method_id( $order_id );
956
+ $order->shipping_method = '';
957
+ }
958
+ $order->purchase_date = ( function_exists( 'wc_format_datetime' ) ? wc_format_datetime( $order->order_date, $date_format ) : woo_ce_format_date( $order->order_date ) );
959
+
960
+ if( $order->order_items = woo_ce_get_order_items( $order_id, $args['order_items_types'] ) ) {
961
+ $order->total_order_items = count( $order->order_items );
962
+ if( $args['order_items'] == 'combined' ) {
963
+ $order->order_items_id = '';
964
+ $order->order_items_name = '';
965
+ $order->order_items_quantity = '';
966
+ $order->order_items_total = '';
967
+ if( !empty( $order->order_items ) ) {
968
+ foreach( $order->order_items as $order_item ) {
969
+ $order->order_items_id .= $order_item->id . $export->category_separator;
970
+ $order->order_items_name .= $order_item->name . $export->category_separator;
971
+ if( empty( $order_item->quantity ) && '0' != $order_item->quantity )
972
+ $order_item->quantity = '';
973
+ $order->order_items_quantity .= $order_item->quantity . $export->category_separator;
974
+ $order->order_items_total .= $order_item->total . $export->category_separator;
975
+ }
976
+ $order->order_items_id = substr( $order->order_items_id, 0, -1 );
977
+ $order->order_items_name = substr( $order->order_items_name, 0, -1 );
978
+ $order->order_items_quantity = substr( $order->order_items_quantity, 0, -1 );
979
+ $order->order_items_total = substr( $order->order_items_total, 0, -1 );
980
+ }
981
+ }
982
  }
983
+
984
+ }
985
+
986
+ return $order;
987
+
988
+ }
989
+
990
+ function woo_ce_export_dataset_override_order( $output = null, $export_type = null ) {
991
+
992
+ global $export;
993
+
994
+ if( $orders = woo_ce_get_orders( 'order', $export->args ) ) {
995
+ $separator = $export->delimiter;
996
+ $size = $export->total_columns;
997
+ $export->total_rows = count( $orders );
998
+ // Generate the export headers
999
+ if( in_array( $export->export_format, array( 'csv' ) ) ) {
1000
+ for( $i = 0; $i < $size; $i++ ) {
1001
+ if( $i == ( $size - 1 ) )
1002
+ $output .= woo_ce_escape_csv_value( $export->columns[$i], $export->delimiter, $export->escape_formatting ) . "\n";
1003
+ else
1004
+ $output .= woo_ce_escape_csv_value( $export->columns[$i], $export->delimiter, $export->escape_formatting ) . $separator;
1005
+ }
1006
+ }
1007
+ if( !empty( $export->fields ) ) {
1008
+ foreach( $orders as $order ) {
1009
+
1010
+ $order = woo_ce_get_order_data( $order, 'order', $export->args, array_keys( $export->fields ) );
1011
+ foreach( $export->fields as $key => $field ) {
1012
+ if( isset( $order->$key ) ) {
1013
+ if( is_array( $field ) ) {
1014
+ foreach( $field as $array_key => $array_value ) {
1015
+ if( !is_array( $array_value ) ) {
1016
+ if( in_array( $export->export_format, array( 'csv' ) ) )
1017
+ $output .= woo_ce_escape_csv_value( $array_value, $export->delimiter, $export->escape_formatting );
1018
+ }
1019
+ }
1020
+ } else {
1021
+ if( in_array( $export->export_format, array( 'csv' ) ) )
1022
+ $output .= woo_ce_escape_csv_value( $order->$key, $export->delimiter, $export->escape_formatting );
1023
+ }
1024
+ }
1025
+ if( in_array( $export->export_format, array( 'csv' ) ) )
1026
+ $output .= $separator;
1027
+ }
1028
+
1029
+ if( in_array( $export->export_format, array( 'csv' ) ) )
1030
+ $output = substr( $output, 0, -1 ) . "\n";
1031
+ }
1032
+ }
1033
+ unset( $orders, $order );
1034
+ }
1035
+ return $output;
1036
+
1037
+ }
1038
+
1039
+ // Returns a list of WooCommerce Tax Rates based on existing Orders
1040
+ function woo_ce_get_order_tax_rates( $order_id = 0 ) {
1041
+
1042
+ if( apply_filters( 'woo_ce_enable_order_tax_rates', true ) ) {
1043
+
1044
+ global $wpdb;
1045
+
1046
+ $order_item_type = 'tax';
1047
+ $tax_rates_sql = $wpdb->prepare( "SELECT order_items.order_item_id as item_id FROM " . $wpdb->prefix . "woocommerce_order_items as order_items WHERE order_items.order_item_type = %s", $order_item_type );
1048
+ if( !empty( $order_id ) ) {
1049
+ $tax_rates_sql .= $wpdb->prepare( " AND order_items.order_id = %d", $order_id );
1050
+ }
1051
+ $tax_rates_sql .= " GROUP BY order_items.order_item_name";
1052
+ $tax_rates = $wpdb->get_results( $tax_rates_sql, 'ARRAY_A' );
1053
+ if( !empty( $tax_rates ) ) {
1054
+ $meta_type = 'order_item';
1055
+ foreach( $tax_rates as $key => $tax_rate ) {
1056
+ $tax_rates[$key]['rate_id'] = get_metadata( $meta_type, $tax_rate['item_id'], 'rate_id', true );
1057
+ $tax_rates[$key]['label'] = get_metadata( $meta_type, $tax_rate['item_id'], 'label', true );
1058
+ }
1059
+ return $tax_rates;
1060
+ }
1061
+
1062
  }
1063
 
1064
  }
1130
 
1131
  }
1132
 
1133
+ // Return the PHP date format for the requested Order Date filter
1134
+ function woo_ce_get_order_date_filter( $filter = '', $format = '', $date_format = 'd-m-Y' ) {
1135
+
1136
+ $output = false;
1137
+ if( !empty( $filter ) && !empty( $format ) ) {
1138
+ switch( $filter ) {
1139
+
1140
+ // Today
1141
+ case 'today':
1142
+ if( $format == 'from' )
1143
+ $output = date( $date_format, strtotime( 'today' ) );
1144
+ else
1145
+ $output = date( $date_format, strtotime( 'tomorrow' ) );
1146
+ break;
1147
+
1148
+ // Yesterday
1149
+ case 'yesterday':
1150
+ if( $format == 'from' )
1151
+ $output = date( $date_format, strtotime( 'yesterday' ) );
1152
+ else
1153
+ $output = date( $date_format, strtotime( 'yesterday' ) );
1154
+ break;
1155
+
1156
+ // This week
1157
+ case 'current_week':
1158
+ if( $format == 'from' )
1159
+ $output = date( $date_format, strtotime( 'last Monday' ) );
1160
+ else
1161
+ $output = date( $date_format, strtotime( 'next Monday' ) );
1162
+ break;
1163
+
1164
+ // Last week
1165
+ case 'last_week':
1166
+ if( $format == 'from' )
1167
+ $output = date( $date_format, strtotime( '-2 weeks Monday' ) );
1168
+ else
1169
+ $output = date( $date_format, strtotime( '-1 weeks Monday' ) );
1170
+ break;
1171
+
1172
+ /*
1173
+ case '':
1174
+ if( $format == 'from' )
1175
+ $output = ;
1176
+ else
1177
+ $output = ;
1178
+ break;
1179
+ */
1180
+
1181
+ default:
1182
+ woo_ce_error_log( sprintf( 'Warning: %s', sprintf( __( 'Unknown Order Date filter %s provided, defaulted to none', 'woocommerce-exporter' ), $filter ) ) );
1183
+ break;
1184
+
1185
+ }
1186
+ }
1187
+ return $output;
1188
+
1189
+ }
1190
+
1191
+ // Returns date of first Order received, any status
1192
+ function woo_ce_get_order_first_date( $date_format = 'd/m/Y' ) {
1193
+
1194
+ $output = date( $date_format, mktime( 0, 0, 0, date( 'n' ), 1 ) );
1195
+
1196
+ $post_type = 'shop_order';
1197
+ $args = array(
1198
+ 'post_type' => $post_type,
1199
+ 'orderby' => 'post_date',
1200
+ 'order' => 'ASC',
1201
+ 'numberposts' => 1,
1202
+ 'post_status' => 'any'
1203
+ );
1204
+ $orders = get_posts( $args );
1205
+ if( !empty( $orders ) ) {
1206
+ $output = date( $date_format, strtotime( $orders[0]->post_date ) );
1207
+ unset( $orders );
1208
+ }
1209
+ return $output;
1210
+
1211
+ }
1212
+
1213
  // Returns a list of WooCommerce Order statuses
1214
  function woo_ce_get_order_statuses() {
1215
 
1216
  $terms = false;
1217
+
1218
+ // Check if the existing Transient exists
1219
+ $cached = get_transient( WOO_CE_PREFIX . '_order_statuses' );
1220
+ if( $cached == false ) {
1221
+
1222
+ // Check if this is a WooCommerce 2.2+ instance (new Post Status)
1223
+ $woocommerce_version = woo_get_woo_version();
1224
+ if( version_compare( $woocommerce_version, '2.2' ) >= 0 ) {
1225
+ // Convert Order Status array into our magic sauce
1226
+ $order_statuses = ( function_exists( 'wc_get_order_statuses' ) ? wc_get_order_statuses() : false );
1227
+ if( !empty( $order_statuses ) ) {
1228
+ $terms = array();
1229
+ $post_type = 'shop_order';
1230
+ $posts_count = wp_count_posts( $post_type );
1231
+ foreach( $order_statuses as $key => $order_status ) {
1232
+ $terms[] = (object)array(
1233
+ 'name' => $order_status,
1234
+ 'slug' => $key,
1235
+ 'count' => ( isset( $posts_count->$key ) ? $posts_count->$key : 0 )
1236
+ );
1237
+ }
1238
  }
1239
+ } else {
1240
+ $args = array(
1241
+ 'hide_empty' => false
1242
+ );
1243
+ $terms = get_terms( 'shop_order_status', $args );
1244
+ if( empty( $terms ) || ( is_wp_error( $terms ) == true ) )
1245
+ $terms = array();
1246
  }
1247
+ set_transient( WOO_CE_PREFIX . '_order_statuses', $terms, HOUR_IN_SECONDS );
1248
+
1249
  } else {
1250
+ $terms = $cached;
 
 
 
 
 
1251
  }
1252
  return $terms;
1253
 
1254
  }
1255
 
1256
+ // Returns the Shipping Method ID associated to a specific Order
1257
+ function woo_ce_get_order_assoc_shipping_method_id( $order_id = 0 ) {
1258
+
1259
+ if( empty( $order_id ) )
1260
+ return false;
1261
+
1262
+ if( class_exists( 'WC_Order' ) ) {
1263
+ $output = '';
1264
+ $order = new WC_Order( $order_id );
1265
+ if( method_exists( 'WC_Order', 'get_shipping_methods' ) ) {
1266
+ if( $shipping_methods = $order->get_shipping_methods() ) {
1267
+ foreach( $shipping_methods as $shipping_item_id => $shipping_item ) {
1268
+ if( isset( $shipping_item['method_id'] ) ) {
1269
+ $output = $shipping_item['method_id'];
1270
+ }
1271
+ if( empty( $output ) && isset( $shipping_item['item_meta'] ) ) {
1272
+ $output = ( isset( $shipping_item['item_meta']['method_id'] ) ? $shipping_item['item_meta']['method_id'] : false );
1273
+ if( is_array( $output ) )
1274
+ $output = ( isset( $output[0] ) ? $output[0] : false );
1275
+ break;
1276
+ }
1277
+ // Check if a value has been set
1278
+ if( !empty( $output ) )
1279
+ break;
1280
+ }
1281
+ }
1282
+ unset( $shipping_methods );
1283
+ } else {
1284
+ $output = get_post_meta( $order_id, '_shipping_method', true );
1285
+ if( is_array( $output ) )
1286
+ $output = ( isset( $output[0] ) ? $output[0] : false );
1287
+ }
1288
+ unset( $order );
1289
+ return apply_filters( 'woo_ce_get_order_assoc_shipping_method_id', $output );
1290
+ }
1291
+
1292
+ }
1293
+
1294
+ // Returns a list of Order Items for a specified Order
1295
+ function woo_ce_get_order_items( $order_id = 0, $order_items_types = array() ) {
1296
+
1297
+ global $export, $wpdb;
1298
+
1299
+ $upload_dir = wp_upload_dir();
1300
+
1301
+ if( !empty( $order_id ) ) {
1302
+ $order_items_sql = $wpdb->prepare( "SELECT `order_item_id` as id, `order_item_name` as name, `order_item_type` as type FROM `" . $wpdb->prefix . "woocommerce_order_items` WHERE `order_id` = %d", $order_id );
1303
+
1304
+ if( $order_items = $wpdb->get_results( $order_items_sql ) ) {
1305
+ $wpdb->flush();
1306
+
1307
+ // Default to Line Item for empty Order Item types
1308
+ if( empty( $order_items_types ) )
1309
+ $order_items_types = array( 'line_item' );
1310
+ foreach( $order_items as $key => $order_item ) {
1311
+
1312
+ // Fetch all meta keys linked to an Order Item
1313
+ $order_item_meta_sql = $wpdb->prepare( "SELECT `meta_key`, `meta_value` FROM `" . $wpdb->prefix . "woocommerce_order_itemmeta` WHERE `order_item_id` = %d ORDER BY meta_key ASC", $order_item->id );
1314
+ if( $order_item_meta = $wpdb->get_results( $order_item_meta_sql ) ) {
1315
+ $order_items[$key]->quantity = '';
1316
+ $order_items[$key]->total = '';
1317
+ $size = count( $order_item_meta );
1318
+ for( $i = 0; $i < $size; $i++ ) {
1319
+
1320
+ // Go through each Order Item meta found
1321
+ switch( $order_item_meta[$i]->meta_key ) {
1322
+
1323
+ case '_qty':
1324
+ $order_items[$key]->quantity = $order_item_meta[$i]->meta_value;
1325
+ break;
1326
+
1327
+ case '_product_id':
1328
+ break;
1329
+
1330
+ case '_variation_id':
1331
+ break;
1332
+ case '_line_total':
1333
+ $order_items[$key]->total = woo_ce_format_price( $order_item_meta[$i]->meta_value );
1334
+ break;
1335
+
1336
+ }
1337
+ }
1338
+ }
1339
+ unset( $order_item_meta );
1340
+
1341
+ // Default the quantity to 1 for the Fee Order Item Type
1342
+ if( $order_items[$key]->type == 'fee' )
1343
+ $order_items[$key]->quantity = 1;
1344
+
1345
+ }
1346
+
1347
+ return $order_items;
1348
+
1349
+ }
1350
+ }
1351
+
1352
+ }
1353
+
1354
  // Returns a list of WooCommerce Order Item Types
1355
  function woo_ce_get_order_items_types() {
1356
 
1366
  $order_item_types = apply_filters( 'woo_ce_order_item_types', $order_item_types );
1367
 
1368
  return $order_item_types;
1369
+
1370
+ }
1371
+
1372
+ function woo_ce_get_order_payment_gateways() {
1373
+
1374
+ global $woocommerce;
1375
+
1376
+ $output = false;
1377
+
1378
+ // Test that payment gateways exist with WooCommerce 1.6 compatibility
1379
+ if( version_compare( $woocommerce->version, '2.0.0', '<' ) ) {
1380
+ if( $woocommerce->payment_gateways )
1381
+ $output = $woocommerce->payment_gateways->payment_gateways;
1382
+ } else {
1383
+ if( $woocommerce->payment_gateways() )
1384
+ $output = $woocommerce->payment_gateways()->payment_gateways();
1385
+ }
1386
+ // Add Other to list of payment gateways
1387
+ $output['other'] = (object)array(
1388
+ 'id' => 'other',
1389
+ 'title' => __( 'Other', 'woocommerce-exporter' ),
1390
+ 'method_title' => __( 'Other', 'woocommerce-exporter' )
1391
+ );
1392
+ return $output;
1393
+
1394
+ }
1395
+
1396
+ function woo_ce_format_order_payment_gateway( $payment_id = '' ) {
1397
+
1398
+ $output = $payment_id;
1399
+ $payment_gateways = woo_ce_get_order_payment_gateways();
1400
+ if( !empty( $payment_gateways ) ) {
1401
+ foreach( $payment_gateways as $payment_gateway ) {
1402
+ if( $payment_gateway->id == $payment_id ) {
1403
+ if( method_exists( $payment_gateway, 'get_title' ) )
1404
+ $output = $payment_gateway->get_title();
1405
+ else
1406
+ $output = $payment_id;
1407
+ break;
1408
+ }
1409
+ }
1410
+ unset( $payment_gateways, $payment_gateway );
1411
+ }
1412
+ if( empty( $payment_id ) )
1413
+ $output = __( 'N/A', 'woocommerce-exporter' );
1414
+ return $output;
1415
 
1416
  }
1417
  ?>
includes/product-extend.php CHANGED
@@ -1508,6 +1508,97 @@ function woo_ce_get_wccf_product_properties() {
1508
 
1509
  }
1510
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1511
  function woo_ce_format_wpseo_noindex( $noindex = '' ) {
1512
 
1513
  $output = $noindex;
1508
 
1509
  }
1510
 
1511
+ function woo_ce_format_gpf_availability( $availability = null ) {
1512
+
1513
+ $output = '';
1514
+ if( !empty( $availability ) ) {
1515
+ switch( $availability ) {
1516
+
1517
+ case 'in stock':
1518
+ $output = __( 'In Stock', 'woocommerce-exporter' );
1519
+ break;
1520
+
1521
+ case 'available for order':
1522
+ $output = __( 'Available For Order', 'woocommerce-exporter' );
1523
+ break;
1524
+
1525
+ case 'preorder':
1526
+ $output = __( 'Pre-order', 'woocommerce-exporter' );
1527
+ break;
1528
+
1529
+ }
1530
+ }
1531
+ return $output;
1532
+
1533
+ }
1534
+
1535
+ function woo_ce_format_gpf_condition( $condition ) {
1536
+
1537
+ $output = '';
1538
+ if( !empty( $condition ) ) {
1539
+ switch( $condition ) {
1540
+
1541
+ case 'new':
1542
+ $output = __( 'New', 'woocommerce-exporter' );
1543
+ break;
1544
+
1545
+ case 'refurbished':
1546
+ $output = __( 'Refurbished', 'woocommerce-exporter' );
1547
+ break;
1548
+
1549
+ case 'used':
1550
+ $output = __( 'Used', 'woocommerce-exporter' );
1551
+ break;
1552
+
1553
+ }
1554
+ }
1555
+ return $output;
1556
+
1557
+ }
1558
+
1559
+ function woo_ce_get_acf_product_fields() {
1560
+
1561
+ global $wpdb;
1562
+
1563
+ $post_type = 'acf';
1564
+ $args = array(
1565
+ 'post_type' => $post_type,
1566
+ 'numberposts' => -1
1567
+ );
1568
+ if( $field_groups = get_posts( $args ) ) {
1569
+ $fields = array();
1570
+ $post_types = array( 'product', 'product_variation' );
1571
+ foreach( $field_groups as $field_group ) {
1572
+ $has_fields = false;
1573
+ if( $rules = get_post_meta( $field_group->ID, 'rule' ) ) {
1574
+ $size = count( $rules );
1575
+ for( $i = 0; $i < $size; $i++ ) {
1576
+ if( ( $rules[$i]['param'] == 'post_type' ) && ( $rules[$i]['operator'] == '==' ) && ( in_array( $rules[$i]['value'], $post_types ) ) ) {
1577
+ $has_fields = true;
1578
+ $i = $size;
1579
+ }
1580
+ }
1581
+ }
1582
+ unset( $rules );
1583
+ if( $has_fields ) {
1584
+ $custom_fields_sql = "SELECT `meta_value` FROM `" . $wpdb->postmeta . "` WHERE `post_id` = " . absint( $field_group->ID ) . " AND `meta_key` LIKE 'field_%'";
1585
+ if( $custom_fields = $wpdb->get_col( $custom_fields_sql ) ) {
1586
+ foreach( $custom_fields as $custom_field ) {
1587
+ $custom_field = maybe_unserialize( $custom_field );
1588
+ $fields[] = array(
1589
+ 'name' => $custom_field['name'],
1590
+ 'label' => $custom_field['label']
1591
+ );
1592
+ }
1593
+ }
1594
+ unset( $custom_fields, $custom_field );
1595
+ }
1596
+ }
1597
+ return $fields;
1598
+ }
1599
+
1600
+ }
1601
+
1602
  function woo_ce_format_wpseo_noindex( $noindex = '' ) {
1603
 
1604
  $output = $noindex;
includes/product.php CHANGED
@@ -287,6 +287,11 @@ function woo_ce_get_product_fields( $format = 'full' ) {
287
  'label' => __( 'Total Sales', 'woocommerce-exporter' ),
288
  'disabled' => 1
289
  );
 
 
 
 
 
290
  $fields[] = array(
291
  'name' => 'upsell_ids',
292
  'label' => __( 'Up-Sells', 'woocommerce-exporter' )
@@ -363,6 +368,7 @@ function woo_ce_get_product_fields( $format = 'full' ) {
363
  // Remove our content filters here to play nice with other Plugins
364
  remove_filter( 'sanitize_key', 'woo_ce_filter_sanitize_key' );
365
 
 
366
  $remember = woo_ce_get_option( $export_type . '_fields', array() );
367
  if( !empty( $remember ) ) {
368
  $remember = maybe_unserialize( $remember );
@@ -389,7 +395,9 @@ function woo_ce_get_product_fields( $format = 'full' ) {
389
 
390
  case 'full':
391
  default:
392
- $sorting = woo_ce_get_option( $export_type . '_sorting', array() );
 
 
393
  $size = count( $fields );
394
  for( $i = 0; $i < $size; $i++ ) {
395
  $fields[$i]['reset'] = $i;
@@ -408,7 +416,14 @@ function woo_ce_get_product_fields( $format = 'full' ) {
408
  // Check if we should override field labels from the Field Editor
409
  function woo_ce_override_product_field_labels( $fields = array() ) {
410
 
411
- $labels = woo_ce_get_option( 'product_labels', array() );
 
 
 
 
 
 
 
412
  if( !empty( $labels ) ) {
413
  foreach( $fields as $key => $field ) {
414
  if( isset( $labels[$field['name']] ) )
@@ -488,78 +503,141 @@ function woo_ce_get_products( $args = array() ) {
488
  'fields' => 'ids',
489
  'suppress_filters' => false
490
  );
491
- // Filter Products by Product Category
492
- if( $product_category ) {
493
- $term_taxonomy = 'product_cat';
494
- // Check if tax_query has been created
495
- if( !isset( $args['tax_query'] ) )
496
- $args['tax_query'] = array();
497
- $args['tax_query'][] = array(
498
- array(
499
- 'taxonomy' => $term_taxonomy,
500
- 'field' => 'id',
501
- 'terms' => $product_category
502
- )
503
- );
504
- }
505
 
506
- // Filter Products by Product Tag
507
- if( $product_tag ) {
508
- $term_taxonomy = 'product_tag';
509
- // Check if tax_query has been created
510
- if( !isset( $args['tax_query'] ) )
511
- $args['tax_query'] = array();
512
- $args['tax_query'][] = array(
513
- array(
514
- 'taxonomy' => $term_taxonomy,
515
- 'field' => 'id',
516
- 'terms' => $product_tag
517
- )
518
- );
519
- }
520
- if( $product_status )
521
- $args['post_status'] = woo_ce_post_statuses( $product_status, true );
522
- if( $product_type ) {
523
  if( in_array( 'variation', $product_type ) && count( $product_type ) == 1 )
524
  $args['post_type'] = array( 'product_variation' );
525
- if( !empty( $product_type ) ) {
526
- $term_taxonomy = 'product_type';
527
- $args['tax_query'] = array(
 
 
 
 
 
 
 
 
 
528
  array(
529
  'taxonomy' => $term_taxonomy,
530
- 'field' => 'slug',
531
- 'terms' => $product_type
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
532
  )
533
  );
534
- } else {
535
- unset( $args['meta_query'] );
536
  }
 
 
 
 
 
537
  }
 
 
538
  // Sort Products by SKU
539
  if( $orderby == 'sku' ) {
540
  $args['orderby'] = 'meta_value';
541
  $args['meta_key'] = '_sku';
542
  }
 
543
  $products = array();
544
  $product_ids = new WP_Query( $args );
545
  if( $product_ids->posts ) {
546
  foreach( $product_ids->posts as $product_id ) {
547
 
 
 
 
 
548
  // Get Product details
549
  $product = get_post( $product_id );
550
 
551
  // Filter out Variations that don't have a Parent Product that exists
552
- if( isset( $product->post_type ) && $product->post_type == 'product_variation' ) {
553
- // Check if Parent exists
 
 
 
 
554
  if( $product->post_parent ) {
 
555
  if( get_post( $product->post_parent ) == false ) {
556
  unset( $product_id, $product );
557
  continue;
558
  }
559
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
560
  }
 
561
  if( isset( $product_id ) )
562
  $products[] = $product_id;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
563
  }
564
  // Only populate the $export Global if it is an export
565
  if( isset( $export ) )
@@ -720,6 +798,60 @@ function woo_ce_get_product_data( $product_id = 0, $args = array() ) {
720
 
721
  }
722
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
723
  // Returns Product Categories associated to a specific Product
724
  function woo_ce_get_product_assoc_categories( $product_id = 0, $parent_id = 0 ) {
725
 
@@ -799,7 +931,7 @@ function woo_ce_get_product_assoc_featured_image( $product_id = 0 ) {
799
  }
800
 
801
  // Returns the Product Galleries associated to a specific Product
802
- function woo_ce_get_product_assoc_product_gallery( $product_id = 0, $size = 'full' ) {
803
 
804
  global $export;
805
 
@@ -814,9 +946,9 @@ function woo_ce_get_product_assoc_product_gallery( $product_id = 0, $size = 'ful
814
  continue;
815
  // Media URL
816
  } else {
817
- if( $size == 'full' )
818
  $images[$i] = wp_get_attachment_url( $images[$i] );
819
- else if( $size == 'thumbnail' )
820
  $images[$i] = wp_get_attachment_thumb_url( $images[$i] );
821
  }
822
  }
@@ -957,7 +1089,7 @@ function woo_ce_get_product_assoc_download_files( $product_id = 0, $type = 'url'
957
 
958
  $output = '';
959
  if( $product_id ) {
960
- if( version_compare( WOOCOMMERCE_VERSION, '2.0', '>=' ) ) {
961
  // If WooCommerce 2.0+ is installed then use new _downloadable_files Post meta key
962
  if( $file_downloads = maybe_unserialize( get_post_meta( $product_id, '_downloadable_files', true ) ) ) {
963
  foreach( $file_downloads as $file_download ) {
@@ -1023,7 +1155,6 @@ function woo_ce_get_product_addons() {
1023
  );
1024
  }
1025
  }
1026
-
1027
  return $output;
1028
 
1029
  }
@@ -1126,54 +1257,6 @@ function woo_ce_format_product_download_type( $download_type = '' ) {
1126
 
1127
  }
1128
 
1129
- function woo_ce_format_gpf_availability( $availability = null ) {
1130
-
1131
- $output = '';
1132
- if( !empty( $availability ) ) {
1133
- switch( $availability ) {
1134
-
1135
- case 'in stock':
1136
- $output = __( 'In Stock', 'woocommerce-exporter' );
1137
- break;
1138
-
1139
- case 'available for order':
1140
- $output = __( 'Available For Order', 'woocommerce-exporter' );
1141
- break;
1142
-
1143
- case 'preorder':
1144
- $output = __( 'Pre-order', 'woocommerce-exporter' );
1145
- break;
1146
-
1147
- }
1148
- }
1149
- return $output;
1150
-
1151
- }
1152
-
1153
- function woo_ce_format_gpf_condition( $condition ) {
1154
-
1155
- $output = '';
1156
- if( !empty( $condition ) ) {
1157
- switch( $condition ) {
1158
-
1159
- case 'new':
1160
- $output = __( 'New', 'woocommerce-exporter' );
1161
- break;
1162
-
1163
- case 'refurbished':
1164
- $output = __( 'Refurbished', 'woocommerce-exporter' );
1165
- break;
1166
-
1167
- case 'used':
1168
- $output = __( 'Used', 'woocommerce-exporter' );
1169
- break;
1170
-
1171
- }
1172
- }
1173
- return $output;
1174
-
1175
- }
1176
-
1177
  function woo_ce_format_product_stock_status( $stock_status = '', $stock = '' ) {
1178
 
1179
  $output = '';
@@ -1342,7 +1425,10 @@ function woo_ce_get_product_type_count( $post_type = 'product', $args = array()
1342
  }
1343
 
1344
  // Returns a list of WooCommerce Product Attributes to export process
1345
- function woo_ce_get_product_attributes() {
 
 
 
1346
 
1347
  global $wpdb;
1348
 
@@ -1356,50 +1442,8 @@ function woo_ce_get_product_attributes() {
1356
  } else {
1357
  $output = ( function_exists( 'wc_get_attribute_taxonomies' ) ? wc_get_attribute_taxonomies() : array() );
1358
  }
1359
- return $output;
1360
 
1361
- }
1362
-
1363
- function woo_ce_get_acf_product_fields() {
1364
-
1365
- global $wpdb;
1366
-
1367
- $post_type = 'acf';
1368
- $args = array(
1369
- 'post_type' => $post_type,
1370
- 'numberposts' => -1
1371
- );
1372
- if( $field_groups = get_posts( $args ) ) {
1373
- $fields = array();
1374
- $post_types = array( 'product', 'product_variation' );
1375
- foreach( $field_groups as $field_group ) {
1376
- $has_fields = false;
1377
- if( $rules = get_post_meta( $field_group->ID, 'rule' ) ) {
1378
- $size = count( $rules );
1379
- for( $i = 0; $i < $size; $i++ ) {
1380
- if( ( $rules[$i]['param'] == 'post_type' ) && ( $rules[$i]['operator'] == '==' ) && ( in_array( $rules[$i]['value'], $post_types ) ) ) {
1381
- $has_fields = true;
1382
- $i = $size;
1383
- }
1384
- }
1385
- }
1386
- unset( $rules );
1387
- if( $has_fields ) {
1388
- $custom_fields_sql = "SELECT `meta_value` FROM `" . $wpdb->postmeta . "` WHERE `post_id` = " . absint( $field_group->ID ) . " AND `meta_key` LIKE 'field_%'";
1389
- if( $custom_fields = $wpdb->get_col( $custom_fields_sql ) ) {
1390
- foreach( $custom_fields as $custom_field ) {
1391
- $custom_field = maybe_unserialize( $custom_field );
1392
- $fields[] = array(
1393
- 'name' => $custom_field['name'],
1394
- 'label' => $custom_field['label']
1395
- );
1396
- }
1397
- }
1398
- unset( $custom_fields, $custom_field );
1399
- }
1400
- }
1401
- return $fields;
1402
- }
1403
 
1404
  }
1405
 
287
  'label' => __( 'Total Sales', 'woocommerce-exporter' ),
288
  'disabled' => 1
289
  );
290
+ $fields[] = array(
291
+ 'name' => 'grouped_products',
292
+ 'label' => __( 'Grouped Products', 'woocommerce-exporter' ),
293
+ 'disabled' => 1
294
+ );
295
  $fields[] = array(
296
  'name' => 'upsell_ids',
297
  'label' => __( 'Up-Sells', 'woocommerce-exporter' )
368
  // Remove our content filters here to play nice with other Plugins
369
  remove_filter( 'sanitize_key', 'woo_ce_filter_sanitize_key' );
370
 
371
+ $sorting = false;
372
  $remember = woo_ce_get_option( $export_type . '_fields', array() );
373
  if( !empty( $remember ) ) {
374
  $remember = maybe_unserialize( $remember );
395
 
396
  case 'full':
397
  default:
398
+ // Load the default sorting
399
+ if( empty( $sorting ) )
400
+ $sorting = woo_ce_get_option( sprintf( '%s_sorting', $export_type ), array() );
401
  $size = count( $fields );
402
  for( $i = 0; $i < $size; $i++ ) {
403
  $fields[$i]['reset'] = $i;
416
  // Check if we should override field labels from the Field Editor
417
  function woo_ce_override_product_field_labels( $fields = array() ) {
418
 
419
+ $export_type = 'product';
420
+
421
+ $labels = false;
422
+
423
+ // Default to Quick Export labels
424
+ if( empty( $labels ) )
425
+ $labels = woo_ce_get_option( sprintf( '%s_labels', $export_type ), array() );
426
+
427
  if( !empty( $labels ) ) {
428
  foreach( $fields as $key => $field ) {
429
  if( isset( $labels[$field['name']] ) )
503
  'fields' => 'ids',
504
  'suppress_filters' => false
505
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
506
 
507
+ // Filter Products by Product Type
508
+ if( is_array( $product_type ) && !empty( $product_type ) ) {
509
+ // Check if we are just exporting Variations
 
 
 
 
 
 
 
 
 
 
 
 
 
 
510
  if( in_array( 'variation', $product_type ) && count( $product_type ) == 1 )
511
  $args['post_type'] = array( 'product_variation' );
512
+ }
513
+
514
+ // Check if we are doing a Variation export
515
+ if( !in_array( 'product_variation', $args['post_type'] ) ) {
516
+
517
+ // Filter Products by Product Category
518
+ if( $product_category ) {
519
+ $term_taxonomy = 'product_cat';
520
+ // Check if tax_query has been created
521
+ if( !isset( $args['tax_query'] ) )
522
+ $args['tax_query'] = array();
523
+ $args['tax_query'][] = array(
524
  array(
525
  'taxonomy' => $term_taxonomy,
526
+ 'field' => 'id',
527
+ 'terms' => $product_category
528
+ )
529
+ );
530
+ }
531
+
532
+ // Filter Products by Product Tag
533
+ if( $product_tag ) {
534
+ $term_taxonomy = 'product_tag';
535
+ // Check if tax_query has been created
536
+ if( !isset( $args['tax_query'] ) )
537
+ $args['tax_query'] = array();
538
+ $args['tax_query'][] = array(
539
+ array(
540
+ 'taxonomy' => $term_taxonomy,
541
+ 'field' => 'id',
542
+ 'terms' => $product_tag
543
  )
544
  );
 
 
545
  }
546
+
547
+ }
548
+ // Filter Products by Post Status
549
+ if( $product_status ) {
550
+ $args['post_status'] = woo_ce_post_statuses( $product_status, true );
551
  }
552
+
553
+
554
  // Sort Products by SKU
555
  if( $orderby == 'sku' ) {
556
  $args['orderby'] = 'meta_value';
557
  $args['meta_key'] = '_sku';
558
  }
559
+
560
  $products = array();
561
  $product_ids = new WP_Query( $args );
562
  if( $product_ids->posts ) {
563
  foreach( $product_ids->posts as $product_id ) {
564
 
565
+ // Check that a WP_Post didn't sneak through...
566
+ if( is_object( $product_id ) )
567
+ $product_id = ( isset( $product_id->ID ) ? absint( $product_id->ID ) : $product_id );
568
+
569
  // Get Product details
570
  $product = get_post( $product_id );
571
 
572
  // Filter out Variations that don't have a Parent Product that exists
573
+ if(
574
+ isset( $product->post_type ) &&
575
+ $product->post_type == 'product_variation'
576
+ ) {
577
+
578
+ // Filter out Variations that don't have a Parent Product that exists
579
  if( $product->post_parent ) {
580
+ // Check if Parent exists
581
  if( get_post( $product->post_parent ) == false ) {
582
  unset( $product_id, $product );
583
  continue;
584
  }
585
  }
586
+
587
+ // Allow filtering Variations by parent Variable filters
588
+ if(
589
+ is_array( $product_type ) &&
590
+ !empty( $product_type
591
+ ) ) {
592
+ // Check if we are just exporting Variations
593
+ if(
594
+ in_array( 'variation', $product_type ) &&
595
+ count( $product_type ) == 1
596
+ ) {
597
+
598
+ // Filter Variations by Product Category
599
+ if( $product_category ) {
600
+ $term_taxonomy = 'product_cat';
601
+ $response = array_intersect( woo_ce_get_product_assoc_categories( $product->post_parent, false, $term_taxonomy, 'ids' ), $product_category );
602
+ if( empty( $response ) ) {
603
+ unset( $product_id, $product );
604
+ continue;
605
+ }
606
+ unset( $response );
607
+ }
608
+
609
+ // Filter Variations by Product Tag
610
+ if( $product_tag ) {
611
+ $term_taxonomy = 'product_tag';
612
+ $response = array_intersect( woo_ce_get_product_assoc_tags( $product->post_parent, $term_taxonomy, 'ids' ), $product_tag );
613
+ if( empty( $response ) ) {
614
+ unset( $product_id, $product );
615
+ continue;
616
+ }
617
+ unset( $response );
618
+ }
619
+
620
+ }
621
+ }
622
+
623
  }
624
+
625
  if( isset( $product_id ) )
626
  $products[] = $product_id;
627
+
628
+ // Override for exporting Variations without Variables
629
+ if( is_array( $product_type ) && !empty( $product_type ) ) {
630
+ if( in_array( 'variation', $product_type ) && in_array( 'variable', $product_type ) == false ) {
631
+ $term_taxonomy = 'product_type';
632
+ if( $product->post_type == 'product' && has_term( 'variable', $term_taxonomy, $product_id ) ) {
633
+ // Remove the Variable Product ID
634
+ $key = array_search( $product_id, $products );
635
+ if( $key !== false )
636
+ unset( $products[$key] );
637
+ }
638
+ }
639
+ }
640
+
641
  }
642
  // Only populate the $export Global if it is an export
643
  if( isset( $export ) )
798
 
799
  }
800
 
801
+ function woo_ce_export_dataset_override_product( $output = null, $export_type = null ) {
802
+
803
+ global $export;
804
+
805
+ if( $products = woo_ce_get_products( $export->args ) ) {
806
+ $separator = $export->delimiter;
807
+ $size = $export->total_columns;
808
+ $export->total_rows = count( $products );
809
+ // Generate the export headers
810
+ if( in_array( $export->export_format, array( 'csv' ) ) ) {
811
+ for( $i = 0; $i < $size; $i++ ) {
812
+ if( $i == ( $size - 1 ) )
813
+ $output .= woo_ce_escape_csv_value( $export->columns[$i], $export->delimiter, $export->escape_formatting ) . "\n";
814
+ else
815
+ $output .= woo_ce_escape_csv_value( $export->columns[$i], $export->delimiter, $export->escape_formatting ) . $separator;
816
+ }
817
+ }
818
+ $weight_unit = get_option( 'woocommerce_weight_unit' );
819
+ $dimension_unit = get_option( 'woocommerce_dimension_unit' );
820
+ $height_unit = $dimension_unit;
821
+ $width_unit = $dimension_unit;
822
+ $length_unit = $dimension_unit;
823
+ if( !empty( $export->fields ) ) {
824
+ foreach( $products as $product ) {
825
+
826
+ $product = woo_ce_get_product_data( $product, $export->args );
827
+ foreach( $export->fields as $key => $field ) {
828
+ if( isset( $product->$key ) ) {
829
+ if( is_array( $field ) ) {
830
+ foreach( $field as $array_key => $array_value ) {
831
+ if( !is_array( $array_value ) ) {
832
+ if( in_array( $export->export_format, array( 'csv' ) ) )
833
+ $output .= woo_ce_escape_csv_value( $array_value, $export->delimiter, $export->escape_formatting );
834
+ }
835
+ }
836
+ } else {
837
+ if( in_array( $export->export_format, array( 'csv' ) ) )
838
+ $output .= woo_ce_escape_csv_value( $product->$key, $export->delimiter, $export->escape_formatting );
839
+ }
840
+ }
841
+ if( in_array( $export->export_format, array( 'csv' ) ) )
842
+ $output .= $separator;
843
+ }
844
+
845
+ if( in_array( $export->export_format, array( 'csv' ) ) )
846
+ $output = substr( $output, 0, -1 ) . "\n";
847
+ }
848
+ }
849
+ unset( $products, $product );
850
+ }
851
+ return $output;
852
+
853
+ }
854
+
855
  // Returns Product Categories associated to a specific Product
856
  function woo_ce_get_product_assoc_categories( $product_id = 0, $parent_id = 0 ) {
857
 
931
  }
932
 
933
  // Returns the Product Galleries associated to a specific Product
934
+ function woo_ce_get_product_assoc_product_gallery( $product_id = 0, $image_format = 'full' ) {
935
 
936
  global $export;
937
 
946
  continue;
947
  // Media URL
948
  } else {
949
+ if( $image_format == 'full' )
950
  $images[$i] = wp_get_attachment_url( $images[$i] );
951
+ else if( $image_format == 'thumbnail' )
952
  $images[$i] = wp_get_attachment_thumb_url( $images[$i] );
953
  }
954
  }
1089
 
1090
  $output = '';
1091
  if( $product_id ) {
1092
+ if( version_compare( woo_get_woo_version(), '2.0', '>=' ) ) {
1093
  // If WooCommerce 2.0+ is installed then use new _downloadable_files Post meta key
1094
  if( $file_downloads = maybe_unserialize( get_post_meta( $product_id, '_downloadable_files', true ) ) ) {
1095
  foreach( $file_downloads as $file_download ) {
1155
  );
1156
  }
1157
  }
 
1158
  return $output;
1159
 
1160
  }
1257
 
1258
  }
1259
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1260
  function woo_ce_format_product_stock_status( $stock_status = '', $stock = '' ) {
1261
 
1262
  $output = '';
1425
  }
1426
 
1427
  // Returns a list of WooCommerce Product Attributes to export process
1428
+ function woo_ce_get_product_attributes( $slice = '' ) {
1429
+
1430
+ if( apply_filters( 'woo_ce_enable_product_attributes', true ) == false )
1431
+ return false;
1432
 
1433
  global $wpdb;
1434
 
1442
  } else {
1443
  $output = ( function_exists( 'wc_get_attribute_taxonomies' ) ? wc_get_attribute_taxonomies() : array() );
1444
  }
 
1445
 
1446
+ return $output;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1447
 
1448
  }
1449
 
includes/settings.php CHANGED
@@ -193,10 +193,10 @@ function woo_ce_export_settings_extend() {
193
  </tr>
194
  <tr>
195
  <th>
196
- <label for="auto_type"><?php _e( 'Export type', 'woocommerce-exporter' ); ?></label>
197
  </th>
198
  <td>
199
- <select id="auto_type" name="auto_type">
200
  <?php if( !empty( $types ) ) { ?>
201
  <?php foreach( $types as $key => $type ) { ?>
202
  <option value="<?php echo $key; ?>"><?php echo $type; ?></option>
@@ -209,7 +209,7 @@ function woo_ce_export_settings_extend() {
209
  <p class="description"><?php _e( 'Select the data type you want to export.', 'woocommerce-exporter' ); ?></p>
210
  </td>
211
  </tr>
212
- <tr class="auto_type_options">
213
  <th>
214
  <label><?php _e( 'Export filters', 'woocommerce-exporter' ); ?></label>
215
  </th>
193
  </tr>
194
  <tr>
195
  <th>
196
+ <label for="export_type"><?php _e( 'Export type', 'woocommerce-exporter' ); ?></label>
197
  </th>
198
  <td>
199
+ <select id="export_type" name="export_type">
200
  <?php if( !empty( $types ) ) { ?>
201
  <?php foreach( $types as $key => $type ) { ?>
202
  <option value="<?php echo $key; ?>"><?php echo $type; ?></option>
209
  <p class="description"><?php _e( 'Select the data type you want to export.', 'woocommerce-exporter' ); ?></p>
210
  </td>
211
  </tr>
212
+ <tr class="export_type_options">
213
  <th>
214
  <label><?php _e( 'Export filters', 'woocommerce-exporter' ); ?></label>
215
  </th>
includes/tag.php CHANGED
@@ -104,6 +104,7 @@ function woo_ce_get_tag_fields( $format = 'full' ) {
104
 
105
  }
106
 
 
107
  function woo_ce_override_tag_field_labels( $fields = array() ) {
108
 
109
  $labels = woo_ce_get_option( 'tag_labels', array() );
@@ -169,5 +170,47 @@ function woo_ce_get_product_tags( $args = array() ) {
169
  return $tags;
170
  }
171
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
172
  }
173
  ?>
104
 
105
  }
106
 
107
+ // Check if we should override field labels from the Field Editor
108
  function woo_ce_override_tag_field_labels( $fields = array() ) {
109
 
110
  $labels = woo_ce_get_option( 'tag_labels', array() );
170
  return $tags;
171
  }
172
 
173
+ }
174
+
175
+ function woo_ce_export_dataset_override_tag( $output = null, $export_type = null ) {
176
+
177
+ global $export;
178
+
179
+ $args = array(
180
+ 'orderby' => ( isset( $export->args['tag_orderby'] ) ? $export->args['tag_orderby'] : 'ID' ),
181
+ 'order' => ( isset( $export->args['tag_order'] ) ? $export->args['tag_order'] : 'ASC' ),
182
+ );
183
+ if( $tags = woo_ce_get_product_tags( $args ) ) {
184
+ $separator = $export->delimiter;
185
+ $size = $export->total_columns;
186
+ $export->total_rows = count( $tags );
187
+ // Generate the export headers
188
+ if( in_array( $export->export_format, array( 'csv' ) ) ) {
189
+ for( $i = 0; $i < $size; $i++ ) {
190
+ if( $i == ( $size - 1 ) )
191
+ $output .= woo_ce_escape_csv_value( $export->columns[$i], $export->delimiter, $export->escape_formatting ) . "\n";
192
+ else
193
+ $output .= woo_ce_escape_csv_value( $export->columns[$i], $export->delimiter, $export->escape_formatting ) . $separator;
194
+ }
195
+ }
196
+ if( !empty( $export->fields ) ) {
197
+ foreach( $tags as $tag ) {
198
+
199
+ foreach( $export->fields as $key => $field ) {
200
+ if( isset( $tag->$key ) ) {
201
+ if( in_array( $export->export_format, array( 'csv' ) ) )
202
+ $output .= woo_ce_escape_csv_value( $tag->$key, $export->delimiter, $export->escape_formatting );
203
+ }
204
+ if( in_array( $export->export_format, array( 'csv' ) ) )
205
+ $output .= $separator;
206
+ }
207
+ if( in_array( $export->export_format, array( 'csv' ) ) )
208
+ $output = substr( $output, 0, -1 ) . "\n";
209
+ }
210
+ }
211
+ unset( $tags, $tag );
212
+ }
213
+ return $output;
214
+
215
  }
216
  ?>
includes/user.php CHANGED
@@ -267,6 +267,48 @@ function woo_ce_get_user_data( $user_id = 0, $args = array() ) {
267
 
268
  }
269
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
270
  // Returns a list of WordPress User Roles
271
  function woo_ce_get_user_roles() {
272
 
267
 
268
  }
269
 
270
+ function woo_ce_export_dataset_override_user( $output = null, $export_type = null ) {
271
+
272
+ global $export;
273
+
274
+ if( $users = woo_ce_get_users( $export->args ) ) {
275
+ $separator = $export->delimiter;
276
+ $size = $export->total_columns;
277
+ $export->total_rows = count( $users );
278
+ // Generate the export headers
279
+ if( in_array( $export->export_format, array( 'csv' ) ) ) {
280
+ for( $i = 0; $i < $size; $i++ ) {
281
+ if( $i == ( $size - 1 ) )
282
+ $output .= woo_ce_escape_csv_value( $export->columns[$i], $export->delimiter, $export->escape_formatting ) . "\n";
283
+ else
284
+ $output .= woo_ce_escape_csv_value( $export->columns[$i], $export->delimiter, $export->escape_formatting ) . $separator;
285
+ }
286
+ }
287
+ if( !empty( $export->fields ) ) {
288
+ foreach( $users as $user ) {
289
+
290
+ $user = woo_ce_get_user_data( $user, $export->args );
291
+
292
+ foreach( $export->fields as $key => $field ) {
293
+ if( isset( $user->$key ) ) {
294
+ if( in_array( $export->export_format, array( 'csv' ) ) )
295
+ $output .= woo_ce_escape_csv_value( $user->$key, $export->delimiter, $export->escape_formatting );
296
+ }
297
+ if( in_array( $export->export_format, array( 'csv' ) ) )
298
+ $output .= $separator;
299
+ }
300
+
301
+ if( in_array( $export->export_format, array( 'csv' ) ) )
302
+ $output = substr( $output, 0, -1 ) . "\n";
303
+
304
+ }
305
+ }
306
+ unset( $users, $user );
307
+ }
308
+ return $output;
309
+
310
+ }
311
+
312
  // Returns a list of WordPress User Roles
313
  function woo_ce_get_user_roles() {
314
 
readme.txt CHANGED
@@ -2,48 +2,50 @@
2
 
3
  Contributors: visser, visser.labs
4
  Donate link: https://www.visser.com.au/donations/
5
- Tags: e-commerce, woocommerce, shop, cart, ecommerce, export, csv, xml, xls, xlsx, excel, customers, products, sales, orders, coupons, users, attributes, subscriptions
6
  Requires at least: 2.9.2
7
- Tested up to: 4.9.4
8
- Stable tag: 1.9.5
9
  License: GPLv2 or later
10
 
11
  Export store details out of WooCommerce into simple formatted files (e.g. CSV, XML, Excel 2007, XLS, etc.).
12
 
13
  == Description ==
14
 
15
- **Screen-loads of options and filters let you design advanced exports to suit your store requirements, or simply go with the default and click Export to produce concise, ready to use store exports.**
16
 
17
- Store Exporter maintains compatibility with the latest WooCommerce releases through regular feature updates; as trusted by the 20,000+ active users of this Plugin. Happy exporting!
18
 
19
- = Features =
20
 
21
- Features include:
 
 
22
 
23
  * Export Products
24
- * Export Products by Product Category
25
- * Export Products by Product Status
26
- * Export Products by Type including Variations
27
  * Export Categories
28
  * Export Tags
29
  * Export Brands (*)
30
- * Export Orders (*)
31
- * Export Orders by Order Status (*)
32
- * Export Orders by Order Date (*)
33
- * Export Orders by Customers (*)
34
- * Export Orders by Coupon Code (*)
35
  * Export Customers (*)
36
- * Export Customers by Order Status (*)
37
  * Export Users
38
  * Export Coupons (*)
39
  * Export Subscriptions (*)
40
- * Export Commissions (*)
41
  * Export Product Vendors (*)
 
 
42
  * Export Shipping Classes (*)
43
  * Export Attributes (*)
 
 
 
44
  * Toggle and save export fields
45
  * Field label editor (*)
46
- * Works with WordPress Multisite
 
 
 
 
47
  * Export to CSV file
48
  * Export to TSV file (*)
49
  * Export to Excel 2007 (XLS) file (*)
@@ -52,22 +54,50 @@ Features include:
52
  * Export to RSS file (*)
53
  * Export to WordPress Media
54
  * Export to e-mail addresses (*)
55
- * Export to remote POST (*)
56
  * Export to remote FTP/FTPS/SFTP (*)
57
- * Supports external CRON commands (*)
58
- * Supports scheduled exports (*)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
 
60
  (*) Requires the Pro upgrade to enable additional store export functionality.
61
 
 
 
62
  > ** Go Pro **
63
  >
64
- > Unlock the business focused e-commerce features within Store Exporter such as scheduled exporting from [this link](https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc).
65
  >
66
  > Full documentation and usage of Store Exporter Deluxe is available from the [support section for Store Exporter Deluxe](http://www.visser.com.au/documentation/store-exporter-deluxe/).
67
 
68
- = Native export integration with 90+ WooCommerce Plugins =
69
 
70
- Just a few of the features unlocked in the Pro upgrade of Store Exporter include:
71
 
72
  - Export All in One SEO Pack
73
  - Export Advanced Google Product Feed
@@ -91,10 +121,12 @@ Just a few of the features unlocked in the Pro upgrade of Store Exporter include
91
 
92
  ... and many more free and Premium extensions for WooCommerce and WordPress.
93
 
94
- Want regular updates? [Become a fan on Facebook!](http://www.facebook.com/visser.labs/)
95
 
96
  [For more information visit our site.](https://www.visser.com.au/solutions/woocommerce-export/)
97
 
 
 
98
  == Installation ==
99
 
100
  1. Upload the folder 'woocommerce-exporter' to the '/wp-content/plugins/' directory
@@ -132,6 +164,16 @@ If you have any problems, questions or suggestions please create a topic here on
132
 
133
  == Changelog ==
134
 
 
 
 
 
 
 
 
 
 
 
135
  = 1.9.5 =
136
  * Added: Notice when number of export fields is over the PHP FORM limit
137
  * Added: Notice to Overview tab
2
 
3
  Contributors: visser, visser.labs
4
  Donate link: https://www.visser.com.au/donations/
5
+ Tags: e-commerce, woocommerce, shop, cart, ecommerce, export, export to csv, export to xml, xls, xlsx, export to excel, export customers, export products, export sales, export orders, export coupons, users, attributes, export subscriptions
6
  Requires at least: 2.9.2
7
+ Tested up to: 4.9.6
8
+ Stable tag: 1.9.6
9
  License: GPLv2 or later
10
 
11
  Export store details out of WooCommerce into simple formatted files (e.g. CSV, XML, Excel 2007, XLS, etc.).
12
 
13
  == Description ==
14
 
15
+ **WooCommerce - Store Exporter creates Product, Order, Category, Tag and User exports to suit your store requirements, simply click Quick Export to produce concise, ready to use Excel spreadshseets.**
16
 
17
+ Screen-loads of filters and options are available to customise each export type, with native export integration of 110+ WooCommerce Plugins.
18
 
19
+ Store Exporter is the original WooCommerce export Plugin since 2012 and is trusted by 20,000+ active stores. Store Exporter for WooCommerce is supported by an active community of store owners and developers providing continual feature suggestions and feedback.
20
 
21
+ This advanced export Plugin maintains compatibility with the latest WooCommerce releases through regular Plugin updates, we also proudly maintain compatibility with legacy releases of WooCommerce.
22
+
23
+ = WooCommerce export types =
24
 
25
  * Export Products
 
 
 
26
  * Export Categories
27
  * Export Tags
28
  * Export Brands (*)
29
+ * Export Orders
 
 
 
 
30
  * Export Customers (*)
 
31
  * Export Users
32
  * Export Coupons (*)
33
  * Export Subscriptions (*)
 
34
  * Export Product Vendors (*)
35
+ * Export Bookings (*)
36
+ * Export Commissions (*)
37
  * Export Shipping Classes (*)
38
  * Export Attributes (*)
39
+
40
+ = WooCommerce export features =
41
+
42
  * Toggle and save export fields
43
  * Field label editor (*)
44
+ * Scheduled exports (*)
45
+ * Export templates (*)
46
+ * Compatible with WordPress Multisite
47
+ * Compatible with WPML (WordPress Multilingual) (*)
48
+ * Compatible with WP-CLI (*)
49
  * Export to CSV file
50
  * Export to TSV file (*)
51
  * Export to Excel 2007 (XLS) file (*)
54
  * Export to RSS file (*)
55
  * Export to WordPress Media
56
  * Export to e-mail addresses (*)
57
+ * Export to fixed filename (*)
58
  * Export to remote FTP/FTPS/SFTP (*)
59
+ * Export to remote POST (*)
60
+ * Supports external CRON (*)
61
+
62
+ = See our WooCommerce export Plugin in action =
63
+
64
+ [youtube https://www.youtube.com/watch?v=xYeP2eDEOM4]
65
+
66
+ (Thanks to Martha Waugh!)
67
+
68
+ = WooCommerce export filters =
69
+
70
+ * Export Products by Product Category/Tag
71
+ * Export Products by Product Status
72
+ * Export Products by Type including Variations
73
+ * Export Products by Stock Status/Quantity
74
+ * Export Products by Featured
75
+ * Export Products by Date Modified
76
+ * Export Orders by Order Date
77
+ * Export Orders by Order Status (*)
78
+ * Export Orders by Customer (*)
79
+ * Export Orders by Billing/Shipping Country (*)
80
+ * Export Orders by Product (*)
81
+ * Export Orders by Product Category/Tag/Brand (*)
82
+ * Export Orders by Order ID/Invoice Number (*)
83
+ * Export Orders by Payment Gateway/Shipping Method (*)
84
+ * Export Orders by Coupon Code (*)
85
+ * Export Customers by Order Status (*)
86
+ * Export Customers by User Role (*)
87
 
88
  (*) Requires the Pro upgrade to enable additional store export functionality.
89
 
90
+ = Upgrade to Store Exporter Deluxe =
91
+
92
  > ** Go Pro **
93
  >
94
+ > Unlock the business focused e-commerce features such as scheduled exports, additional export fields and filters by upgrading to Store Exporter Deluxe. [You can get Store Exporter Deluxe here!](https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc).
95
  >
96
  > Full documentation and usage of Store Exporter Deluxe is available from the [support section for Store Exporter Deluxe](http://www.visser.com.au/documentation/store-exporter-deluxe/).
97
 
98
+ = Native export integration with 110+ WooCommerce Plugins =
99
 
100
+ Just a few of the features unlocked in the [Pro upgrade of Store Exporter](https://www.visser.com.au/plugins/store-exporter-deluxe/?platform=wc) include:
101
 
102
  - Export All in One SEO Pack
103
  - Export Advanced Google Product Feed
121
 
122
  ... and many more free and Premium extensions for WooCommerce and WordPress.
123
 
124
+ Want regular updates? [Become a fan on Facebook](http://www.facebook.com/visser.labs/)
125
 
126
  [For more information visit our site.](https://www.visser.com.au/solutions/woocommerce-export/)
127
 
128
+ Happy exporting! :)
129
+
130
  == Installation ==
131
 
132
  1. Upload the folder 'woocommerce-exporter' to the '/wp-content/plugins/' directory
164
 
165
  == Changelog ==
166
 
167
+ = 1.9.6 =
168
+ * Added: Dismiss option to PHP FORM limit notice
169
+ * Added: Order export support
170
+ * Added: Transient storage for User Roles and Order Statuses
171
+ * Fixed: Possible issue with Export buttons trigerring wrong export type (thanks Yaniv)
172
+ * Added: Dismiss welcome notice on Overview screen after first export
173
+ * Added: Filter Orders by Date support
174
+ * Fixed: Select all and unselect all ignore disabled export fields
175
+ * Changed: Bring codebases of Pro Plugin closer to help with porting changes
176
+
177
  = 1.9.5 =
178
  * Added: Notice when number of export fields is over the PHP FORM limit
179
  * Added: Notice to Overview tab
templates/admin/export.js CHANGED
@@ -28,11 +28,6 @@ $j(function() {
28
  });
29
  }
30
 
31
- // Order Dates
32
- $j('input[name="order_dates_filter_variable"],select[name="order_dates_filter_variable_length"]').click(function () {
33
- $j('input:radio[name="order_dates_filter"][value="variable"]').prop( 'checked', true );
34
- });
35
-
36
  // Chosen dropdown element
37
  if( $j.isFunction($j.fn.chosen) ) {
38
  $j(".chzn-select").chosen({
@@ -75,12 +70,12 @@ $j(function() {
75
 
76
  // Select all field options for this export type
77
  $j('.checkall').click(function () {
78
- $j(this).closest('.postbox').find(':checkbox').attr('checked', true);
79
  });
80
 
81
  // Unselect all field options for this export type
82
  $j('.uncheckall').click(function () {
83
- $j(this).closest('.postbox').find(':checkbox').attr('checked', false);
84
  });
85
 
86
  // Reset sorting of fields for this export type
@@ -450,61 +445,61 @@ $j(function() {
450
 
451
  // Export button
452
  $j('#export_product').click(function(){
453
- $j('input:radio[name=dataset]:nth(0)').attr('checked',true);
454
  });
455
  $j('#export_category').click(function(){
456
- $j('input:radio[name=dataset]:nth(1)').attr('checked',true);
457
  });
458
  $j('#export_tag').click(function(){
459
- $j('input:radio[name=dataset]:nth(2)').attr('checked',true);
460
  });
461
  $j('#export_brand').click(function(){
462
- $j('input:radio[name=dataset]:nth(3)').attr('checked',true);
463
  });
464
  $j('#export_order').click(function(){
465
- $j('input:radio[name=dataset]:nth(4)').attr('checked',true);
466
  });
467
  $j('#export_customer').click(function(){
468
- $j('input:radio[name=dataset]:nth(5)').attr('checked',true);
469
  });
470
  $j('#export_user').click(function(){
471
- $j('input:radio[name=dataset]:nth(6)').attr('checked',true);
472
  });
473
  $j('#export_review').click(function(){
474
- $j('input:radio[name=dataset]:nth(7)').attr('checked',true);
475
  });
476
  $j('#export_coupon').click(function(){
477
- $j('input:radio[name=dataset]:nth(8)').attr('checked',true);
478
  });
479
  $j('#export_subscription').click(function(){
480
- $j('input:radio[name=dataset]:nth(9)').attr('checked',true);
481
  });
482
  $j('#export_product_vendor').click(function(){
483
- $j('input:radio[name=dataset]:nth(10)').attr('checked',true);
484
  });
485
  $j('#export_commission').click(function(){
486
- $j('input:radio[name=dataset]:nth(11)').attr('checked',true);
487
  });
488
  $j('#export_shipping_class').click(function(){
489
- $j('input:radio[name=dataset]:nth(12)').attr('checked',true);
490
  });
491
  $j('#export_ticket').click(function(){
492
- $j('input:radio[name=dataset]:nth(13)').attr('checked',true);
493
  });
494
  $j('#export_booking').click(function(){
495
- $j('input:radio[name=dataset]:nth(14)').attr('checked',true);
496
  });
497
  $j('#export_attribute').click(function(){
498
- $j('input:radio[name=dataset]:nth(15)').attr('checked',true);
499
  });
500
 
501
  // Changing the Export Type will show/hide other options
502
- $j("#auto_type").change(function () {
503
- var type = $j('select[name=auto_type]').val();
504
- $j('.auto_type_options .export-options').hide();
505
  if( type == null )
506
  var type = 'product';
507
- $j('.auto_type_options .'+type+'-options').show();
508
  });
509
 
510
  // Changing the Export Method will show/hide other options
@@ -546,7 +541,7 @@ $j(function() {
546
  $j('#'+type).trigger('click');
547
  }
548
  } else if ( href.toLowerCase().indexOf('tab=settings') >= 0 ) {
549
- $j("#auto_type").trigger("change");
550
  $j("#auto_method").trigger("change");
551
  } else {
552
  // This auto-selects the last known export type based on stored WordPress option, defaults to Products
28
  });
29
  }
30
 
 
 
 
 
 
31
  // Chosen dropdown element
32
  if( $j.isFunction($j.fn.chosen) ) {
33
  $j(".chzn-select").chosen({
70
 
71
  // Select all field options for this export type
72
  $j('.checkall').click(function () {
73
+ $j(this).closest('.postbox').find('input[type="checkbox"]:not(:disabled)').attr('checked', true);
74
  });
75
 
76
  // Unselect all field options for this export type
77
  $j('.uncheckall').click(function () {
78
+ $j(this).closest('.postbox').find('input[type="checkbox"]:not(:disabled)').attr('checked', false);
79
  });
80
 
81
  // Reset sorting of fields for this export type
445
 
446
  // Export button
447
  $j('#export_product').click(function(){
448
+ $j('input:radio[name=dataset][value="product"]').attr('checked',true);
449
  });
450
  $j('#export_category').click(function(){
451
+ $j('input:radio[name=dataset][value="category"]').attr('checked',true);
452
  });
453
  $j('#export_tag').click(function(){
454
+ $j('input:radio[name=dataset][value="tag"]').attr('checked',true);
455
  });
456
  $j('#export_brand').click(function(){
457
+ $j('input:radio[name=dataset][value="brand"]').attr('checked',true);
458
  });
459
  $j('#export_order').click(function(){
460
+ $j('input:radio[name=dataset][value="order"]').attr('checked',true);
461
  });
462
  $j('#export_customer').click(function(){
463
+ $j('input:radio[name=dataset][value="customer"]').attr('checked',true);
464
  });
465
  $j('#export_user').click(function(){
466
+ $j('input:radio[name=dataset][value="user"]').attr('checked',true);
467
  });
468
  $j('#export_review').click(function(){
469
+ $j('input:radio[name=dataset][value="review"]').attr('checked',true);
470
  });
471
  $j('#export_coupon').click(function(){
472
+ $j('input:radio[name=dataset][value="coupon"]').attr('checked',true);
473
  });
474
  $j('#export_subscription').click(function(){
475
+ $j('input:radio[name=dataset][value="subscription"]').attr('checked',true);
476
  });
477
  $j('#export_product_vendor').click(function(){
478
+ $j('input:radio[name=dataset][value="product_vendor"]').attr('checked',true);
479
  });
480
  $j('#export_commission').click(function(){
481
+ $j('input:radio[name=dataset][value="commission"]').attr('checked',true);
482
  });
483
  $j('#export_shipping_class').click(function(){
484
+ $j('input:radio[name=dataset][value="shipping_class"]').attr('checked',true);
485
  });
486
  $j('#export_ticket').click(function(){
487
+ $j('input:radio[name=dataset][value="ticket"]').attr('checked',true);
488
  });
489
  $j('#export_booking').click(function(){
490
+ $j('input:radio[name=dataset][value="booking"]').attr('checked',true);
491
  });
492
  $j('#export_attribute').click(function(){
493
+ $j('input:radio[name=dataset][value="attribute"]').attr('checked',true);
494
  });
495
 
496
  // Changing the Export Type will show/hide other options
497
+ $j("#export_type").change(function () {
498
+ var type = $j('select[name=export_type]').val();
499
+ $j('.export_type_options .export-options').hide();
500
  if( type == null )
501
  var type = 'product';
502
+ $j('.export_type_options .'+type+'-options').show();
503
  });
504
 
505
  // Changing the Export Method will show/hide other options
541
  $j('#'+type).trigger('click');
542
  }
543
  } else if ( href.toLowerCase().indexOf('tab=settings') >= 0 ) {
544
+ $j("#export_type").trigger("change");
545
  $j("#auto_method").trigger("change");
546
  } else {
547
  // This auto-selects the last known export type based on stored WordPress option, defaults to Products
templates/admin/quick_export-brand.php CHANGED
@@ -15,13 +15,16 @@
15
  </p>
16
  <table id="brand-fields" class="ui-sortable striped">
17
 
18
- <?php foreach( $brand_fields as $brand_field ) { ?>
19
- <tr id="brand-<?php echo $brand_field['reset']; ?>">
20
  <td>
21
- <label<?php if( isset( $brand_field['hover'] ) ) { ?> title="<?php echo $brand_field['hover']; ?>"<?php } ?>>
22
- <input type="checkbox" name="brand_fields[<?php echo $brand_field['name']; ?>]" class="brand_field"<?php ( isset( $brand_field['default'] ) ? checked( $brand_field['default'], 1 ) : '' ); ?> disabled="disabled" />
23
- <?php echo $brand_field['label']; ?>
24
- <input type="hidden" name="brand_fields_order[<?php echo $brand_field['name']; ?>]" class="field_order" value="<?php echo $brand_field['order']; ?>" />
 
 
 
25
  </label>
26
  </td>
27
  </tr>
15
  </p>
16
  <table id="brand-fields" class="ui-sortable striped">
17
 
18
+ <?php foreach( $brand_fields as $field ) { ?>
19
+ <tr id="brand-<?php echo $field['reset']; ?>">
20
  <td>
21
+ <label<?php if( isset( $field['hover'] ) ) { ?> title="<?php echo $field['hover']; ?>"<?php } ?>>
22
+ <input type="checkbox" name="brand_fields[<?php echo $field['name']; ?>]" class="brand_field"<?php ( isset( $field['default'] ) ? checked( $field['default'], 1 ) : '' ); ?> disabled="disabled" />
23
+ <span class="field_title"><?php echo $field['label']; ?></span>
24
+ <?php if( isset( $field['hover'] ) && apply_filters( 'woo_ce_export_fields_hover_label', true, 'brand' ) ) { ?>
25
+ <span class="field_hover"><?php echo $field['hover']; ?></span>
26
+ <?php } ?>
27
+ <input type="hidden" name="brand_fields_order[<?php echo $field['name']; ?>]" class="field_order" value="<?php echo $field['order']; ?>" />
28
  </label>
29
  </td>
30
  </tr>
templates/admin/quick_export-category.php CHANGED
@@ -15,13 +15,16 @@
15
  </p>
16
  <table id="category-fields" class="ui-sortable striped">
17
 
18
- <?php foreach( $category_fields as $category_field ) { ?>
19
- <tr id="category-<?php echo $category_field['reset']; ?>">
20
  <td>
21
- <label<?php if( isset( $category_field['hover'] ) ) { ?> title="<?php echo $category_field['hover']; ?>"<?php } ?>>
22
- <input type="checkbox" name="category_fields[<?php echo $category_field['name']; ?>]" class="category_field"<?php ( isset( $category_field['default'] ) ? checked( $category_field['default'], 1 ) : '' ); ?><?php disabled( $category_field['disabled'], 1 ); ?> />
23
- <?php echo $category_field['label']; ?>
24
- <input type="hidden" name="category_fields_order[<?php echo $category_field['name']; ?>]" class="field_order" value="<?php echo $category_field['order']; ?>" />
 
 
 
25
  </label>
26
  </td>
27
  </tr>
15
  </p>
16
  <table id="category-fields" class="ui-sortable striped">
17
 
18
+ <?php foreach( $category_fields as $field ) { ?>
19
+ <tr id="category-<?php echo $field['reset']; ?>">
20
  <td>
21
+ <label<?php if( isset( $field['hover'] ) ) { ?> title="<?php echo $field['hover']; ?>"<?php } ?>>
22
+ <input type="checkbox" name="category_fields[<?php echo $field['name']; ?>]" class="category_field"<?php ( isset( $field['default'] ) ? checked( $field['default'], 1 ) : '' ); ?><?php disabled( $field['disabled'], 1 ); ?> />
23
+ <span class="field_title"><?php echo $field['label']; ?></span>
24
+ <?php if( isset( $field['hover'] ) && apply_filters( 'woo_ce_export_fields_hover_label', true, 'category' ) ) { ?>
25
+ <span class="field_hover"><?php echo $field['hover']; ?></span>
26
+ <?php } ?>
27
+ <input type="hidden" name="category_fields_order[<?php echo $field['name']; ?>]" class="field_order" value="<?php echo $field['order']; ?>" />
28
  </label>
29
  </td>
30
  </tr>
templates/admin/quick_export-commission.php CHANGED
@@ -15,13 +15,16 @@
15
  </p>
16
  <table id="commission-fields" class="ui-sortable striped">
17
 
18
- <?php foreach( $commission_fields as $commission_field ) { ?>
19
- <tr id="commission-<?php echo $commission_field['reset']; ?>">
20
  <td>
21
- <label<?php if( isset( $commission_field['hover'] ) ) { ?> title="<?php echo $commission_field['hover']; ?>"<?php } ?>>
22
- <input type="checkbox" name="commission_fields[<?php echo $commission_field['name']; ?>]" class="commission_field"<?php ( isset( $commission_field['default'] ) ? checked( $commission_field['default'], 1 ) : '' ); ?> disabled="disabled" />
23
- <?php echo $commission_field['label']; ?>
24
- <input type="hidden" name="commission_fields_order[<?php echo $commission_field['name']; ?>]" class="field_order" value="<?php echo $commission_field['order']; ?>" />
 
 
 
25
  </label>
26
  </td>
27
  </tr>
15
  </p>
16
  <table id="commission-fields" class="ui-sortable striped">
17
 
18
+ <?php foreach( $commission_fields as $field ) { ?>
19
+ <tr id="commission-<?php echo $field['reset']; ?>">
20
  <td>
21
+ <label<?php if( isset( $field['hover'] ) ) { ?> title="<?php echo $field['hover']; ?>"<?php } ?>>
22
+ <input type="checkbox" name="commission_fields[<?php echo $field['name']; ?>]" class="commission_field"<?php ( isset( $field['default'] ) ? checked( $field['default'], 1 ) : '' ); ?> disabled="disabled" />
23
+ <span class="field_title"><?php echo $field['label']; ?></span>
24
+ <?php if( isset( $field['hover'] ) && apply_filters( 'woo_ce_export_fields_hover_label', true, 'commission' ) ) { ?>
25
+ <span class="field_hover"><?php echo $field['hover']; ?></span>
26
+ <?php } ?>
27
+ <input type="hidden" name="commission_fields_order[<?php echo $field['name']; ?>]" class="field_order" value="<?php echo $field['order']; ?>" />
28
  </label>
29
  </td>
30
  </tr>
templates/admin/quick_export-coupon.php CHANGED
@@ -15,13 +15,16 @@
15
  </p>
16
  <table id="coupon-fields" class="ui-sortable striped">
17
 
18
- <?php foreach( $coupon_fields as $coupon_field ) { ?>
19
- <tr id="coupon-<?php echo $coupon_field['reset']; ?>">
20
  <td>
21
- <label<?php if( isset( $coupon_field['hover'] ) ) { ?> title="<?php echo $coupon_field['hover']; ?>"<?php } ?>>
22
- <input type="checkbox" name="coupon_fields[<?php echo $coupon_field['name']; ?>]" class="coupon_field"<?php ( isset( $coupon_field['default'] ) ? checked( $coupon_field['default'], 1 ) : '' ); ?> disabled="disabled" />
23
- <?php echo $coupon_field['label']; ?>
24
- <input type="hidden" name="coupon_fields_order[<?php echo $coupon_field['name']; ?>]" class="field_order" value="<?php echo $coupon_field['order']; ?>" />
 
 
 
25
  </label>
26
  </td>
27
  </tr>
15
  </p>
16
  <table id="coupon-fields" class="ui-sortable striped">
17
 
18
+ <?php foreach( $coupon_fields as $field ) { ?>
19
+ <tr id="coupon-<?php echo $field['reset']; ?>">
20
  <td>
21
+ <label<?php if( isset( $field['hover'] ) ) { ?> title="<?php echo $field['hover']; ?>"<?php } ?>>
22
+ <input type="checkbox" name="coupon_fields[<?php echo $field['name']; ?>]" class="coupon_field"<?php ( isset( $field['default'] ) ? checked( $field['default'], 1 ) : '' ); ?> disabled="disabled" />
23
+ <span class="field_title"><?php echo $field['label']; ?></span>
24
+ <?php if( isset( $field['hover'] ) && apply_filters( 'woo_ce_export_fields_hover_label', true, 'coupon' ) ) { ?>
25
+ <span class="field_hover"><?php echo $field['hover']; ?></span>
26
+ <?php } ?>
27
+ <input type="hidden" name="coupon_fields_order[<?php echo $field['name']; ?>]" class="field_order" value="<?php echo $field['order']; ?>" />
28
  </label>
29
  </td>
30
  </tr>
templates/admin/quick_export-customer.php CHANGED
@@ -15,13 +15,16 @@
15
  </p>
16
  <table id="customer-fields" class="ui-sortable striped">
17
 
18
- <?php foreach( $customer_fields as $customer_field ) { ?>
19
- <tr id="customer-<?php echo $customer_field['reset']; ?>">
20
  <td>
21
- <label<?php if( isset( $customer_field['hover'] ) ) { ?> title="<?php echo $customer_field['hover']; ?>"<?php } ?>>
22
- <input type="checkbox" name="customer_fields[<?php echo $customer_field['name']; ?>]" class="customer_field"<?php ( isset( $customer_field['default'] ) ? checked( $customer_field['default'], 1 ) : '' ); ?> disabled="disabled" />
23
- <?php echo $customer_field['label']; ?>
24
- <input type="hidden" name="customer_fields_order[<?php echo $customer_field['name']; ?>]" class="field_order" value="<?php echo $customer_field['order']; ?>" />
 
 
 
25
  </label>
26
  </td>
27
  </tr>
15
  </p>
16
  <table id="customer-fields" class="ui-sortable striped">
17
 
18
+ <?php foreach( $customer_fields as $field ) { ?>
19
+ <tr id="customer-<?php echo $field['reset']; ?>">
20
  <td>
21
+ <label<?php if( isset( $field['hover'] ) ) { ?> title="<?php echo $field['hover']; ?>"<?php } ?>>
22
+ <input type="checkbox" name="customer_fields[<?php echo $field['name']; ?>]" class="customer_field"<?php ( isset( $field['default'] ) ? checked( $field['default'], 1 ) : '' ); ?> disabled="disabled" />
23
+ <span class="field_title"><?php echo $field['label']; ?></span>
24
+ <?php if( isset( $field['hover'] ) && apply_filters( 'woo_ce_export_fields_hover_label', true, 'customer' ) ) { ?>
25
+ <span class="field_hover"><?php echo $field['hover']; ?></span>
26
+ <?php } ?>
27
+ <input type="hidden" name="customer_fields_order[<?php echo $field['name']; ?>]" class="field_order" value="<?php echo $field['order']; ?>" />
28
  </label>
29
  </td>
30
  </tr>
templates/admin/quick_export-order.php CHANGED
@@ -4,11 +4,11 @@
4
  <div class="postbox">
5
  <h3 class="hndle">
6
  <?php _e( 'Order Fields', 'woocommerce-exporter' ); ?>
 
7
  </h3>
8
  <div class="inside">
9
-
10
  <?php if( $order ) { ?>
11
- <p class="description"><?php _e( 'Select the Order fields you would like to export.', 'woocommerce-exporter' ); ?></p>
12
  <p>
13
  <a href="javascript:void(0)" id="order-checkall" class="checkall"><?php _e( 'Check All', 'woocommerce-exporter' ); ?></a> |
14
  <a href="javascript:void(0)" id="order-uncheckall" class="uncheckall"><?php _e( 'Uncheck All', 'woocommerce-exporter' ); ?></a> |
@@ -16,13 +16,16 @@
16
  </p>
17
  <table id="order-fields" class="ui-sortable striped">
18
 
19
- <?php foreach( $order_fields as $order_field ) { ?>
20
- <tr id="order-<?php echo $order_field['reset']; ?>">
21
  <td>
22
- <label<?php if( isset( $order_field['hover'] ) ) { ?> title="<?php echo $order_field['hover']; ?>"<?php } ?>>
23
- <input type="checkbox" name="order_fields[<?php echo $order_field['name']; ?>]" class="order_field"<?php ( isset( $order_field['default'] ) ? checked( $order_field['default'], 1 ) : '' ); ?> disabled="disabled" />
24
- <?php echo $order_field['label']; ?>
25
- <input type="hidden" name="order_fields_order[<?php echo $order_field['name']; ?>]" class="field_order" value="<?php echo $order_field['order']; ?>" />
 
 
 
26
  </label>
27
  </td>
28
  </tr>
@@ -30,13 +33,12 @@
30
  <?php } ?>
31
  </table>
32
  <p class="submit">
33
- <input type="button" class="button button-disabled" value="<?php _e( 'Export Orders', 'woocommerce-exporter' ); ?>" />
34
  </p>
35
  <p class="description"><?php _e( 'Can\'t find a particular Order field in the above export list?', 'woocommerce-exporter' ); ?> <a href="<?php echo $troubleshooting_url; ?>" target="_blank"><?php _e( 'Get in touch', 'woocommerce-exporter' ); ?></a>.</p>
36
  <?php } else { ?>
37
  <p><?php _e( 'No Orders were found.', 'woocommerce-exporter' ); ?></p>
38
  <?php } ?>
39
-
40
  </div>
41
  </div>
42
  <!-- .postbox -->
@@ -55,6 +57,7 @@
55
 
56
  </div>
57
  <!-- .inside -->
 
58
  </div>
59
  <!-- .postbox -->
60
 
4
  <div class="postbox">
5
  <h3 class="hndle">
6
  <?php _e( 'Order Fields', 'woocommerce-exporter' ); ?>
7
+ <a href="<?php echo esc_url( add_query_arg( array( 'tab' => 'fields', 'type' => 'order' ) ) ); ?>" style="float:right;"><?php _e( 'Configure', 'woocommerce-exporter' ); ?></a>
8
  </h3>
9
  <div class="inside">
 
10
  <?php if( $order ) { ?>
11
+ <p class="description"><?php _e( 'Select the Order fields you would like to export, you can also drag-and-drop to reorder export fields. To the right you can change the label of export fields from the Configure link. Your field selection - but not filters - are saved for future exports.', 'woocommerce-exporter' ); ?></p>
12
  <p>
13
  <a href="javascript:void(0)" id="order-checkall" class="checkall"><?php _e( 'Check All', 'woocommerce-exporter' ); ?></a> |
14
  <a href="javascript:void(0)" id="order-uncheckall" class="uncheckall"><?php _e( 'Uncheck All', 'woocommerce-exporter' ); ?></a> |
16
  </p>
17
  <table id="order-fields" class="ui-sortable striped">
18
 
19
+ <?php foreach( $order_fields as $field ) { ?>
20
+ <tr id="order-<?php echo $field['reset']; ?>">
21
  <td>
22
+ <label<?php if( isset( $field['hover'] ) ) { ?> title="<?php echo $field['hover']; ?>"<?php } ?>>
23
+ <input type="checkbox" name="order_fields[<?php echo $field['name']; ?>]" class="order_field"<?php ( isset( $field['default'] ) ? checked( $field['default'], 1 ) : '' ); ?><?php disabled( $field['disabled'], 1 ); ?> />
24
+ <span class="field_title"><?php echo $field['label']; ?><?php if( $field['disabled'] ) { ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span><?php } ?></span>
25
+ <?php if( isset( $field['hover'] ) && apply_filters( 'woo_ce_export_fields_hover_label', true, 'order' ) ) { ?>
26
+ <span class="field_hover"><?php echo $field['hover']; ?></span>
27
+ <?php } ?>
28
+ <input type="hidden" name="order_fields_order[<?php echo $field['name']; ?>]" class="field_order" value="<?php echo $field['order']; ?>" />
29
  </label>
30
  </td>
31
  </tr>
33
  <?php } ?>
34
  </table>
35
  <p class="submit">
36
+ <input type="submit" id="export_order" class="button-primary" value="<?php _e( 'Export Orders', 'woocommerce-exporter' ); ?>" />
37
  </p>
38
  <p class="description"><?php _e( 'Can\'t find a particular Order field in the above export list?', 'woocommerce-exporter' ); ?> <a href="<?php echo $troubleshooting_url; ?>" target="_blank"><?php _e( 'Get in touch', 'woocommerce-exporter' ); ?></a>.</p>
39
  <?php } else { ?>
40
  <p><?php _e( 'No Orders were found.', 'woocommerce-exporter' ); ?></p>
41
  <?php } ?>
 
42
  </div>
43
  </div>
44
  <!-- .postbox -->
57
 
58
  </div>
59
  <!-- .inside -->
60
+
61
  </div>
62
  <!-- .postbox -->
63
 
templates/admin/quick_export-product.php CHANGED
@@ -16,14 +16,16 @@
16
  </p>
17
  <table id="product-fields" class="ui-sortable striped">
18
 
19
- <?php foreach( $product_fields as $product_field ) { ?>
20
- <tr id="product-<?php echo $product_field['reset']; ?>">
21
  <td>
22
- <label<?php if( isset( $product_field['hover'] ) ) { ?> title="<?php echo $product_field['hover']; ?>"<?php } ?>>
23
- <input type="checkbox" name="product_fields[<?php echo $product_field['name']; ?>]" class="product_field"<?php ( isset( $product_field['default'] ) ? checked( $product_field['default'], 1 ) : '' ); ?><?php disabled( $product_field['disabled'], 1 ); ?> />
24
- <?php echo $product_field['label']; ?>
25
- <?php if( $product_field['disabled'] ) { ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span><?php } ?>
26
- <input type="hidden" name="product_fields_order[<?php echo $product_field['name']; ?>]" class="field_order" value="<?php echo $product_field['order']; ?>" />
 
 
27
  </label>
28
  </td>
29
  </tr>
@@ -55,7 +57,6 @@
55
 
56
  </div>
57
  <!-- .inside -->
58
-
59
  </div>
60
  <!-- .postbox -->
61
 
16
  </p>
17
  <table id="product-fields" class="ui-sortable striped">
18
 
19
+ <?php foreach( $product_fields as $field ) { ?>
20
+ <tr id="product-<?php echo $field['reset']; ?>">
21
  <td>
22
+ <label<?php if( isset( $field['hover'] ) ) { ?> title="<?php echo $field['hover']; ?>"<?php } ?>>
23
+ <input type="checkbox" name="product_fields[<?php echo $field['name']; ?>]" class="product_field"<?php ( isset( $field['default'] ) ? checked( $field['default'], 1 ) : '' ); ?><?php disabled( $field['disabled'], 1 ); ?> />
24
+ <span class="field_title"><?php echo $field['label']; ?><?php if( $field['disabled'] ) { ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span><?php } ?></span>
25
+ <?php if( isset( $field['hover'] ) && apply_filters( 'woo_ce_export_fields_hover_label', true, 'product' ) ) { ?>
26
+ <span class="field_hover"><?php echo $field['hover']; ?></span>
27
+ <?php } ?>
28
+ <input type="hidden" name="product_fields_order[<?php echo $field['name']; ?>]" class="field_order" value="<?php echo $field['order']; ?>" />
29
  </label>
30
  </td>
31
  </tr>
57
 
58
  </div>
59
  <!-- .inside -->
 
60
  </div>
61
  <!-- .postbox -->
62
 
templates/admin/quick_export-product_vendor.php CHANGED
@@ -15,13 +15,16 @@
15
  </p>
16
  <table id="product_vendor-fields" class="ui-sortable striped">
17
 
18
- <?php foreach( $product_vendor_fields as $product_vendor_field ) { ?>
19
- <tr id="product_vendor-<?php echo $product_vendor_field['reset']; ?>">
20
  <td>
21
- <label<?php if( isset( $product_vendor_field['hover'] ) ) { ?> title="<?php echo $product_vendor_field['hover']; ?>"<?php } ?>>
22
- <input type="checkbox" name="product_vendor_fields[<?php echo $product_vendor_field['name']; ?>]" class="product_vendor_field"<?php ( isset( $product_vendor_field['default'] ) ? checked( $product_vendor_field['default'], 1 ) : '' ); ?> disabled="disabled" />
23
- <?php echo $product_vendor_field['label']; ?>
24
- <input type="hidden" name="product_vendor_fields_order[<?php echo $product_vendor_field['name']; ?>]" class="field_order" value="<?php echo $product_vendor_field['order']; ?>" />
 
 
 
25
  </label>
26
  </td>
27
  </tr>
15
  </p>
16
  <table id="product_vendor-fields" class="ui-sortable striped">
17
 
18
+ <?php foreach( $product_vendor_fields as $field ) { ?>
19
+ <tr id="product_vendor-<?php echo $field['reset']; ?>">
20
  <td>
21
+ <label<?php if( isset( $field['hover'] ) ) { ?> title="<?php echo $field['hover']; ?>"<?php } ?>>
22
+ <input type="checkbox" name="product_vendor_fields[<?php echo $field['name']; ?>]" class="product_vendor_field"<?php ( isset( $field['default'] ) ? checked( $field['default'], 1 ) : '' ); ?> disabled="disabled" />
23
+ <span class="field_title"><?php echo $field['label']; ?></span>
24
+ <?php if( isset( $field['hover'] ) && apply_filters( 'woo_ce_export_fields_hover_label', true, 'product_vendor' ) ) { ?>
25
+ <span class="field_hover"><?php echo $field['hover']; ?></span>
26
+ <?php } ?>
27
+ <input type="hidden" name="product_vendor_fields_order[<?php echo $field['name']; ?>]" class="field_order" value="<?php echo $field['order']; ?>" />
28
  </label>
29
  </td>
30
  </tr>
templates/admin/quick_export-review.php CHANGED
@@ -15,13 +15,16 @@
15
  </p>
16
  <table id="review-fields" class="ui-sortable striped">
17
 
18
- <?php foreach( $review_fields as $review_field ) { ?>
19
  <tr id="review-<?php echo $review_field['reset']; ?>">
20
  <td>
21
- <label<?php if( isset( $review_field['hover'] ) ) { ?> title="<?php echo $review_field['hover']; ?>"<?php } ?>>
22
- <input type="checkbox" name="review_fields[<?php echo $review_field['name']; ?>]" class="review_field"<?php ( isset( $review_field['default'] ) ? checked( $review_field['default'], 1 ) : '' ); ?> disabled="disabled" />
23
- <?php echo $review_field['label']; ?>
24
- <input type="hidden" name="review_fields_order[<?php echo $review_field['name']; ?>]" class="field_order" value="<?php echo $review_field['order']; ?>" />
 
 
 
25
  </label>
26
  </td>
27
  </tr>
15
  </p>
16
  <table id="review-fields" class="ui-sortable striped">
17
 
18
+ <?php foreach( $review_fields as $field ) { ?>
19
  <tr id="review-<?php echo $review_field['reset']; ?>">
20
  <td>
21
+ <label<?php if( isset( $field['hover'] ) ) { ?> title="<?php echo $field['hover']; ?>"<?php } ?>>
22
+ <input type="checkbox" name="review_fields[<?php echo $field['name']; ?>]" class="review_field"<?php ( isset( $field['default'] ) ? checked( $field['default'], 1 ) : '' ); ?> disabled="disabled" />
23
+ <span class="field_title"><?php echo $field['label']; ?></span>
24
+ <?php if( isset( $field['hover'] ) && apply_filters( 'woo_ce_export_fields_hover_label', true, 'review' ) ) { ?>
25
+ <span class="field_hover"><?php echo $field['hover']; ?></span>
26
+ <?php } ?>
27
+ <input type="hidden" name="review_fields_order[<?php echo $field['name']; ?>]" class="field_order" value="<?php echo $field['order']; ?>" />
28
  </label>
29
  </td>
30
  </tr>
templates/admin/quick_export-shipping_class.php CHANGED
@@ -15,13 +15,16 @@
15
  </p>
16
  <table id="shipping_class-fields" class="ui-sortable striped">
17
 
18
- <?php foreach( $shipping_class_fields as $shipping_class_field ) { ?>
19
- <tr id="shipping_class-<?php echo $shipping_class_field['reset']; ?>">
20
  <td>
21
- <label<?php if( isset( $shipping_class_field['hover'] ) ) { ?> title="<?php echo $shipping_class_field['hover']; ?>"<?php } ?>>
22
- <input type="checkbox" name="shipping_class_fields[<?php echo $shipping_class_field['name']; ?>]" class="shipping_class_field"<?php ( isset( $shipping_class_field['default'] ) ? checked( $shipping_class_field['default'], 1 ) : '' ); ?> disabled="disabled" />
23
- <?php echo $shipping_class_field['label']; ?>
24
- <input type="hidden" name="shipping_class_fields_order[<?php echo $shipping_class_field['name']; ?>]" class="field_order" value="<?php echo $shipping_class_field['order']; ?>" />
 
 
 
25
  </label>
26
  </td>
27
  </tr>
15
  </p>
16
  <table id="shipping_class-fields" class="ui-sortable striped">
17
 
18
+ <?php foreach( $shipping_class_fields as $field ) { ?>
19
+ <tr id="shipping_class-<?php echo $field['reset']; ?>">
20
  <td>
21
+ <label<?php if( isset( $field['hover'] ) ) { ?> title="<?php echo $field['hover']; ?>"<?php } ?>>
22
+ <input type="checkbox" name="shipping_class_fields[<?php echo $field['name']; ?>]" class="shipping_class_field"<?php ( isset( $field['default'] ) ? checked( $field['default'], 1 ) : '' ); ?> disabled="disabled" />
23
+ <span class="field_title"><?php echo $field['label']; ?></span>
24
+ <?php if( isset( $field['hover'] ) && apply_filters( 'woo_ce_export_fields_hover_label', true, 'shipping_class' ) ) { ?>
25
+ <span class="field_hover"><?php echo $field['hover']; ?></span>
26
+ <?php } ?>
27
+ <input type="hidden" name="shipping_class_fields_order[<?php echo $field['name']; ?>]" class="field_order" value="<?php echo $field['order']; ?>" />
28
  </label>
29
  </td>
30
  </tr>
templates/admin/quick_export-subscription.php CHANGED
@@ -15,13 +15,16 @@
15
  </p>
16
  <table id="subscription-fields" class="ui-sortable striped">
17
 
18
- <?php foreach( $subscription_fields as $subscription_field ) { ?>
19
- <tr id="subscription-<?php echo $subscription_field['reset']; ?>">
20
  <td>
21
- <label<?php if( isset( $subscription_field['hover'] ) ) { ?> title="<?php echo $subscription_field['hover']; ?>"<?php } ?>>
22
- <input type="checkbox" name="subscription_fields[<?php echo $subscription_field['name']; ?>]" class="subscription_field"<?php ( isset( $subscription_field['default'] ) ? checked( $subscription_field['default'], 1 ) : '' ); ?> disabled="disabled" />
23
- <?php echo $subscription_field['label']; ?>
24
- <input type="hidden" name="subscription_fields_order[<?php echo $subscription_field['name']; ?>]" class="field_order" value="<?php echo $subscription_field['order']; ?>" />
 
 
 
25
  </label>
26
  </td>
27
  </tr>
15
  </p>
16
  <table id="subscription-fields" class="ui-sortable striped">
17
 
18
+ <?php foreach( $subscription_fields as $field ) { ?>
19
+ <tr id="subscription-<?php echo $field['reset']; ?>">
20
  <td>
21
+ <label<?php if( isset( $field['hover'] ) ) { ?> title="<?php echo $field['hover']; ?>"<?php } ?>>
22
+ <input type="checkbox" name="subscription_fields[<?php echo $field['name']; ?>]" class="subscription_field"<?php ( isset( $field['default'] ) ? checked( $field['default'], 1 ) : '' ); ?> disabled="disabled" />
23
+ <span class="field_title"><?php echo $field['label']; ?></span>
24
+ <?php if( isset( $field['hover'] ) && apply_filters( 'woo_ce_export_fields_hover_label', true, 'subscription' ) ) { ?>
25
+ <span class="field_hover"><?php echo $field['hover']; ?></span>
26
+ <?php } ?>
27
+ <input type="hidden" name="subscription_fields_order[<?php echo $field['name']; ?>]" class="field_order" value="<?php echo $field['order']; ?>" />
28
  </label>
29
  </td>
30
  </tr>
templates/admin/quick_export-tag.php CHANGED
@@ -15,13 +15,16 @@
15
  </p>
16
  <table id="tag-fields" class="ui-sortable striped">
17
 
18
- <?php foreach( $tag_fields as $tag_field ) { ?>
19
- <tr id="tag-<?php echo $tag_field['reset']; ?>">
20
  <td>
21
- <label<?php if( isset( $tag_field['hover'] ) ) { ?> title="<?php echo $tag_field['hover']; ?>"<?php } ?>>
22
- <input type="checkbox" name="tag_fields[<?php echo $tag_field['name']; ?>]" class="tag_field"<?php ( isset( $tag_field['default'] ) ? checked( $tag_field['default'], 1 ) : '' ); ?><?php disabled( $tag_field['disabled'], 1 ); ?> />
23
- <?php echo $tag_field['label']; ?>
24
- <input type="hidden" name="tag_fields_order[<?php echo $tag_field['name']; ?>]" class="field_order" value="<?php echo $tag_field['order']; ?>" />
 
 
 
25
  </label>
26
  </td>
27
  </tr>
15
  </p>
16
  <table id="tag-fields" class="ui-sortable striped">
17
 
18
+ <?php foreach( $tag_fields as $field ) { ?>
19
+ <tr id="tag-<?php echo $field['reset']; ?>">
20
  <td>
21
+ <label<?php if( isset( $field['hover'] ) ) { ?> title="<?php echo $field['hover']; ?>"<?php } ?>>
22
+ <input type="checkbox" name="tag_fields[<?php echo $field['name']; ?>]" class="tag_field"<?php ( isset( $field['default'] ) ? checked( $field['default'], 1 ) : '' ); ?><?php disabled( $field['disabled'], 1 ); ?> />
23
+ <span class="field_title"><?php echo $field['label']; ?></span>
24
+ <?php if( isset( $field['hover'] ) && apply_filters( 'woo_ce_export_fields_hover_label', true, 'tag' ) ) { ?>
25
+ <span class="field_hover"><?php echo $field['hover']; ?></span>
26
+ <?php } ?>
27
+ <input type="hidden" name="tag_fields_order[<?php echo $field['name']; ?>]" class="field_order" value="<?php echo $field['order']; ?>" />
28
  </label>
29
  </td>
30
  </tr>
templates/admin/quick_export-user.php CHANGED
@@ -16,14 +16,16 @@
16
  </p>
17
  <table id="user-fields" class="ui-sortable striped">
18
 
19
- <?php foreach( $user_fields as $user_field ) { ?>
20
- <tr id="user-<?php echo $user_field['reset']; ?>">
21
  <td>
22
- <label<?php if( isset( $user_field['hover'] ) ) { ?> title="<?php echo $user_field['hover']; ?>"<?php } ?>>
23
- <input type="checkbox" name="user_fields[<?php echo $user_field['name']; ?>]" class="user_field"<?php ( isset( $user_field['default'] ) ? checked( $user_field['default'], 1 ) : '' ); ?><?php disabled( $user_field['disabled'], 1 ); ?> />
24
- <?php echo $user_field['label']; ?>
25
- <?php if( $user_field['disabled'] ) { ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span><?php } ?>
26
- <input type="hidden" name="user_fields_order[<?php echo $user_field['name']; ?>]" class="field_order" value="<?php echo $user_field['order']; ?>" />
 
 
27
  </label>
28
  </td>
29
  </tr>
16
  </p>
17
  <table id="user-fields" class="ui-sortable striped">
18
 
19
+ <?php foreach( $user_fields as $field ) { ?>
20
+ <tr id="user-<?php echo $field['reset']; ?>">
21
  <td>
22
+ <label<?php if( isset( $field['hover'] ) ) { ?> title="<?php echo $field['hover']; ?>"<?php } ?>>
23
+ <input type="checkbox" name="user_fields[<?php echo $field['name']; ?>]" class="user_field"<?php ( isset( $field['default'] ) ? checked( $field['default'], 1 ) : '' ); ?><?php disabled( $field['disabled'], 1 ); ?> />
24
+ <span class="field_title"><?php echo $field['label']; ?><?php if( $field['disabled'] ) { ?><span class="description"> - <?php printf( __( 'available in %s', 'woocommerce-exporter' ), $woo_cd_link ); ?></span><?php } ?></span>
25
+ <?php if( isset( $field['hover'] ) && apply_filters( 'woo_ce_export_fields_hover_label', true, 'user' ) ) { ?>
26
+ <span class="field_hover"><?php echo $field['hover']; ?></span>
27
+ <?php } ?>
28
+ <input type="hidden" name="user_fields_order[<?php echo $field['name']; ?>]" class="field_order" value="<?php echo $field['order']; ?>" />
29
  </label>
30
  </td>
31
  </tr>
templates/admin/woo-admin_ce-export_export.php CHANGED
@@ -51,9 +51,6 @@
51
  </th>
52
  <td>
53
  <span class="description">(<?php echo $orders; ?>)</span>
54
- <?php if( !function_exists( 'woo_cd_admin_init' ) ) { ?>
55
- <span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
56
- <?php } ?>
57
  </td>
58
  </tr>
59
 
51
  </th>
52
  <td>
53
  <span class="description">(<?php echo $orders; ?>)</span>
 
 
 
54
  </td>
55
  </tr>
56