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