Version Description
- 2018-06-08 =
- Added filter by item name
- Added filter by item metadata
- Added operators <,>,>=,<
Download this release
Release Info
Developer | algol.plus |
Plugin | Advanced Order Export For WooCommerce |
Version | 1.5.5 |
Comparing to | |
See all releases |
Code changes from version 1.5.4 to 1.5.5
- assets/css/export.css +24 -9
- assets/img/calendar.png +0 -0
- assets/js/export.js +147 -0
- assets/js/settings-form.js +989 -0
- classes/admin/class-wc-order-export-ajax.php +10 -1
- classes/admin/class-wc-order-export-manage.php +9 -1
- classes/class-wc-order-export-admin.php +72 -9
- classes/core/class-wc-order-export-data-extractor-ui.php +53 -11
- classes/core/class-wc-order-export-data-extractor.php +172 -66
- classes/core/class-wc-order-export-engine.php +81 -10
- classes/formats/abstract-class-woe-formatter-sv.php +13 -6
- classes/formats/class-woe-formatter-xls.php +1 -2
- i18n/languages/woo-order-export-lite.pot +317 -291
- readme.txt +19 -4
- view/settings-form.php +80 -902
- view/tab/tools.php +1 -1
- woo-order-export-lite.php +2 -2
assets/css/export.css
CHANGED
@@ -228,7 +228,9 @@ input.date{
|
|
228 |
#schedule-1{
|
229 |
margin-top: 8px;
|
230 |
}
|
231 |
-
#schedule-2,
|
|
|
|
|
232 |
margin-top: 8px;
|
233 |
}
|
234 |
.ftp-settings label{
|
@@ -326,7 +328,7 @@ input.date{
|
|
326 |
margin-left: 10px !important;
|
327 |
}
|
328 |
|
329 |
-
#add_attributes,#add_taxonomies,#add_shipping_locations,#add_billing_locations,#add_custom_fields,#add_product_custom_fields{
|
330 |
font-size: large;
|
331 |
}
|
332 |
|
@@ -334,7 +336,7 @@ input.date{
|
|
334 |
margin-bottom: 5px;
|
335 |
}
|
336 |
|
337 |
-
#select_attributes,#select_taxonomies,#text_shipping_locations,#text_billing_locations,#select_custom_fields,#select_product_custom_fields
|
338 |
width: 120px;
|
339 |
}
|
340 |
.dashicons{
|
@@ -580,17 +582,20 @@ input.date{
|
|
580 |
width: 120px;
|
581 |
}
|
582 |
|
583 |
-
#d-schedule-3 .block
|
|
|
584 |
margin-left: 20px;
|
585 |
margin-right: 5px;
|
586 |
}
|
587 |
|
588 |
-
#d-schedule-3 .block.disabled
|
|
|
589 |
pointer-events: none;
|
590 |
opacity: 0.7;
|
591 |
}
|
592 |
|
593 |
-
#d-schedule-3 .input-times
|
|
|
594 |
width: 100%;
|
595 |
min-height: 30px;
|
596 |
background-color: white;
|
@@ -601,7 +606,8 @@ input.date{
|
|
601 |
display: inline-block;
|
602 |
}
|
603 |
|
604 |
-
#d-schedule-3 .time
|
|
|
605 |
background-color: #e4e4e4;
|
606 |
border: 1px solid #aaa;
|
607 |
border-radius: 4px;
|
@@ -611,7 +617,8 @@ input.date{
|
|
611 |
padding: 0 5px;
|
612 |
}
|
613 |
|
614 |
-
#d-schedule-3 .btn-delete
|
|
|
615 |
color: #999;
|
616 |
cursor: pointer;
|
617 |
display: inline-block;
|
@@ -619,6 +626,14 @@ input.date{
|
|
619 |
margin-right: 2px;
|
620 |
}
|
621 |
|
622 |
-
#d-schedule-3 .btn-delete:hover
|
|
|
623 |
color: #333;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
624 |
}
|
228 |
#schedule-1{
|
229 |
margin-top: 8px;
|
230 |
}
|
231 |
+
#schedule-2,
|
232 |
+
#schedule-3,
|
233 |
+
#schedule-4 {
|
234 |
margin-top: 8px;
|
235 |
}
|
236 |
.ftp-settings label{
|
328 |
margin-left: 10px !important;
|
329 |
}
|
330 |
|
331 |
+
#add_attributes,#add_taxonomies,#add_shipping_locations,#add_billing_locations,#add_custom_fields,#add_product_custom_fields,#add_item_names,#add_item_metadata{
|
332 |
font-size: large;
|
333 |
}
|
334 |
|
336 |
margin-bottom: 5px;
|
337 |
}
|
338 |
|
339 |
+
#select_attributes,#select_taxonomies,#text_shipping_locations,#text_billing_locations,#select_custom_fields,#select_product_custom_fields,#select_itemmeta,#text_item_names,#text_item_metadata{
|
340 |
width: 120px;
|
341 |
}
|
342 |
.dashicons{
|
582 |
width: 120px;
|
583 |
}
|
584 |
|
585 |
+
#d-schedule-3 .block,
|
586 |
+
#d-schedule-4 .block {
|
587 |
margin-left: 20px;
|
588 |
margin-right: 5px;
|
589 |
}
|
590 |
|
591 |
+
#d-schedule-3 .block.disabled,
|
592 |
+
#d-schedule-4 .block.disabled {
|
593 |
pointer-events: none;
|
594 |
opacity: 0.7;
|
595 |
}
|
596 |
|
597 |
+
#d-schedule-3 .input-times,
|
598 |
+
#d-schedule-4 .input-date-times {
|
599 |
width: 100%;
|
600 |
min-height: 30px;
|
601 |
background-color: white;
|
606 |
display: inline-block;
|
607 |
}
|
608 |
|
609 |
+
#d-schedule-3 .time,
|
610 |
+
#d-schedule-4 .time {
|
611 |
background-color: #e4e4e4;
|
612 |
border: 1px solid #aaa;
|
613 |
border-radius: 4px;
|
617 |
padding: 0 5px;
|
618 |
}
|
619 |
|
620 |
+
#d-schedule-3 .btn-delete,
|
621 |
+
#d-schedule-4 .btn-delete {
|
622 |
color: #999;
|
623 |
cursor: pointer;
|
624 |
display: inline-block;
|
626 |
margin-right: 2px;
|
627 |
}
|
628 |
|
629 |
+
#d-schedule-3 .btn-delete:hover,
|
630 |
+
#d-schedule-4 .btn-delete:hover {
|
631 |
color: #333;
|
632 |
+
}
|
633 |
+
|
634 |
+
#d-schedule-4 .date-picker .datetimes-date {
|
635 |
+
max-width: 120px;
|
636 |
+
height: 28px;
|
637 |
+
vertical-align: middle;
|
638 |
+
background: url("../img/calendar.png") 98px 5px no-repeat;
|
639 |
}
|
assets/img/calendar.png
ADDED
Binary file
|
assets/js/export.js
CHANGED
@@ -35,6 +35,10 @@ window.onload = function () {
|
|
35 |
return undefined;
|
36 |
}
|
37 |
} );
|
|
|
|
|
|
|
|
|
38 |
};
|
39 |
|
40 |
function bind_events() {
|
@@ -720,6 +724,128 @@ function bind_events() {
|
|
720 |
}
|
721 |
return false;
|
722 |
} )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
723 |
|
724 |
jQuery( '#summary_report_by_products_checkbox' ).on('change', function() {
|
725 |
jQuery('#manage_fields').parent().toggle(jQuery('#summary_report_by_products_checkbox').val());
|
@@ -838,6 +964,8 @@ function add_custom_field( to, index_p, format, colname, value ) {
|
|
838 |
</li>\
|
839 |
';
|
840 |
to.append( row );
|
|
|
|
|
841 |
}
|
842 |
|
843 |
function add_custom_meta( to, index_p, format, label, colname ) {
|
@@ -857,6 +985,17 @@ function add_custom_meta( to, index_p, format, label, colname ) {
|
|
857 |
</li>\
|
858 |
';
|
859 |
to.append( row );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
860 |
}
|
861 |
|
862 |
function formatItemSelection( item ) {
|
@@ -908,7 +1047,15 @@ function select2_inits()
|
|
908 |
} );
|
909 |
jQuery( "#billing_locations_check" ).select2(select2WODropdownOpts);
|
910 |
|
|
|
|
|
|
|
|
|
911 |
|
|
|
|
|
|
|
|
|
912 |
|
913 |
jQuery( "#product_categories" ).select2( {
|
914 |
ajax: {
|
35 |
return undefined;
|
36 |
}
|
37 |
} );
|
38 |
+
|
39 |
+
//force style for popup!
|
40 |
+
var style = jQuery('<style>#TB_ajaxContent { overflow: auto !important; }</style>');
|
41 |
+
jQuery('html > head').append(style);
|
42 |
};
|
43 |
|
44 |
function bind_events() {
|
724 |
}
|
725 |
return false;
|
726 |
} )
|
727 |
+
|
728 |
+
|
729 |
+
// ITEM NAMES
|
730 |
+
jQuery( '#item_names' ).change( function() {
|
731 |
+
|
732 |
+
jQuery( '#text_item_names' ).attr( 'disabled', 'disabled' );
|
733 |
+
var data = {
|
734 |
+
'item_type': jQuery( this ).val(),
|
735 |
+
method: "get_order_item_names",
|
736 |
+
action: "order_exporter"
|
737 |
+
};
|
738 |
+
|
739 |
+
jQuery.post( ajaxurl, data, function( response ) {
|
740 |
+
jQuery( '#text_item_names--select2 select' ).select2('destroy');
|
741 |
+
jQuery( '#text_item_names, #text_item_names--select2' ).remove();
|
742 |
+
if ( response ) {
|
743 |
+
var options = '';
|
744 |
+
jQuery.each( response, function( index, value ) {
|
745 |
+
options += '<option>' + value + '</option>';
|
746 |
+
} );
|
747 |
+
|
748 |
+
var $select = jQuery( '<div id="text_item_names--select2" style="margin-top: 0px;margin-right: 6px; vertical-align: top; display: inline-block;"><select id="text_item_names">' + options + '</select></div>' );
|
749 |
+
$select.insertBefore( jQuery( '#add_item_names' ) )
|
750 |
+
$select.find('select').select2({ tags: true });
|
751 |
+
}
|
752 |
+
else {
|
753 |
+
jQuery( '<input type="text" id="text_item_names" style="margin-right: 8px;">' ).insertBefore( jQuery( '#add_item_names' ) );
|
754 |
+
}
|
755 |
+
}, 'json' );
|
756 |
+
} );
|
757 |
+
|
758 |
+
jQuery( '#add_item_names' ).click( function() {
|
759 |
+
|
760 |
+
var val = jQuery( "#text_item_names" ).val();
|
761 |
+
var val2 = jQuery( '#item_names' ).val();
|
762 |
+
var val_op = jQuery( '#item_name_compare' ).val();
|
763 |
+
if ( val != null && val2 != null && val.length && val2.length ) {
|
764 |
+
val = val2 + val_op + val;
|
765 |
+
|
766 |
+
var f = true;
|
767 |
+
jQuery( '#item_names_check' ).next().find( 'ul li' ).each( function() {
|
768 |
+
if ( jQuery( this ).attr( 'title' ) == val ) {
|
769 |
+
f = false;
|
770 |
+
}
|
771 |
+
} );
|
772 |
+
|
773 |
+
if ( f ) {
|
774 |
+
|
775 |
+
jQuery( '#item_names_check' ).append( '<option selected="selected" value="' + val + '">' + val + '</option>' );
|
776 |
+
jQuery( '#item_names_check' ).select2(select2WODropdownOpts);
|
777 |
+
|
778 |
+
jQuery( '#item_names_check option' ).each( function() {
|
779 |
+
jQuery( '#item_names_check option[value=\"' + jQuery( this ).val() + '\"]:not(:last)' ).remove();
|
780 |
+
} );
|
781 |
+
|
782 |
+
jQuery( "input#text_item_names" ).val( '' );
|
783 |
+
}
|
784 |
+
}
|
785 |
+
return false;
|
786 |
+
} );
|
787 |
+
|
788 |
+
// ITEM METADATA
|
789 |
+
jQuery( '#item_metadata' ).change( function() {
|
790 |
+
|
791 |
+
jQuery( '#text_item_metadata' ).attr( 'disabled', 'disabled' );
|
792 |
+
var data = {
|
793 |
+
'meta_key': jQuery( this ).val(),
|
794 |
+
method: "get_order_item_meta_key_values",
|
795 |
+
action: "order_exporter"
|
796 |
+
};
|
797 |
+
|
798 |
+
jQuery.post( ajaxurl, data, function( response ) {
|
799 |
+
jQuery( '#text_item_metadata--select2 select' ).select2('destroy');
|
800 |
+
jQuery( '#text_item_metadata, #text_item_metadata--select2' ).remove();
|
801 |
+
if ( response ) {
|
802 |
+
var options = '';
|
803 |
+
jQuery.each( response, function( index, value ) {
|
804 |
+
options += '<option>' + value + '</option>';
|
805 |
+
} );
|
806 |
+
|
807 |
+
var $select = jQuery( '<div id="text_item_metadata--select2" style="margin-top: 0px;margin-right: 6px; vertical-align: top; display: inline-block;"><select id="text_item_metadata">' + options + '</select></div>' );
|
808 |
+
$select.insertBefore( jQuery( '#add_item_metadata' ) )
|
809 |
+
$select.find('select').select2({ tags: true });
|
810 |
+
}
|
811 |
+
else {
|
812 |
+
jQuery( '<input type="text" id="text_item_metadata" style="margin-right: 8px;">' ).insertBefore( jQuery( '#add_item_metadata' ) );
|
813 |
+
}
|
814 |
+
}, 'json' );
|
815 |
+
} );
|
816 |
+
|
817 |
+
jQuery( '#add_item_metadata' ).click( function() {
|
818 |
+
|
819 |
+
var val = jQuery( "#text_item_metadata" ).val();
|
820 |
+
var val2 = jQuery( '#item_metadata' ).val();
|
821 |
+
var val_op = jQuery( '#item_metadata_compare' ).val();
|
822 |
+
if ( val != null && val2 != null && val.length && val2.length ) {
|
823 |
+
val = val2 + val_op + val;
|
824 |
+
|
825 |
+
var f = true;
|
826 |
+
jQuery( '#item_metadata_check' ).next().find( 'ul li' ).each( function() {
|
827 |
+
if ( jQuery( this ).attr( 'title' ) == val ) {
|
828 |
+
f = false;
|
829 |
+
}
|
830 |
+
} );
|
831 |
+
|
832 |
+
if ( f ) {
|
833 |
+
|
834 |
+
jQuery( '#item_metadata_check' ).append( '<option selected="selected" value="' + val + '">' + val + '</option>' );
|
835 |
+
jQuery( '#item_metadata_check' ).select2(select2WODropdownOpts);
|
836 |
+
|
837 |
+
jQuery( '#item_metadata_check option' ).each( function() {
|
838 |
+
jQuery( '#item_metadata_check option[value=\"' + jQuery( this ).val() + '\"]:not(:last)' ).remove();
|
839 |
+
} );
|
840 |
+
|
841 |
+
jQuery( "input#text_item_metadata" ).val( '' );
|
842 |
+
}
|
843 |
+
}
|
844 |
+
return false;
|
845 |
+
} );
|
846 |
+
|
847 |
+
|
848 |
+
|
849 |
|
850 |
jQuery( '#summary_report_by_products_checkbox' ).on('change', function() {
|
851 |
jQuery('#manage_fields').parent().toggle(jQuery('#summary_report_by_products_checkbox').val());
|
964 |
</li>\
|
965 |
';
|
966 |
to.append( row );
|
967 |
+
|
968 |
+
scroll_to_added_field( to );
|
969 |
}
|
970 |
|
971 |
function add_custom_meta( to, index_p, format, label, colname ) {
|
985 |
</li>\
|
986 |
';
|
987 |
to.append( row );
|
988 |
+
scroll_to_added_field( to );
|
989 |
+
}
|
990 |
+
|
991 |
+
function scroll_to_added_field( to ) {
|
992 |
+
// scroll to added element
|
993 |
+
|
994 |
+
to.parent().scrollTop(to[0].scrollHeight);
|
995 |
+
|
996 |
+
if ( to.parent().prop('id') === 'fields' ) {
|
997 |
+
jQuery( window ).scrollTop( to.parent().offset().top + to.parent().outerHeight() - jQuery( window ).height() / 2 );
|
998 |
+
}
|
999 |
}
|
1000 |
|
1001 |
function formatItemSelection( item ) {
|
1047 |
} );
|
1048 |
jQuery( "#billing_locations_check" ).select2(select2WODropdownOpts);
|
1049 |
|
1050 |
+
jQuery( "#item_names" ).select2( {
|
1051 |
+
width: 150
|
1052 |
+
} );
|
1053 |
+
jQuery( "#item_names_check" ).select2(select2WODropdownOpts);
|
1054 |
|
1055 |
+
jQuery( "#item_metadata" ).select2( {
|
1056 |
+
width: 150
|
1057 |
+
} );
|
1058 |
+
jQuery( "#item_metadata_check" ).select2(select2WODropdownOpts);
|
1059 |
|
1060 |
jQuery( "#product_categories" ).select2( {
|
1061 |
ajax: {
|
assets/js/settings-form.js
ADDED
@@ -0,0 +1,989 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
function makeJsonVar( obj ) {
|
2 |
+
return encodeURIComponent( makeJson( obj ) ) ;
|
3 |
+
}
|
4 |
+
function makeJson( obj ) {
|
5 |
+
return JSON.stringify( obj.serializeJSON() ) ;
|
6 |
+
}
|
7 |
+
|
8 |
+
jQuery( document ).ready( function( $ ) {
|
9 |
+
|
10 |
+
$('#d-schedule-4 .datetimes-date').datepicker({
|
11 |
+
dateFormat: 'yy-mm-dd',
|
12 |
+
constrainInput: false,
|
13 |
+
minDate: 0,
|
14 |
+
});
|
15 |
+
|
16 |
+
$( '#d-schedule-3 .btn-add' ).click( function(e) {
|
17 |
+
var times = $( 'input[name="settings[schedule][times]"]' ).val();
|
18 |
+
var weekday = $( '#d-schedule-3 .wc_oe-select-weekday' ).val();
|
19 |
+
var time = $( '#d-schedule-3 .wc_oe-select-time' ).val();
|
20 |
+
|
21 |
+
if( times.indexOf( weekday + ' ' + time) != -1 ) {
|
22 |
+
return;
|
23 |
+
}
|
24 |
+
|
25 |
+
var data = [];
|
26 |
+
if( times != '' ) {
|
27 |
+
data = times.split( ',' ).map( function( time ) {
|
28 |
+
var arr = time.split( ' ' );
|
29 |
+
return { weekday: arr[ 0 ], time: arr[ 1 ] };
|
30 |
+
} );
|
31 |
+
}
|
32 |
+
|
33 |
+
data.push( { weekday: weekday, time: time } );
|
34 |
+
|
35 |
+
var weekdays = {
|
36 |
+
'Sun': 1,
|
37 |
+
'Mon': 2,
|
38 |
+
'Tue': 3,
|
39 |
+
'Wed': 4,
|
40 |
+
'Thu': 5,
|
41 |
+
'Fri': 6,
|
42 |
+
'Sat': 7,
|
43 |
+
};
|
44 |
+
|
45 |
+
data.sort( function( a, b ) {
|
46 |
+
if( weekdays[ a.weekday ] == weekdays[ b.weekday ] ) {
|
47 |
+
return new Date( '1970/01/01 ' + a.time ) - new Date( '1970/01/01 ' + b.time );
|
48 |
+
} else {
|
49 |
+
return weekdays[ a.weekday ] - weekdays[ b.weekday ];
|
50 |
+
}
|
51 |
+
} );
|
52 |
+
|
53 |
+
var html = data.map( function( elem ) {
|
54 |
+
var weekday = settings_form.day_names[elem.weekday] ;
|
55 |
+
return '<div class="time"><span class="btn-delete">×</span>'
|
56 |
+
+ weekday + ' ' + elem.time + '</div>';
|
57 |
+
} ).join( '' );
|
58 |
+
|
59 |
+
times = data.map( function( elem ) {
|
60 |
+
return elem.weekday + ' ' + elem.time;
|
61 |
+
} ).join();
|
62 |
+
|
63 |
+
$( '#d-schedule-3 .input-times' ).html( html );
|
64 |
+
$( '#d-schedule-3 .btn-delete' ).click( shedule3_time_delete );
|
65 |
+
|
66 |
+
$( 'input[name="settings[schedule][times]"]' ).val( times );
|
67 |
+
} );
|
68 |
+
|
69 |
+
$( '#d-schedule-4 .btn-add' ).click( function(e) {
|
70 |
+
|
71 |
+
var times = $( 'input[name="settings[schedule][date_times]"]' ).val();
|
72 |
+
var date = $( '#d-schedule-4 .datetimes-date' ).val();
|
73 |
+
var time = $( '#d-schedule-4 .wc_oe-select-time' ).val();
|
74 |
+
|
75 |
+
if( times.indexOf( date + ' ' + time) !== -1 ) {
|
76 |
+
return;
|
77 |
+
}
|
78 |
+
|
79 |
+
var data = [];
|
80 |
+
if( times !== '' ) {
|
81 |
+
data = times.split( ',' ).map( function( time ) {
|
82 |
+
var arr = time.split( ' ' );
|
83 |
+
return { date: arr[ 0 ], time: arr[ 1 ] };
|
84 |
+
} );
|
85 |
+
}
|
86 |
+
|
87 |
+
data.push( { date: date, time: time } );
|
88 |
+
|
89 |
+
data.sort( function( a, b ) {
|
90 |
+
return new Date( a.date + ' ' + a.time ) - new Date( b.date + ' ' + b.time );
|
91 |
+
} );
|
92 |
+
|
93 |
+
var html = data.map( function( elem ) {
|
94 |
+
return '<div class="time"><span class="btn-delete">×</span>'
|
95 |
+
+ elem.date + ' ' + elem.time + '</div>';
|
96 |
+
} ).join( '' );
|
97 |
+
|
98 |
+
times = data.map( function( elem ) {
|
99 |
+
return elem.date + ' ' + elem.time;
|
100 |
+
} ).join();
|
101 |
+
|
102 |
+
$( '#d-schedule-4 .input-date-times' ).html( html );
|
103 |
+
$( '#d-schedule-4 .btn-delete' ).click( shedule4_time_delete );
|
104 |
+
|
105 |
+
$( 'input[name="settings[schedule][date_times]"]' ).val( times );
|
106 |
+
} );
|
107 |
+
|
108 |
+
$( '#d-schedule-3 .input-times' ).ready( function() {
|
109 |
+
var times = $( 'input[name="settings[schedule][times]"]' ).val();
|
110 |
+
if( !times || times == '' ) {
|
111 |
+
return;
|
112 |
+
}
|
113 |
+
var data = times.split( ',' );
|
114 |
+
var html = data.map( function( elem ) {
|
115 |
+
var x = elem.split(' ');
|
116 |
+
var weekday = settings_form.day_names[x[0]] + ' ' + x[1];
|
117 |
+
return '<div class="time"><span class="btn-delete">×</span>' + weekday + '</div>';
|
118 |
+
} ).join( '' );
|
119 |
+
$( '#d-schedule-3 .input-times' ).html( html );
|
120 |
+
$( '#d-schedule-3 .btn-delete' ).click( shedule3_time_delete );
|
121 |
+
} );
|
122 |
+
|
123 |
+
$( '#d-schedule-4 .input-date-times' ).ready( function() {
|
124 |
+
|
125 |
+
var times = $( 'input[name="settings[schedule][date_times]"]' ).val();
|
126 |
+
|
127 |
+
if( !times || times == '' ) {
|
128 |
+
return;
|
129 |
+
}
|
130 |
+
|
131 |
+
var data = times.split( ',' );
|
132 |
+
|
133 |
+
var html = data.map( function( elem ) {
|
134 |
+
return '<div class="time"><span class="btn-delete">×</span>' + elem + '</div>';
|
135 |
+
} ).join( '' );
|
136 |
+
|
137 |
+
$( '#d-schedule-4 .input-date-times' ).html( html );
|
138 |
+
$( '#d-schedule-4 .btn-delete' ).click( shedule4_time_delete );
|
139 |
+
} );
|
140 |
+
|
141 |
+
function shedule3_time_delete( e ) {
|
142 |
+
var index = $( this ).parent().index();
|
143 |
+
var data = $( 'input[name="settings[schedule][times]"]' ).val().split( ',' );
|
144 |
+
data.splice( index, 1 );
|
145 |
+
$( 'input[name="settings[schedule][times]"]' ).val( data.join() );
|
146 |
+
$( this ).parent().remove();
|
147 |
+
}
|
148 |
+
|
149 |
+
function shedule4_time_delete( e ) {
|
150 |
+
var index = $( this ).parent().index();
|
151 |
+
var data = $( 'input[name="settings[schedule][date_times]"]' ).val().split( ',' );
|
152 |
+
data.splice( index, 1 );
|
153 |
+
$( 'input[name="settings[schedule][date_times]"]' ).val( data.join() );
|
154 |
+
$( this ).parent().remove();
|
155 |
+
}
|
156 |
+
|
157 |
+
|
158 |
+
$( '#schedule-1,#schedule-2,#schedule-3,#schedule-4' ).change( function() {
|
159 |
+
if ( $( '#schedule-1' ).is( ':checked' ) && $( '#schedule-1' ).val() == 'schedule-1' ) {
|
160 |
+
$( '#d-schedule-2 input:not(input[type=radio])' ).attr( 'disabled', true )
|
161 |
+
$( '#d-schedule-2 select' ).attr( 'disabled', true )
|
162 |
+
$( '#d-schedule-1 input:not(input[type=radio])' ).attr( 'disabled', false )
|
163 |
+
$( '#d-schedule-1 select' ).attr( 'disabled', false )
|
164 |
+
$( '#d-schedule-3 .block' ).addClass( 'disabled' );
|
165 |
+
$( '#d-schedule-4 .block' ).addClass( 'disabled' );
|
166 |
+
} else if( $( '#schedule-2' ).is( ':checked' ) && $( '#schedule-2' ).val() == 'schedule-2' ) {
|
167 |
+
$( '#d-schedule-1 input:not(input[type=radio])' ).attr( 'disabled', true )
|
168 |
+
$( '#d-schedule-1 select' ).attr( 'disabled', true )
|
169 |
+
$( '#d-schedule-2 select' ).attr( 'disabled', false )
|
170 |
+
$( '#d-schedule-2 input:not(input[type=radio]) ' ).attr( 'disabled', false )
|
171 |
+
$( '#d-schedule-3 .block' ).addClass( 'disabled' );
|
172 |
+
$( '#d-schedule-4 .block' ).addClass( 'disabled' );
|
173 |
+
} else if( $( '#schedule-3' ).is( ':checked' ) && $( '#schedule-3' ).val() == 'schedule-3' ) {
|
174 |
+
$( '#d-schedule-1 input:not(input[type=radio])' ).attr( 'disabled', true )
|
175 |
+
$( '#d-schedule-1 select' ).attr( 'disabled', true )
|
176 |
+
|
177 |
+
$( '#d-schedule-2 input:not(input[type=radio])' ).attr( 'disabled', true )
|
178 |
+
$( '#d-schedule-2 select' ).attr( 'disabled', true )
|
179 |
+
|
180 |
+
$( '#d-schedule-3 .block' ).removeClass( 'disabled' );
|
181 |
+
|
182 |
+
$( '#d-schedule-4 .block' ).addClass( 'disabled' );
|
183 |
+
} else if( $( '#schedule-4' ).is( ':checked' ) && $( '#schedule-4' ).val() == 'schedule-4' ) {
|
184 |
+
|
185 |
+
$( '#d-schedule-1 input:not(input[type=radio])' ).attr( 'disabled', true )
|
186 |
+
$( '#d-schedule-1 select' ).attr( 'disabled', true )
|
187 |
+
|
188 |
+
$( '#d-schedule-2 input:not(input[type=radio])' ).attr( 'disabled', true )
|
189 |
+
$( '#d-schedule-2 select' ).attr( 'disabled', true )
|
190 |
+
|
191 |
+
$( '#d-schedule-3 .block' ).addClass( 'disabled' );
|
192 |
+
|
193 |
+
$( '#d-schedule-4 .block' ).removeClass( 'disabled' );
|
194 |
+
}
|
195 |
+
} );
|
196 |
+
$( '#schedule-1' ).change()
|
197 |
+
$( '.wc_oe-select-interval' ).change( function() {
|
198 |
+
var interval = $( this ).val()
|
199 |
+
if ( interval == 'custom' ) {
|
200 |
+
$( '#custom_interval' ).show()
|
201 |
+
} else {
|
202 |
+
$( '#custom_interval' ).hide()
|
203 |
+
}
|
204 |
+
} );
|
205 |
+
$( '.wc_oe-select-interval' ).change()
|
206 |
+
|
207 |
+
$( '.output_destination' ).click( function() {
|
208 |
+
var input = $( this ).find( 'input' );
|
209 |
+
var target = input.val();
|
210 |
+
$( '.set-destination:not(#' + target + ')' ).hide();
|
211 |
+
$( '.my-icon-triangle' ).removeClass( 'ui-icon-triangle-1-n' );
|
212 |
+
$( '.my-icon-triangle' ).addClass( 'ui-icon-triangle-1-s' );
|
213 |
+
if ( !jQuery( '#' + target ).is( ':hidden' ) ) {
|
214 |
+
jQuery( '#' + target ).hide();
|
215 |
+
}
|
216 |
+
else {
|
217 |
+
if ( jQuery( '#' + target ).is( ':hidden' ) ) {
|
218 |
+
jQuery( '#' + target ).show();
|
219 |
+
$( '#test_reply_div' ).hide();
|
220 |
+
$( input ).next().removeClass( 'ui-icon-triangle-1-s' );
|
221 |
+
$( input ).next().addClass( 'ui-icon-triangle-1-n' );
|
222 |
+
}
|
223 |
+
}
|
224 |
+
} );
|
225 |
+
|
226 |
+
var is_unchecked_shown = true;
|
227 |
+
$('#hide_unchecked').on('click', function(e) {
|
228 |
+
e.preventDefault();
|
229 |
+
is_unchecked_shown = !is_unchecked_shown;
|
230 |
+
$("#order_fields li input:checkbox:not(:checked)").closest('.mapping_row').toggle(is_unchecked_shown);
|
231 |
+
$('#hide_unchecked div').toggle();
|
232 |
+
});
|
233 |
+
|
234 |
+
function my_hide( item ) {
|
235 |
+
if ( $( item ).is( ':hidden' ) ) {
|
236 |
+
$( item ).show();
|
237 |
+
return false;
|
238 |
+
}
|
239 |
+
else {
|
240 |
+
$( item ).hide();
|
241 |
+
return true;
|
242 |
+
}
|
243 |
+
}
|
244 |
+
|
245 |
+
$( '.my-hide-parent' ).click( function() {
|
246 |
+
my_hide( $( this ).parent() );
|
247 |
+
} );
|
248 |
+
|
249 |
+
$( '.my-hide-next' ).click( function() {
|
250 |
+
var f = my_hide( $( this ).next() );
|
251 |
+
if ( f ) {
|
252 |
+
$( this ).find( 'span' ).removeClass( 'ui-icon-triangle-1-n' );
|
253 |
+
$( this ).find( 'span' ).addClass( 'ui-icon-triangle-1-s' );
|
254 |
+
}
|
255 |
+
else {
|
256 |
+
$( this ).find( 'span' ).removeClass( 'ui-icon-triangle-1-s' );
|
257 |
+
$( this ).find( 'span' ).addClass( 'ui-icon-triangle-1-n' );
|
258 |
+
}
|
259 |
+
return false;
|
260 |
+
} );
|
261 |
+
|
262 |
+
|
263 |
+
$( '.wc_oe_test' ).click( function() {
|
264 |
+
var test = $( this ).attr( 'data-test' );
|
265 |
+
var data = 'json=' + makeJsonVar( $( '#export_job_settings' ) )
|
266 |
+
data = data + "&action=order_exporter&method=test_destination&mode=" + mode + "&id=" + job_id + "&destination=" + test;
|
267 |
+
$( '#test_reply_div' ).hide();
|
268 |
+
$.post( ajaxurl, data, function( data ) {
|
269 |
+
$( '#test_reply' ).val( data );
|
270 |
+
$( '#test_reply_div' ).show();
|
271 |
+
} )
|
272 |
+
} )
|
273 |
+
|
274 |
+
} )
|
275 |
+
|
276 |
+
function remove_custom_field( item ) {
|
277 |
+
jQuery( item ).parent().parent().remove();
|
278 |
+
return false;
|
279 |
+
}
|
280 |
+
|
281 |
+
function create_fields( format , format_changed) {
|
282 |
+
jQuery( '#export_job_settings' ).prepend( jQuery( "#fields_control_products" ) );
|
283 |
+
jQuery( '#export_job_settings' ).prepend( jQuery( "#fields_control_coupons" ) );
|
284 |
+
jQuery( "#order_fields" ).html();
|
285 |
+
jQuery( "#modal_content" ).html( "" );
|
286 |
+
|
287 |
+
var html = '';
|
288 |
+
jQuery.each( window['order_fields'], function( index, value ) {
|
289 |
+
var checked = ( value.checked == 1 ) ? 'checked' : '';
|
290 |
+
var colname = value.colname;
|
291 |
+
|
292 |
+
colname = escapeStr(colname);
|
293 |
+
value.label = escapeStr(value.label);
|
294 |
+
index = escapeStr(index);
|
295 |
+
value.value = escapeStr(value.value);
|
296 |
+
|
297 |
+
// console.log(index);
|
298 |
+
// console.log(value);
|
299 |
+
|
300 |
+
if(format_changed) {
|
301 |
+
if( is_flat_format( format ) )
|
302 |
+
colname = value.label;
|
303 |
+
else if ( is_xml_format( format ) )
|
304 |
+
colname = to_xml_tags( index );
|
305 |
+
else
|
306 |
+
colname = index;;
|
307 |
+
}
|
308 |
+
|
309 |
+
|
310 |
+
if ( index == 'products' || index == 'coupons' ) {
|
311 |
+
var sel_rows = ( value.repeat == 'rows' ) ? 'checked' : '';
|
312 |
+
var sel_cols = ( value.repeat == 'columns' ) ? 'checked' : '';
|
313 |
+
var max_cols = ( typeof(value.max_cols) !== 'undefined' ) ? value.max_cols : "10";
|
314 |
+
var modal = '<div id="modal-manage-' + index + '" style="display:none;"><p>';
|
315 |
+
modal += create_modal_fields( format, index, format_changed);
|
316 |
+
modal += '</p></div>';
|
317 |
+
jQuery( "#modal_content" ).append( modal );
|
318 |
+
var row = '<li class="mapping_row segment_' + value.segment + '">\
|
319 |
+
<div class="mapping_col_1">\
|
320 |
+
<input type=hidden name="orders[segment][' + index + ']" value="' + value.segment + '">\
|
321 |
+
<input type=hidden name="orders[label][' + index + ']" value="' + value.label + '">\
|
322 |
+
<input type=hidden name="orders[exported][' + index + ']" value="0">\
|
323 |
+
<input type=checkbox name="orders[exported][' + index + ']" ' + checked + ' value="1">\
|
324 |
+
</div>\
|
325 |
+
<div class="mapping_col_2">' + value.label + '</div>\
|
326 |
+
<div class="mapping_col_3">';
|
327 |
+
if ( is_flat_format( format ) ) {
|
328 |
+
|
329 |
+
var popup_options = localize_settings_form.js_tpl_popup;
|
330 |
+
popup_options = popup_options.replace('%s', '<input type=radio name="orders[repeat][' + index + ']" value="columns" ' + sel_cols + ' >')
|
331 |
+
popup_options = popup_options.replace('%s', '<input type=text size=2 name="orders[max_cols][' + index + ']" value="'+max_cols+'">')
|
332 |
+
popup_options = popup_options.replace('%s', '<input type=radio name="orders[repeat][' + index + ']" value="rows" ' + sel_rows + ' >')
|
333 |
+
row += popup_options;
|
334 |
+
}
|
335 |
+
row += '<input class="mapping_fieldname" type=input name="orders[colname][' + index + ']" value="' + colname + '">\
|
336 |
+
<input type="button" class="button-primary" id="btn_modal_manage_' + index + '" value="' + localize_settings_form.set_up_fields_to_export + '" /><a href="#TB_inline?width=600&height=550&inlineId=modal-manage-' + index + '" class="thickbox " id="link_modal_manage_' + index + '"> </a></div>\
|
337 |
+
</li>\
|
338 |
+
';
|
339 |
+
}
|
340 |
+
else {
|
341 |
+
var value_part = ''
|
342 |
+
var label_part = '';
|
343 |
+
if ( index.indexOf( 'custom_field' ) >= 0 ) {
|
344 |
+
value_part = '<div class="mapping_col_3"><input class="mapping_fieldname" type=input name="orders[value][' + index + ']" value="' + value.value + '"></div>';
|
345 |
+
label_part = '<a href="#" onclick="return remove_custom_field(this);" style="float: right;"><span class="ui-icon ui-icon-trash"></span></a>';
|
346 |
+
}
|
347 |
+
else if ( index.charAt( 0 ) == '_' || !value.default) {
|
348 |
+
label_part = '<a href="#" onclick="return remove_custom_field(this);" style="float: right;"><span class="ui-icon ui-icon-trash"></span></a>';
|
349 |
+
}
|
350 |
+
|
351 |
+
var row = '<li class="mapping_row segment_' + value.segment + '">\
|
352 |
+
<div class="mapping_col_1">\
|
353 |
+
<input type=hidden name="orders[segment][' + index + ']" value="' + value.segment + '">\
|
354 |
+
<input type=hidden name="orders[label][' + index + ']" value="' + value.label + '">\
|
355 |
+
<input type=hidden name="orders[exported][' + index + ']" value="0">\
|
356 |
+
<input type=checkbox name="orders[exported][' + index + ']" ' + checked + ' value="1">\
|
357 |
+
</div>\
|
358 |
+
<div class="mapping_col_2">' + value.label + label_part + '</div>\
|
359 |
+
<div class="mapping_col_3"><input class="mapping_fieldname" type=input name="orders[colname][' + index + ']" value="' + colname + '"></div> ' + value_part + '\
|
360 |
+
</li>\
|
361 |
+
';
|
362 |
+
}
|
363 |
+
html += row;
|
364 |
+
} );
|
365 |
+
|
366 |
+
jQuery( "#order_fields" ).html( html );
|
367 |
+
jQuery( '#modal-manage-products' ).prepend( jQuery( "#fields_control_products" ) );
|
368 |
+
jQuery( '#modal-manage-coupons' ).prepend( jQuery( "#fields_control_coupons" ) );
|
369 |
+
jQuery( "#fields_control_products" ).css( 'display', 'inline-block' );
|
370 |
+
jQuery( "#fields_control_coupons" ).css( 'display', 'inline-block' );
|
371 |
+
add_bind_for_custom_fields( 'products', output_format, jQuery( "#sort_products" ) );
|
372 |
+
add_bind_for_custom_fields( 'coupons', output_format, jQuery( "#sort_coupons" ) );
|
373 |
+
|
374 |
+
}
|
375 |
+
|
376 |
+
|
377 |
+
|
378 |
+
function create_modal_fields( format, index_p, format_changed ) {
|
379 |
+
//console.log( 'order_' + index_p + '_fields', window['order_' + index_p + '_fields'] );
|
380 |
+
|
381 |
+
var modal = "<div id='sort_" + index_p + "'>";
|
382 |
+
jQuery.each( window['order_' + index_p + '_fields'], function( index, value ) {
|
383 |
+
var checked = ( value.checked == 1 ) ? 'checked' : '';
|
384 |
+
var colname = value.colname;
|
385 |
+
|
386 |
+
// console.log(index);
|
387 |
+
// console.log(value);
|
388 |
+
|
389 |
+
|
390 |
+
colname = escapeStr(colname);
|
391 |
+
value.label = escapeStr(value.label);
|
392 |
+
index = escapeStr(index);
|
393 |
+
value.value = escapeStr(value.value);
|
394 |
+
|
395 |
+
if(format_changed) {
|
396 |
+
if( is_flat_format( format ) )
|
397 |
+
colname = value.label;
|
398 |
+
else if ( is_xml_format( format ) )
|
399 |
+
colname = to_xml_tags( index );
|
400 |
+
else
|
401 |
+
colname = index;;
|
402 |
+
}
|
403 |
+
|
404 |
+
var value_part = ''
|
405 |
+
var label_part = '';
|
406 |
+
if ( index.indexOf( 'custom_field' ) >= 0 ) {
|
407 |
+
value_part = '<div class="mapping_col_3"><input class="mapping_fieldname" type=input name="' + index_p + '[value][' + index + ']" value="' + value.value + '"></div>';
|
408 |
+
label_part = '<a href="#" onclick="return remove_custom_field(this);" style="float: right;"><span class="ui-icon ui-icon-trash"></span></a>';
|
409 |
+
}
|
410 |
+
else if ( index.charAt( 0 ) == '_' || index.substr( 0,3 ) == 'pa_' || !value.default) {
|
411 |
+
label_part = '<a href="#" onclick="return remove_custom_field(this);" style="float: right;"><span class="ui-icon ui-icon-trash"></span></a>';
|
412 |
+
}
|
413 |
+
|
414 |
+
var row = '<li class="mapping_row segment_modal_' + index + '">\
|
415 |
+
<div class="mapping_col_1">\
|
416 |
+
<input type=hidden name="' + index_p + '[label][' + index + ']" value="' + value.label + '">\
|
417 |
+
<input type=hidden name="' + index_p + '[exported][' + index + ']" value="0">\
|
418 |
+
<input type=checkbox name="' + index_p + '[exported][' + index + ']" ' + checked + ' value="1">\
|
419 |
+
</div>\
|
420 |
+
<div class="mapping_col_2">' + value.label + label_part + '</div>\
|
421 |
+
<div class="mapping_col_3"><input class="mapping_fieldname" type=input name="' + index_p + '[colname][' + index + ']" value="' + colname + '"></div>' + value_part + '\
|
422 |
+
</li>\
|
423 |
+
';
|
424 |
+
modal += row;
|
425 |
+
} );
|
426 |
+
modal += "</div>";
|
427 |
+
return modal;
|
428 |
+
}
|
429 |
+
|
430 |
+
//for XML labels
|
431 |
+
function to_xml_tags( str ) {
|
432 |
+
var arr = str.split( /_/ );
|
433 |
+
for ( var i = 0, l = arr.length; i < l; i++ ) {
|
434 |
+
arr[i] = arr[i].substr( 0, 1 ).toUpperCase() + ( arr[i].length > 1 ? arr[i].substr( 1 ).toLowerCase() : "" );
|
435 |
+
}
|
436 |
+
return arr.join( "_" );
|
437 |
+
}
|
438 |
+
|
439 |
+
|
440 |
+
function change_filename_ext() {
|
441 |
+
if ( jQuery( '#export_filename' ).size() ) {
|
442 |
+
var filename = jQuery( '#export_filename input' ).val();
|
443 |
+
var ext = output_format.toLowerCase();
|
444 |
+
if( ext=='xls' && !jQuery( '#format_xls_use_xls_format' ).prop('checked') ) //fix for XLSX
|
445 |
+
ext = 'xlsx';
|
446 |
+
|
447 |
+
var file = filename.replace( /^(.*)\..+$/, "$1." + ext );
|
448 |
+
if( file.indexOf(".") == -1) //no dots??
|
449 |
+
file = file + "." + ext;
|
450 |
+
jQuery( '#export_filename input' ).val( file );
|
451 |
+
show_summary_report(output_format);
|
452 |
+
}
|
453 |
+
}
|
454 |
+
|
455 |
+
function show_summary_report(ext) {
|
456 |
+
if( is_flat_format(ext) ) {
|
457 |
+
jQuery( '#summary_report_by_products' ).show();
|
458 |
+
} else {
|
459 |
+
jQuery( '#summary_report_by_products' ).hide();
|
460 |
+
jQuery( '#summary_setup_fields' ).hide();
|
461 |
+
jQuery( '#summary_report_by_products_checkbox' ).prop('checked', false);
|
462 |
+
}
|
463 |
+
}
|
464 |
+
|
465 |
+
function modal_buttons()
|
466 |
+
{
|
467 |
+
jQuery('body').on('click', '#btn_modal_manage_products', function() {
|
468 |
+
|
469 |
+
jQuery('input[name=custom_meta_products_mode]').change();
|
470 |
+
jQuery('#link_modal_manage_products').click();
|
471 |
+
|
472 |
+
return false;
|
473 |
+
});
|
474 |
+
|
475 |
+
jQuery('body').on('click', '#btn_modal_manage_coupons', function() {
|
476 |
+
|
477 |
+
jQuery('#custom_meta_coupons_mode_all').attr('checked', 'checked');
|
478 |
+
jQuery('#custom_meta_coupons_mode_all').change();
|
479 |
+
jQuery('#custom_meta_coupons_mode_all').change();
|
480 |
+
jQuery('#link_modal_manage_coupons').click();
|
481 |
+
|
482 |
+
return false;
|
483 |
+
});
|
484 |
+
|
485 |
+
}
|
486 |
+
|
487 |
+
jQuery( document ).ready( function( $ ) {
|
488 |
+
|
489 |
+
try {
|
490 |
+
select2_inits();
|
491 |
+
}
|
492 |
+
catch ( err ) {
|
493 |
+
console.log( err.message );
|
494 |
+
jQuery( '#select2_warning' ).show();
|
495 |
+
}
|
496 |
+
|
497 |
+
jQuery( "#settings_title" ).focus();
|
498 |
+
|
499 |
+
bind_events();
|
500 |
+
jQuery( '#taxonomies' ).change();
|
501 |
+
jQuery( '#attributes' ).change();
|
502 |
+
if ( jQuery( '#itemmeta option' ).length>0 )
|
503 |
+
jQuery( '#itemmeta' ).change();
|
504 |
+
jQuery( '#custom_fields' ).change();
|
505 |
+
jQuery( '#product_custom_fields' ).change();
|
506 |
+
jQuery( '#shipping_locations' ).change();
|
507 |
+
jQuery( '#billing_locations' ).change();
|
508 |
+
jQuery( '#item_names' ).change();
|
509 |
+
jQuery( '#item_metadata' ).change();
|
510 |
+
// jQuery( '#' + output_format + '_options' ).show();
|
511 |
+
|
512 |
+
//jQuery('#fields').toggle(); //debug
|
513 |
+
create_fields( output_format, false );
|
514 |
+
$( '#test_reply_div' ).hide();
|
515 |
+
// jQuery( '#' + output_format + '_options' ).hide();
|
516 |
+
|
517 |
+
jQuery( "#sort_products" ).sortable()/*.disableSelection()*/;
|
518 |
+
jQuery( "#sort_coupons" ).sortable()/*.disableSelection()*/;
|
519 |
+
jQuery( "#order_fields" ).sortable({ scroll: true, scrollSensitivity: 100, scrollSpeed: 100 });/*.disableSelection()*/;
|
520 |
+
|
521 |
+
|
522 |
+
modal_buttons();
|
523 |
+
|
524 |
+
jQuery( '.date' ).datepicker( {
|
525 |
+
dateFormat: 'yy-mm-dd',
|
526 |
+
constrainInput: false
|
527 |
+
} );
|
528 |
+
|
529 |
+
jQuery( '#adjust-fields-btn' ).click( function() {
|
530 |
+
jQuery( '#fields' ).toggle();
|
531 |
+
jQuery( '#fields_control' ).toggle();
|
532 |
+
return false;
|
533 |
+
} );
|
534 |
+
|
535 |
+
jQuery( '.field_section' ).click( function() {
|
536 |
+
var section = jQuery( this ).val();
|
537 |
+
var checked = jQuery( this ).is( ':checked' );
|
538 |
+
|
539 |
+
jQuery( '.segment_' + section ).each( function( index ) {
|
540 |
+
if ( checked ) {
|
541 |
+
jQuery( this ).show();
|
542 |
+
//jQuery(this).find('input:checkbox:first').attr('checked', true);
|
543 |
+
}
|
544 |
+
else {
|
545 |
+
jQuery( this ).hide();
|
546 |
+
jQuery( this ).find( 'input:checkbox:first' ).attr( 'checked', false );
|
547 |
+
}
|
548 |
+
} );
|
549 |
+
} );
|
550 |
+
|
551 |
+
jQuery( '.output_format' ).click( function() {
|
552 |
+
var new_format = jQuery( this ).val();
|
553 |
+
jQuery( '#my-format .my-icon-triangle' ).removeClass( 'ui-icon-triangle-1-n' );
|
554 |
+
jQuery( '#my-format .my-icon-triangle' ).addClass( 'ui-icon-triangle-1-s' );
|
555 |
+
|
556 |
+
if ( new_format != output_format ) {
|
557 |
+
jQuery( this ).next().removeClass( 'ui-icon-triangle-1-s' );
|
558 |
+
jQuery( this ).next().addClass( 'ui-icon-triangle-1-n' );
|
559 |
+
jQuery( '#' + output_format + '_options' ).hide();
|
560 |
+
jQuery( '#' + new_format + '_options' ).show();
|
561 |
+
output_format = new_format;
|
562 |
+
create_fields( output_format, true )
|
563 |
+
jQuery( '#output_preview, #output_preview_csv' ).hide();
|
564 |
+
// jQuery( '#fields' ).hide();
|
565 |
+
// jQuery( '#fields_control' ).hide();
|
566 |
+
change_filename_ext();
|
567 |
+
}
|
568 |
+
else {
|
569 |
+
if ( !jQuery( '#' + new_format + '_options' ).is( ':hidden' ) ) {
|
570 |
+
jQuery( '#' + new_format + '_options' ).hide();
|
571 |
+
}
|
572 |
+
else {
|
573 |
+
if ( jQuery( '#' + new_format + '_options' ).is( ':hidden' ) ) {
|
574 |
+
jQuery( '#' + new_format + '_options' ).show();
|
575 |
+
jQuery( this ).next().removeClass( 'ui-icon-triangle-1-s' );
|
576 |
+
jQuery( this ).next().addClass( 'ui-icon-triangle-1-n' );
|
577 |
+
}
|
578 |
+
}
|
579 |
+
}
|
580 |
+
|
581 |
+
} );
|
582 |
+
|
583 |
+
$( '#date_format_block select' ).change( function() {
|
584 |
+
var value = $( this ).val();
|
585 |
+
if( value == 'custom' ) {
|
586 |
+
$( '#custom_date_format_block' ).show();
|
587 |
+
} else {
|
588 |
+
$( '#custom_date_format_block' ).hide();
|
589 |
+
$( 'input[name="settings[date_format]"]' ).val( value );
|
590 |
+
}
|
591 |
+
} );
|
592 |
+
|
593 |
+
$( '#time_format_block select' ).change( function() {
|
594 |
+
var value = $( this ).val();
|
595 |
+
if( value == 'custom' ) {
|
596 |
+
$( '#custom_time_format_block' ).show();
|
597 |
+
} else {
|
598 |
+
$( '#custom_time_format_block' ).hide();
|
599 |
+
$( 'input[name="settings[time_format]"]' ).val( value );
|
600 |
+
}
|
601 |
+
} );
|
602 |
+
|
603 |
+
$( 'input[type="checkbox"][name="settings[custom_php]"]' ).change( function() {
|
604 |
+
$( 'textarea[name="settings[custom_php_code]"]' ).toggle( $( this ).is( ':checked' ) );
|
605 |
+
} );
|
606 |
+
|
607 |
+
$( '#order_fields input[type=checkbox]' ).change( function() {
|
608 |
+
if ( $( '#order_fields input[type=checkbox]:not(:checked)' ).size() ) {
|
609 |
+
$( 'input[name=orders_all]' ).attr( 'checked', false );
|
610 |
+
}
|
611 |
+
else {
|
612 |
+
$( 'input[name=orders_all]' ).attr( 'checked', true );
|
613 |
+
}
|
614 |
+
} );
|
615 |
+
|
616 |
+
$( 'input[name=orders_all]' ).change( function() {
|
617 |
+
if ( $( 'input[name=orders_all]' ).is( ':checked' ) ) {
|
618 |
+
$( '#order_fields input[type=checkbox]' ).attr( 'checked', true );
|
619 |
+
}
|
620 |
+
else {
|
621 |
+
$( '#order_fields input[type=checkbox]' ).attr( 'checked', false );
|
622 |
+
}
|
623 |
+
} );
|
624 |
+
|
625 |
+
if ( $( '#order_fields input[type=checkbox]' ).size() ) {
|
626 |
+
$( '#order_fields input[type=checkbox]:first' ).change();
|
627 |
+
}
|
628 |
+
|
629 |
+
|
630 |
+
|
631 |
+
|
632 |
+
$( ".preview-btn" ).click( function() {
|
633 |
+
preview(jQuery(this).attr('data-limit'));
|
634 |
+
return false;
|
635 |
+
} );
|
636 |
+
|
637 |
+
$( '#progress_div .title-download' ).click( function() {
|
638 |
+
$( '#progress_div .title-download' ).hide();
|
639 |
+
$( '#progress_div .title-cancel' ).show();
|
640 |
+
$( '#progressBar' ).show();
|
641 |
+
jQuery( '#progress_div' ).hide();
|
642 |
+
closeWaitingDialog();
|
643 |
+
});
|
644 |
+
|
645 |
+
function preview(size) {
|
646 |
+
jQuery( '#output_preview, #output_preview_csv' ).hide();
|
647 |
+
var data = 'json=' + makeJsonVar( $( '#export_job_settings' ) );
|
648 |
+
var estimate_data = data + "&action=order_exporter&method=estimate&mode=" + mode + "&id=" + job_id;
|
649 |
+
$.post( ajaxurl, estimate_data, function( response ) {
|
650 |
+
if ( response.total !== undefined ) {
|
651 |
+
jQuery( '#output_preview_total' ).find( 'span' ).html( response.total );
|
652 |
+
jQuery( '#preview_actions' ).removeClass( 'hide' );
|
653 |
+
}
|
654 |
+
}, "json"
|
655 |
+
);
|
656 |
+
|
657 |
+
function showPreview( response ) {
|
658 |
+
var id = 'output_preview';
|
659 |
+
if ( is_flat_format( output_format ) )
|
660 |
+
id = 'output_preview_csv';
|
661 |
+
if ( is_object_format( output_format ) ) {
|
662 |
+
jQuery( '#' + id ).text( response );
|
663 |
+
}
|
664 |
+
else {
|
665 |
+
jQuery( '#' + id ).html( response );
|
666 |
+
}
|
667 |
+
jQuery( '#' + id ).show();
|
668 |
+
window.scrollTo( 0, document.body.scrollHeight );
|
669 |
+
}
|
670 |
+
|
671 |
+
data = data + "&action=order_exporter&method=preview&limit="+size+"&mode=" + mode + "&id=" + job_id;
|
672 |
+
$.post( ajaxurl, data, showPreview, "html" ).fail( function( xhr, textStatus, errorThrown ) {
|
673 |
+
showPreview( xhr.responseText );
|
674 |
+
});
|
675 |
+
}
|
676 |
+
// EXPORT FUNCTIONS
|
677 |
+
function get_data() {
|
678 |
+
var data = new Array();
|
679 |
+
data.push( { name: 'json', value: makeJson( $( '#export_job_settings' )) } );
|
680 |
+
data.push( { name: 'action', value: 'order_exporter' } );
|
681 |
+
data.push( { name: 'mode', value: mode } );
|
682 |
+
data.push( { name: 'id', value: job_id } );
|
683 |
+
return data;
|
684 |
+
}
|
685 |
+
|
686 |
+
function progress( percent, $element ) {
|
687 |
+
|
688 |
+
if ( percent == 0 ) {
|
689 |
+
$element.find( 'div' ).html( percent + "% " ).animate( { width: 0 }, 0 );
|
690 |
+
waitingDialog();
|
691 |
+
jQuery( '#progress_div' ).show();
|
692 |
+
}
|
693 |
+
else {
|
694 |
+
var progressBarWidth = percent * $element.width() / 100;
|
695 |
+
$element.find( 'div' ).html( percent + "% " ).animate( { width: progressBarWidth }, 200 );
|
696 |
+
|
697 |
+
if ( percent >= 100 ) {
|
698 |
+
if(!is_iPad_or_iPhone()) {
|
699 |
+
jQuery( '#progress_div' ).hide();
|
700 |
+
closeWaitingDialog();
|
701 |
+
}
|
702 |
+
}
|
703 |
+
}
|
704 |
+
}
|
705 |
+
|
706 |
+
function get_all( start, percent, method ) {
|
707 |
+
if (window.cancelling) {
|
708 |
+
return;
|
709 |
+
}
|
710 |
+
|
711 |
+
progress( parseInt( percent, 10 ), jQuery( '#progressBar' ) );
|
712 |
+
|
713 |
+
if ( percent < 100 ) {
|
714 |
+
data = get_data();
|
715 |
+
data.push( { name: 'method', value: method } );
|
716 |
+
data.push( { name: 'start', value: start } );
|
717 |
+
data.push( { name: 'file_id', value: window.file_id } );
|
718 |
+
|
719 |
+
jQuery.ajax( {
|
720 |
+
type: "post",
|
721 |
+
data: data,
|
722 |
+
cache: false,
|
723 |
+
url: ajaxurl,
|
724 |
+
dataType: "json",
|
725 |
+
error: function( xhr, status, error ) {
|
726 |
+
alert( xhr.responseText );
|
727 |
+
progress( 100, jQuery( '#progressBar' ) );
|
728 |
+
},
|
729 |
+
success: function( response ) {
|
730 |
+
get_all( response.start, ( response.start / window.count ) * 100, method )
|
731 |
+
}
|
732 |
+
} );
|
733 |
+
}
|
734 |
+
else {
|
735 |
+
data = get_data();
|
736 |
+
data.push( { name: 'method', value: 'export_finish' } );
|
737 |
+
data.push( { name: 'file_id', value: window.file_id } );
|
738 |
+
jQuery.ajax( {
|
739 |
+
type: "post",
|
740 |
+
data: data,
|
741 |
+
cache: false,
|
742 |
+
url: ajaxurl,
|
743 |
+
dataType: "json",
|
744 |
+
error: function( xhr, status, error ) {
|
745 |
+
alert( xhr.responseText );
|
746 |
+
},
|
747 |
+
success: function( response ) {
|
748 |
+
var download_format = output_format;
|
749 |
+
if( output_format=='XLS' && !jQuery( '#format_xls_use_xls_format' ).prop('checked') )
|
750 |
+
download_format = 'XLSX';
|
751 |
+
|
752 |
+
if(is_iPad_or_iPhone()) {
|
753 |
+
$( '#progress_div .title-download a' ).attr( 'href', ajaxurl + (ajaxurl.indexOf('?') === -1? '?':'&')+'action=order_exporter&method=export_download&format=' + download_format + '&file_id=' + window.file_id );
|
754 |
+
$( '#progress_div .title-download' ).show();
|
755 |
+
$( '#progress_div .title-cancel' ).hide();
|
756 |
+
$( '#progressBar' ).hide();
|
757 |
+
} else {
|
758 |
+
$( '#export_new_window_frame' ).attr( "src", ajaxurl + (ajaxurl.indexOf('?') === -1? '?':'&')+'action=order_exporter&method=export_download&format=' + download_format + '&file_id=' + window.file_id );
|
759 |
+
}
|
760 |
+
|
761 |
+
reset_date_filter_for_cron();
|
762 |
+
}
|
763 |
+
} );
|
764 |
+
}
|
765 |
+
}
|
766 |
+
|
767 |
+
function is_iPad_or_iPhone() {
|
768 |
+
return navigator.platform.match(/i(Phone|Pad)/i)
|
769 |
+
}
|
770 |
+
|
771 |
+
function waitingDialog() {
|
772 |
+
jQuery( "#background" ).addClass( "loading" );
|
773 |
+
jQuery( '#wpbody-content' ).keydown(function(event) {
|
774 |
+
if ( event.keyCode == 27 ) {
|
775 |
+
if (!window.cancelling) {
|
776 |
+
event.preventDefault();
|
777 |
+
window.cancelling = true;
|
778 |
+
|
779 |
+
jQuery.ajax( {
|
780 |
+
type: "post",
|
781 |
+
data: {
|
782 |
+
action: 'order_exporter',
|
783 |
+
method: 'cancel_export',
|
784 |
+
file_id: window.file_id,
|
785 |
+
},
|
786 |
+
cache: false,
|
787 |
+
url: ajaxurl,
|
788 |
+
dataType: "json",
|
789 |
+
error: function( xhr, status, error ) {
|
790 |
+
alert( xhr.responseText );
|
791 |
+
progress( 100, jQuery( '#progressBar' ) );
|
792 |
+
},
|
793 |
+
success: function( response ) {
|
794 |
+
progress( 100, jQuery( '#progressBar' ) );
|
795 |
+
}
|
796 |
+
} );
|
797 |
+
|
798 |
+
window.count = 0;
|
799 |
+
window.file_id = '';
|
800 |
+
jQuery( '#wpbody-content' ).off('keydown');
|
801 |
+
}
|
802 |
+
return false;
|
803 |
+
}
|
804 |
+
});
|
805 |
+
}
|
806 |
+
function closeWaitingDialog() {
|
807 |
+
jQuery( "#background" ).removeClass( "loading" );
|
808 |
+
}
|
809 |
+
|
810 |
+
function openFilter(object_id, verify_checkboxes) {
|
811 |
+
verify_checkboxes = verify_checkboxes || 0;
|
812 |
+
var f = false;
|
813 |
+
$( '#'+object_id+' ul' ).each( function( index ) {
|
814 |
+
if ( $( this ).find( 'li:not(:first)' ).size() ) {
|
815 |
+
f = true;
|
816 |
+
}
|
817 |
+
} );
|
818 |
+
|
819 |
+
// show checkboxes for order and coupon section ?
|
820 |
+
if ( f || verify_checkboxes && $('#'+object_id+" input[type='checkbox']:checked").length ) {
|
821 |
+
$( '#'+object_id ).prev().click();
|
822 |
+
}
|
823 |
+
}
|
824 |
+
|
825 |
+
function validateExport() {
|
826 |
+
if ( ( mode == settings_form.EXPORT_PROFILE ) && ( !$( "[name='settings[title]']" ).val() ) ) {
|
827 |
+
alert( export_messages.empty_title );
|
828 |
+
$( "[name='settings[title]']" ).focus();
|
829 |
+
return false;
|
830 |
+
}
|
831 |
+
|
832 |
+
if ( ( $( "#from_date" ).val() ) && ( $( "#to_date" ).val() ) ) {
|
833 |
+
var d1 = new Date( $( "#from_date" ).val() );
|
834 |
+
var d2 = new Date( $( "#to_date" ).val() );
|
835 |
+
if ( d1.getTime() > d2.getTime() ) {
|
836 |
+
alert( export_messages.wrong_date_range );
|
837 |
+
return false;
|
838 |
+
}
|
839 |
+
}
|
840 |
+
if ( $( '#order_fields input[type=checkbox]:checked' ).size() == 0 )
|
841 |
+
{
|
842 |
+
alert( export_messages.no_fields );
|
843 |
+
return false;
|
844 |
+
}
|
845 |
+
|
846 |
+
return true;
|
847 |
+
}
|
848 |
+
// EXPORT FUNCTIONS END
|
849 |
+
$( "#export-wo-pb-btn" ).click( function() {
|
850 |
+
$( '#export_wo_pb_form' ).attr( "action", ajaxurl );
|
851 |
+
$( '#export_wo_pb_form' ).find( '[name=json]' ).val( makeJson( $( '#export_job_settings' ) ) );
|
852 |
+
$( '#export_wo_pb_form' ).submit();
|
853 |
+
return false;
|
854 |
+
} );
|
855 |
+
|
856 |
+
$( "#export-btn, #my-quick-export-btn" ).click( function() {
|
857 |
+
window.cancelling = false;
|
858 |
+
|
859 |
+
data = get_data();
|
860 |
+
|
861 |
+
data.push( { name: 'method', value: 'export_start' } );
|
862 |
+
if ( ( $( "#from_date" ).val() ) && ( $( "#to_date" ).val() ) ) {
|
863 |
+
var d1 = new Date( $( "#from_date" ).val() );
|
864 |
+
var d2 = new Date( $( "#to_date" ).val() );
|
865 |
+
if ( d1.getTime() > d2.getTime() ) {
|
866 |
+
alert( export_messages.wrong_date_range );
|
867 |
+
return false;
|
868 |
+
}
|
869 |
+
}
|
870 |
+
|
871 |
+
if ( $( '#order_fields input[type=checkbox]:checked' ).size() == 0 )
|
872 |
+
{
|
873 |
+
alert( export_messages.no_fields );
|
874 |
+
return false;
|
875 |
+
}
|
876 |
+
|
877 |
+
|
878 |
+
jQuery.ajax( {
|
879 |
+
type: "post",
|
880 |
+
data: data,
|
881 |
+
cache: false,
|
882 |
+
url: ajaxurl,
|
883 |
+
dataType: "json",
|
884 |
+
error: function( xhr, status, error ) {
|
885 |
+
alert( xhr.responseText.replace(/<\/?[^>]+(>|$)/g, "") );
|
886 |
+
},
|
887 |
+
success: function( response ) {
|
888 |
+
window.count = response['total'];
|
889 |
+
window.file_id = response['file_id'];
|
890 |
+
console.log( window.count );
|
891 |
+
|
892 |
+
if ( window.count > 0 )
|
893 |
+
get_all( 0, 0, 'export_part' );
|
894 |
+
else {
|
895 |
+
alert( export_messages.no_results );
|
896 |
+
reset_date_filter_for_cron();
|
897 |
+
}
|
898 |
+
}
|
899 |
+
} );
|
900 |
+
|
901 |
+
return false;
|
902 |
+
} );
|
903 |
+
$( "#save-btn" ).click( function() {
|
904 |
+
if (!validateExport()) {
|
905 |
+
return false;
|
906 |
+
}
|
907 |
+
setFormSubmitting();
|
908 |
+
|
909 |
+
var data = 'json=' + makeJsonVar( $( '#export_job_settings' ) )
|
910 |
+
data = data + "&action=order_exporter&method=save_settings&mode=" + mode + "&id=" + job_id;
|
911 |
+
$.post( ajaxurl, data, function( response ) {
|
912 |
+
// if ( mode == '<?php echo WC_Order_Export_Manage::EXPORT_SCHEDULE; ?>' ) {
|
913 |
+
// document.location = '<?php echo admin_url( 'admin.php?page=wc-order-export&tab=schedules&save=y' ) ?>';
|
914 |
+
// } else if ( mode == '<?php echo WC_Order_Export_Manage::EXPORT_PROFILE; ?>' ) {
|
915 |
+
// document.location = '<?php echo admin_url( 'admin.php?page=wc-order-export&tab=profiles&save=y' ) ?>';
|
916 |
+
// } else if ( mode == '<?php echo WC_Order_Export_Manage::EXPORT_ORDER_ACTION; ?>' ) {
|
917 |
+
// document.location = '<?php echo admin_url( 'admin.php?page=wc-order-export&tab=order_actions&save=y' ) ?>';
|
918 |
+
// } else {
|
919 |
+
// document.location = '<?php echo admin_url( 'admin.php?page=wc-order-export&tab=export&save=y' ) ?>';
|
920 |
+
// }
|
921 |
+
document.location = settings_form.save_settings_url;
|
922 |
+
}, "json" );
|
923 |
+
return false;
|
924 |
+
} );
|
925 |
+
$( "#copy-to-profiles" ).click( function() {
|
926 |
+
if (!validateExport()) {
|
927 |
+
return false;
|
928 |
+
}
|
929 |
+
|
930 |
+
var data = 'json=' + makeJsonVar( $( '#export_job_settings' ) )
|
931 |
+
data = data + "&action=order_exporter&method=save_settings&mode=" + settings_form.EXPORT_PROFILE + "&id=";
|
932 |
+
$.post( ajaxurl, data, function( response ) {
|
933 |
+
document.location =settings_form.copy_to_profiles_url + '&profile_id=' + response.id;
|
934 |
+
}, "json" );
|
935 |
+
return false;
|
936 |
+
} );
|
937 |
+
|
938 |
+
openFilter('my-order', 1);
|
939 |
+
|
940 |
+
openFilter('my-products');
|
941 |
+
|
942 |
+
openFilter('my-shipping');
|
943 |
+
|
944 |
+
openFilter('my-users');
|
945 |
+
|
946 |
+
openFilter('my-coupons', 1);
|
947 |
+
|
948 |
+
openFilter('my-billing');
|
949 |
+
|
950 |
+
openFilter('my-items-meta');
|
951 |
+
|
952 |
+
if ( mode == settings_form.EXPORT_SCHEDULE )
|
953 |
+
setup_alert_date_filter();
|
954 |
+
//for XLSX
|
955 |
+
$('#format_xls_use_xls_format').click(function() {
|
956 |
+
change_filename_ext();
|
957 |
+
});
|
958 |
+
|
959 |
+
show_summary_report( output_format );
|
960 |
+
if( !summary_mode )
|
961 |
+
jQuery('#summary_setup_fields').hide();
|
962 |
+
//logic for setup link
|
963 |
+
jQuery( "#summary_report_by_products_checkbox" ).change( function() {
|
964 |
+
if( jQuery(this).prop('checked') )
|
965 |
+
jQuery('#summary_setup_fields').show();
|
966 |
+
else
|
967 |
+
jQuery('#summary_setup_fields').hide();
|
968 |
+
});
|
969 |
+
|
970 |
+
// this line must be last , we don't have any errors
|
971 |
+
jQuery('#JS_error_onload').hide();
|
972 |
+
} );
|
973 |
+
|
974 |
+
function is_flat_format(format) {
|
975 |
+
return (settings_form.flat_formats.indexOf(format) > -1);
|
976 |
+
}
|
977 |
+
function is_object_format(format) {
|
978 |
+
return (settings_form.object_formats.indexOf(format) > -1);
|
979 |
+
}
|
980 |
+
function is_xml_format(format) {
|
981 |
+
return (settings_form.xml_formats.indexOf(format) > -1);
|
982 |
+
}
|
983 |
+
function reset_date_filter_for_cron() {
|
984 |
+
if(mode == 'cron') {
|
985 |
+
jQuery( "#from_date" ).val("");
|
986 |
+
jQuery( "#to_date" ).val("");
|
987 |
+
try_color_date_filter();
|
988 |
+
}
|
989 |
+
}
|
classes/admin/class-wc-order-export-ajax.php
CHANGED
@@ -115,7 +115,7 @@ class WC_Order_Export_Ajax {
|
|
115 |
$main_settings = WC_Order_Export_Admin::load_main_settings();
|
116 |
|
117 |
$result = WC_Order_Export_Engine::build_files_and_export( $settings, '', $main_settings['limit_button_test'] );
|
118 |
-
echo $result;
|
119 |
}
|
120 |
|
121 |
public function preview() {
|
@@ -163,6 +163,15 @@ class WC_Order_Export_Ajax {
|
|
163 |
public function get_order_billing_values() {
|
164 |
echo json_encode( WC_Order_Export_Data_Extractor_UI::get_order_meta_values('_billing_', $_POST['item']) );
|
165 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
|
167 |
public function send_headers( $format, $download_name = '') {
|
168 |
WC_Order_Export_Engine::kill_buffers();
|
115 |
$main_settings = WC_Order_Export_Admin::load_main_settings();
|
116 |
|
117 |
$result = WC_Order_Export_Engine::build_files_and_export( $settings, '', $main_settings['limit_button_test'] );
|
118 |
+
echo str_replace("<br>", "\r\n", $result);
|
119 |
}
|
120 |
|
121 |
public function preview() {
|
163 |
public function get_order_billing_values() {
|
164 |
echo json_encode( WC_Order_Export_Data_Extractor_UI::get_order_meta_values('_billing_', $_POST['item']) );
|
165 |
}
|
166 |
+
|
167 |
+
public function get_order_item_names() {
|
168 |
+
echo json_encode( WC_Order_Export_Data_Extractor_UI::get_order_item_names($_POST['item_type']) );
|
169 |
+
}
|
170 |
+
public function get_order_item_meta_key_values() {
|
171 |
+
echo json_encode( WC_Order_Export_Data_Extractor_UI::get_order_item_meta_key_values($_POST['meta_key']) );
|
172 |
+
}
|
173 |
+
|
174 |
+
|
175 |
|
176 |
public function send_headers( $format, $download_name = '') {
|
177 |
WC_Order_Export_Engine::kill_buffers();
|
classes/admin/class-wc-order-export-manage.php
CHANGED
@@ -91,7 +91,9 @@ class WC_Order_Export_Manage {
|
|
91 |
'payment_methods',
|
92 |
'product_attributes',
|
93 |
'product_itemmeta',
|
94 |
-
'product_taxonomies'
|
|
|
|
|
95 |
);
|
96 |
foreach ( $multiselects as $m_select ) {
|
97 |
if ( ! isset( $new_settings[ $m_select ] ) ) {
|
@@ -100,6 +102,7 @@ class WC_Order_Export_Manage {
|
|
100 |
}
|
101 |
|
102 |
$settings = self::get( $in['mode'], $in['id'] );
|
|
|
103 |
// setup new values for same keys
|
104 |
foreach ( $new_settings as $key => $val ) {
|
105 |
$settings[ $key ] = $val;
|
@@ -164,6 +167,9 @@ class WC_Order_Export_Manage {
|
|
164 |
}
|
165 |
|
166 |
static function apply_defaults( $mode, $settings ) {
|
|
|
|
|
|
|
167 |
$defaults = array(
|
168 |
'mode' => $mode,
|
169 |
'title' => '',
|
@@ -177,6 +183,8 @@ class WC_Order_Export_Manage {
|
|
177 |
'to_date' => '',
|
178 |
'shipping_locations' => array(),
|
179 |
'shipping_methods' => array(),
|
|
|
|
|
180 |
'user_roles' => array(),
|
181 |
'user_names' => array(),
|
182 |
'billing_locations' => array(),
|
91 |
'payment_methods',
|
92 |
'product_attributes',
|
93 |
'product_itemmeta',
|
94 |
+
'product_taxonomies',
|
95 |
+
'item_names',
|
96 |
+
'item_metadata',
|
97 |
);
|
98 |
foreach ( $multiselects as $m_select ) {
|
99 |
if ( ! isset( $new_settings[ $m_select ] ) ) {
|
102 |
}
|
103 |
|
104 |
$settings = self::get( $in['mode'], $in['id'] );
|
105 |
+
$settings['id'] = $in['id'];
|
106 |
// setup new values for same keys
|
107 |
foreach ( $new_settings as $key => $val ) {
|
108 |
$settings[ $key ] = $val;
|
167 |
}
|
168 |
|
169 |
static function apply_defaults( $mode, $settings ) {
|
170 |
+
|
171 |
+
$settings = apply_filters( "woe_before_apply_default_settings", $settings , $mode);
|
172 |
+
|
173 |
$defaults = array(
|
174 |
'mode' => $mode,
|
175 |
'title' => '',
|
183 |
'to_date' => '',
|
184 |
'shipping_locations' => array(),
|
185 |
'shipping_methods' => array(),
|
186 |
+
'item_names' => array(),
|
187 |
+
'item_metadata' => array(),
|
188 |
'user_roles' => array(),
|
189 |
'user_names' => array(),
|
190 |
'billing_locations' => array(),
|
classes/class-wc-order-export-admin.php
CHANGED
@@ -8,7 +8,7 @@ class WC_Order_Export_Admin {
|
|
8 |
var $activation_notice_option = 'woocommerce-order-export-activation-notice-shown';
|
9 |
var $step = 30;
|
10 |
public static $formats = array( 'XLS', 'CSV', 'XML', 'JSON', 'TSV' );
|
11 |
-
public static $export_types = array( 'EMAIL', 'FTP', 'HTTP', 'FOLDER', 'SFTP' );
|
12 |
public $url_plugin;
|
13 |
public $path_plugin;
|
14 |
var $methods_allowed_for_guests;
|
@@ -50,8 +50,11 @@ class WC_Order_Export_Admin {
|
|
50 |
}
|
51 |
}
|
52 |
|
|
|
|
|
53 |
//Pro active ?
|
54 |
if( self::is_full_version() ) {
|
|
|
55 |
add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
|
56 |
add_filter( 'cron_schedules', array( 'WC_Order_Export_Cron', 'create_custom_schedules' ), 10, 1 );
|
57 |
add_action( 'wc_export_cron_global', array( 'WC_Order_Export_Cron', 'wc_export_cron_global_f' ) );
|
@@ -71,12 +74,14 @@ class WC_Order_Export_Admin {
|
|
71 |
} );
|
72 |
}
|
73 |
|
74 |
-
$this->settings = self::load_main_settings();
|
75 |
}
|
76 |
|
77 |
public function add_order_status_column_header( $columns ) {
|
|
|
|
|
|
|
|
|
78 |
$new_columns = array();
|
79 |
-
|
80 |
foreach ( $columns as $column_name => $column_info ) {
|
81 |
if ( 'order_actions' === $column_name OR 'wc_actions' === $column_name) { // Woocommerce uses wc_actions since 3.3.0
|
82 |
$label = __( 'Export Status', 'woo-order-export-lite' );
|
@@ -152,10 +157,15 @@ class WC_Order_Export_Admin {
|
|
152 |
return array_merge(
|
153 |
array(
|
154 |
'cron_tasks_active' => '1',
|
|
|
|
|
|
|
155 |
'ajax_orders_per_step' => '30',
|
156 |
'limit_button_test' => '1',
|
157 |
'cron_key' => '1234',
|
158 |
'ipn_url' => '',
|
|
|
|
|
159 |
),
|
160 |
get_option( self::settings_name_common, array() )
|
161 |
);
|
@@ -164,10 +174,15 @@ class WC_Order_Export_Admin {
|
|
164 |
// update main settings here!
|
165 |
$settings = filter_input_array(INPUT_POST, array(
|
166 |
'cron_tasks_active' => FILTER_VALIDATE_BOOLEAN,
|
|
|
|
|
|
|
167 |
'ajax_orders_per_step' => FILTER_VALIDATE_INT,
|
168 |
'limit_button_test' => FILTER_SANITIZE_STRING,
|
169 |
'cron_key' => FILTER_SANITIZE_STRING,
|
170 |
'ipn_url' => FILTER_SANITIZE_STRING,
|
|
|
|
|
171 |
) );
|
172 |
update_option( self::settings_name_common, $settings );
|
173 |
|
@@ -228,9 +243,9 @@ class WC_Order_Export_Admin {
|
|
228 |
$mode = WC_Order_Export_Manage::EXPORT_ORDER_ACTION;
|
229 |
$all_items = WC_Order_Export_Manage::get_export_settings_collection( $mode );
|
230 |
$show = array(
|
231 |
-
'date_filter' =>
|
232 |
-
'export_button' =>
|
233 |
-
'export_button_plain' =>
|
234 |
'preview_actions' => false,
|
235 |
'destinations' => true,
|
236 |
'schedule' => false,
|
@@ -502,6 +517,50 @@ class WC_Order_Export_Admin {
|
|
502 |
wp_enqueue_style( 'export', $this->url_plugin . 'assets/css/export.css', array(), WOE_VERSION );
|
503 |
wp_enqueue_style( 'woocommerce_admin_styles', WC()->plugin_url() . '/assets/css/admin.css', array() );
|
504 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
505 |
|
506 |
// Localize the script with new data
|
507 |
$translation_array = array(
|
@@ -667,9 +726,12 @@ class WC_Order_Export_Admin {
|
|
667 |
if( ! empty($settings['format']) ) {
|
668 |
$actions['woe_export_selected_orders'] = sprintf( __( 'Export as %s', 'woo-order-export-lite' ), $settings['format'] );
|
669 |
}
|
|
|
670 |
// mark/unmark
|
671 |
-
$
|
672 |
-
|
|
|
|
|
673 |
|
674 |
$all_items = WC_Order_Export_Manage::get_export_settings_collection( WC_Order_Export_Manage::EXPORT_PROFILE );
|
675 |
foreach ( $all_items as $job_id => $job ) {
|
@@ -764,7 +826,8 @@ class WC_Order_Export_Admin {
|
|
764 |
|
765 |
function must_run_ajax_methods() {
|
766 |
// wait admin ajax!
|
767 |
-
|
|
|
768 |
return false;
|
769 |
// our method MUST BE called
|
770 |
return isset($_REQUEST['action']) AND ($_REQUEST['action'] == "order_exporter" OR $_REQUEST['action'] == "order_exporter_run" );
|
8 |
var $activation_notice_option = 'woocommerce-order-export-activation-notice-shown';
|
9 |
var $step = 30;
|
10 |
public static $formats = array( 'XLS', 'CSV', 'XML', 'JSON', 'TSV' );
|
11 |
+
public static $export_types = array( 'EMAIL', 'FTP', 'HTTP', 'FOLDER', 'SFTP', 'ZAPIER' );
|
12 |
public $url_plugin;
|
13 |
public $path_plugin;
|
14 |
var $methods_allowed_for_guests;
|
50 |
}
|
51 |
}
|
52 |
|
53 |
+
$this->settings = self::load_main_settings();
|
54 |
+
|
55 |
//Pro active ?
|
56 |
if( self::is_full_version() ) {
|
57 |
+
new WC_Order_Export_Zapier_Engine( $this->settings );
|
58 |
add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
|
59 |
add_filter( 'cron_schedules', array( 'WC_Order_Export_Cron', 'create_custom_schedules' ), 10, 1 );
|
60 |
add_action( 'wc_export_cron_global', array( 'WC_Order_Export_Cron', 'wc_export_cron_global_f' ) );
|
74 |
} );
|
75 |
}
|
76 |
|
|
|
77 |
}
|
78 |
|
79 |
public function add_order_status_column_header( $columns ) {
|
80 |
+
|
81 |
+
if( ! $this->settings['show_export_status_column'] )
|
82 |
+
return $columns;
|
83 |
+
|
84 |
$new_columns = array();
|
|
|
85 |
foreach ( $columns as $column_name => $column_info ) {
|
86 |
if ( 'order_actions' === $column_name OR 'wc_actions' === $column_name) { // Woocommerce uses wc_actions since 3.3.0
|
87 |
$label = __( 'Export Status', 'woo-order-export-lite' );
|
157 |
return array_merge(
|
158 |
array(
|
159 |
'cron_tasks_active' => '1',
|
160 |
+
'show_export_status_column' => '1',
|
161 |
+
'show_export_actions_in_bulk' => '1',
|
162 |
+
'show_export_in_status_change_job' => '0',
|
163 |
'ajax_orders_per_step' => '30',
|
164 |
'limit_button_test' => '1',
|
165 |
'cron_key' => '1234',
|
166 |
'ipn_url' => '',
|
167 |
+
'zapier_api_key' => '12345678',
|
168 |
+
'zapier_file_timeout' => 60,
|
169 |
),
|
170 |
get_option( self::settings_name_common, array() )
|
171 |
);
|
174 |
// update main settings here!
|
175 |
$settings = filter_input_array(INPUT_POST, array(
|
176 |
'cron_tasks_active' => FILTER_VALIDATE_BOOLEAN,
|
177 |
+
'show_export_status_column' => FILTER_VALIDATE_BOOLEAN,
|
178 |
+
'show_export_actions_in_bulk' => FILTER_VALIDATE_BOOLEAN,
|
179 |
+
'show_export_in_status_change_job' => FILTER_VALIDATE_BOOLEAN,
|
180 |
'ajax_orders_per_step' => FILTER_VALIDATE_INT,
|
181 |
'limit_button_test' => FILTER_SANITIZE_STRING,
|
182 |
'cron_key' => FILTER_SANITIZE_STRING,
|
183 |
'ipn_url' => FILTER_SANITIZE_STRING,
|
184 |
+
'zapier_api_key' => FILTER_SANITIZE_STRING,
|
185 |
+
'zapier_file_timeout' => FILTER_SANITIZE_NUMBER_INT,
|
186 |
) );
|
187 |
update_option( self::settings_name_common, $settings );
|
188 |
|
243 |
$mode = WC_Order_Export_Manage::EXPORT_ORDER_ACTION;
|
244 |
$all_items = WC_Order_Export_Manage::get_export_settings_collection( $mode );
|
245 |
$show = array(
|
246 |
+
'date_filter' => $this->settings['show_export_in_status_change_job'],
|
247 |
+
'export_button' => $this->settings['show_export_in_status_change_job'],
|
248 |
+
'export_button_plain' => $this->settings['show_export_in_status_change_job'],
|
249 |
'preview_actions' => false,
|
250 |
'destinations' => true,
|
251 |
'schedule' => false,
|
517 |
wp_enqueue_style( 'export', $this->url_plugin . 'assets/css/export.css', array(), WOE_VERSION );
|
518 |
wp_enqueue_style( 'woocommerce_admin_styles', WC()->plugin_url() . '/assets/css/admin.css', array() );
|
519 |
|
520 |
+
$_REQUEST['tab'] = isset( $_REQUEST['tab'] ) ? $_REQUEST['tab'] : 'export';
|
521 |
+
if ( isset( $_REQUEST['wc_oe'] ) AND ( strpos($_REQUEST['wc_oe'], 'add_') === 0 OR strpos($_REQUEST['wc_oe'], 'edit_') === 0 ) OR $_REQUEST['tab'] == 'export') {
|
522 |
+
wp_enqueue_script( 'settings-form', $this->url_plugin . 'assets/js/settings-form.js', array(), WOE_VERSION );
|
523 |
+
|
524 |
+
$localize_settings_form = array(
|
525 |
+
'set_up_fields_to_export' => __( 'Set up fields to export', 'woo-order-export-lite' ),
|
526 |
+
'js_tpl_popup' => __( 'Add %s as %s columns %s as rows', 'woo-order-export-lite' )
|
527 |
+
);
|
528 |
+
wp_localize_script( 'settings-form', 'localize_settings_form', $localize_settings_form );
|
529 |
+
|
530 |
+
|
531 |
+
$settings_form = array(
|
532 |
+
'save_settings_url' => esc_url( add_query_arg(
|
533 |
+
array(
|
534 |
+
'page' => 'wc-order-export',
|
535 |
+
'tab' => $_REQUEST['tab'],
|
536 |
+
'save' => 'y',
|
537 |
+
),
|
538 |
+
admin_url( 'admin.php' ) ) ),
|
539 |
+
|
540 |
+
'EXPORT_NOW' => WC_Order_Export_Manage::EXPORT_NOW,
|
541 |
+
'EXPORT_PROFILE' => WC_Order_Export_Manage::EXPORT_PROFILE,
|
542 |
+
'EXPORT_SCHEDULE' => WC_Order_Export_Manage::EXPORT_SCHEDULE,
|
543 |
+
'EXPORT_ORDER_ACTION' => WC_Order_Export_Manage::EXPORT_ORDER_ACTION,
|
544 |
+
|
545 |
+
'copy_to_profiles_url' => esc_url( add_query_arg(
|
546 |
+
array(
|
547 |
+
'page' => 'wc-order-export',
|
548 |
+
'tab' => 'profiles',
|
549 |
+
'wc_oe' => 'edit_profile',
|
550 |
+
),
|
551 |
+
admin_url( 'admin.php' ) ) ),
|
552 |
+
|
553 |
+
'flat_formats' => array( 'XLS', 'CSV', 'TSV' ),
|
554 |
+
'object_formats' => array( 'XML', 'JSON' ),
|
555 |
+
'xml_formats' => array( 'XML' ),
|
556 |
+
|
557 |
+
'day_names' => WC_Order_Export_Manage::get_days(),
|
558 |
+
|
559 |
+
);
|
560 |
+
|
561 |
+
wp_localize_script( 'settings-form', 'settings_form', $settings_form );
|
562 |
+
|
563 |
+
};
|
564 |
|
565 |
// Localize the script with new data
|
566 |
$translation_array = array(
|
726 |
if( ! empty($settings['format']) ) {
|
727 |
$actions['woe_export_selected_orders'] = sprintf( __( 'Export as %s', 'woo-order-export-lite' ), $settings['format'] );
|
728 |
}
|
729 |
+
|
730 |
// mark/unmark
|
731 |
+
if( $this->settings['show_export_actions_in_bulk'] ) {
|
732 |
+
$actions['woe_mark_exported'] = __( 'Mark exported', 'woo-order-export-lite' );
|
733 |
+
$actions['woe_unmark_exported'] = __( 'Unmark exported', 'woo-order-export-lite' );
|
734 |
+
}
|
735 |
|
736 |
$all_items = WC_Order_Export_Manage::get_export_settings_collection( WC_Order_Export_Manage::EXPORT_PROFILE );
|
737 |
foreach ( $all_items as $job_id => $job ) {
|
826 |
|
827 |
function must_run_ajax_methods() {
|
828 |
// wait admin ajax!
|
829 |
+
$script_name = !empty($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : $_SERVER['PHP_SELF'];
|
830 |
+
if ( basename( $script_name ) != "admin-ajax.php" )
|
831 |
return false;
|
832 |
// our method MUST BE called
|
833 |
return isset($_REQUEST['action']) AND ($_REQUEST['action'] == "order_exporter" OR $_REQUEST['action'] == "order_exporter_run" );
|
classes/core/class-wc-order-export-data-extractor-ui.php
CHANGED
@@ -10,7 +10,7 @@ class WC_Order_Export_Data_Extractor_UI extends WC_Order_Export_Data_Extractor {
|
|
10 |
// ADD custom fields for export
|
11 |
public static function get_all_order_custom_meta_fields( $sql_order_ids='' ) {
|
12 |
global $wpdb;
|
13 |
-
|
14 |
$transient_key = 'woe_get_all_order_custom_meta_fields_results_'.md5( json_encode( $sql_order_ids ) ); // complex key
|
15 |
$fields = get_transient( $transient_key );
|
16 |
if($fields === false) {
|
@@ -26,7 +26,7 @@ class WC_Order_Export_Data_Extractor_UI extends WC_Order_Export_Data_Extractor {
|
|
26 |
$user_ids = $wpdb->get_col( "SELECT ID FROM {$wpdb->users} ORDER BY ID DESC LIMIT 1000"); // take last 1000
|
27 |
$user_ids = join( ",", $user_ids);
|
28 |
$where_users = "WHERE user_id IN ($user_ids)";
|
29 |
-
}
|
30 |
else
|
31 |
$where_users = '';
|
32 |
$user_fields = $wpdb->get_col( "SELECT DISTINCT meta_key FROM {$wpdb->usermeta} $where_users" );
|
@@ -41,7 +41,7 @@ class WC_Order_Export_Data_Extractor_UI extends WC_Order_Export_Data_Extractor {
|
|
41 |
$fields = array_unique( array_merge( $fields, $user_fields ) );
|
42 |
sort( $fields );
|
43 |
//debug set_transient( $transient_key, $fields, 60 ); //valid for a 1 min
|
44 |
-
}
|
45 |
return apply_filters( 'woe_get_all_order_custom_meta_fields', $fields );
|
46 |
}
|
47 |
|
@@ -230,9 +230,11 @@ class WC_Order_Export_Data_Extractor_UI extends WC_Order_Export_Data_Extractor {
|
|
230 |
}
|
231 |
|
232 |
public static function get_products_itemmeta_values( $key ) {
|
233 |
-
|
|
|
|
|
234 |
$meta_key_ent = esc_html($key);
|
235 |
-
$metas = $wpdb->get_col( $wpdb->prepare("SELECT DISTINCT meta_value FROM {$wpdb->prefix}woocommerce_order_itemmeta where meta_key = '%s' OR meta_key='%s' LIMIT
|
236 |
sort( $metas );
|
237 |
return $metas;
|
238 |
}
|
@@ -266,6 +268,44 @@ class WC_Order_Export_Data_Extractor_UI extends WC_Order_Export_Data_Extractor {
|
|
266 |
sort( $data );
|
267 |
return $data;
|
268 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
269 |
|
270 |
|
271 |
public static function get_order_product_fields( $format ) {
|
@@ -273,7 +313,8 @@ class WC_Order_Export_Data_Extractor_UI extends WC_Order_Export_Data_Extractor {
|
|
273 |
'item_id' => array( 'label' => __( 'Item ID', 'woo-order-export-lite' ), 'checked' => 0 ),
|
274 |
'line_id' => array( 'label' => __( 'Item #', 'woo-order-export-lite' ), 'checked' => 1 ),
|
275 |
'sku' => array( 'label' => __( 'SKU', 'woo-order-export-lite' ), 'checked' => 1 ),
|
276 |
-
'name' => array( 'label' => __( 'Name', 'woo-order-export-lite' ), 'checked' => 1 ),
|
|
|
277 |
'product_variation' => array( 'label' => __( 'Product Variation', 'woo-order-export-lite' ), 'checked' => 0 ),
|
278 |
'seller' => array( 'label' => __( 'Item Seller', 'woo-order-export-lite' ), 'checked' => 0 ),
|
279 |
'qty' => array( 'label' => __( 'Quantity', 'woo-order-export-lite' ), 'checked' => 1 ),
|
@@ -373,11 +414,12 @@ class WC_Order_Export_Data_Extractor_UI extends WC_Order_Export_Data_Extractor {
|
|
373 |
|
374 |
public static function get_order_fields_user() {
|
375 |
return array(
|
376 |
-
'customer_ip_address'
|
377 |
-
'customer_user'
|
378 |
-
'user_login'
|
379 |
-
'user_email'
|
380 |
-
'user_role'
|
|
|
381 |
);
|
382 |
}
|
383 |
|
10 |
// ADD custom fields for export
|
11 |
public static function get_all_order_custom_meta_fields( $sql_order_ids='' ) {
|
12 |
global $wpdb;
|
13 |
+
|
14 |
$transient_key = 'woe_get_all_order_custom_meta_fields_results_'.md5( json_encode( $sql_order_ids ) ); // complex key
|
15 |
$fields = get_transient( $transient_key );
|
16 |
if($fields === false) {
|
26 |
$user_ids = $wpdb->get_col( "SELECT ID FROM {$wpdb->users} ORDER BY ID DESC LIMIT 1000"); // take last 1000
|
27 |
$user_ids = join( ",", $user_ids);
|
28 |
$where_users = "WHERE user_id IN ($user_ids)";
|
29 |
+
}
|
30 |
else
|
31 |
$where_users = '';
|
32 |
$user_fields = $wpdb->get_col( "SELECT DISTINCT meta_key FROM {$wpdb->usermeta} $where_users" );
|
41 |
$fields = array_unique( array_merge( $fields, $user_fields ) );
|
42 |
sort( $fields );
|
43 |
//debug set_transient( $transient_key, $fields, 60 ); //valid for a 1 min
|
44 |
+
}
|
45 |
return apply_filters( 'woe_get_all_order_custom_meta_fields', $fields );
|
46 |
}
|
47 |
|
230 |
}
|
231 |
|
232 |
public static function get_products_itemmeta_values( $key ) {
|
233 |
+
global $wpdb;
|
234 |
+
$max_len = apply_filters( 'woe_itemmeta_values_max_length', 50 );
|
235 |
+
$limit = apply_filters( 'woe_itemmeta_values_max_records', 200 );
|
236 |
$meta_key_ent = esc_html($key);
|
237 |
+
$metas = $wpdb->get_col( $wpdb->prepare("SELECT DISTINCT meta_value FROM {$wpdb->prefix}woocommerce_order_itemmeta where (meta_key = '%s' OR meta_key='%s') AND LENGTH(meta_value) <= $max_len LIMIT $limit", $key, $meta_key_ent ));
|
238 |
sort( $metas );
|
239 |
return $metas;
|
240 |
}
|
268 |
sort( $data );
|
269 |
return $data;
|
270 |
}
|
271 |
+
|
272 |
+
public static function get_order_item_names( $type ) {
|
273 |
+
global $wpdb;
|
274 |
+
|
275 |
+
$names = $wpdb->get_col( $wpdb->prepare("SELECT DISTINCT order_item_name FROM {$wpdb->prefix}woocommerce_order_items WHERE order_item_type = %s ORDER BY order_item_id DESC LIMIT 1000", $type) );
|
276 |
+
sort($names);
|
277 |
+
return $names;
|
278 |
+
}
|
279 |
+
|
280 |
+
public static function get_item_meta_keys() {
|
281 |
+
global $wpdb;
|
282 |
+
|
283 |
+
$names = $wpdb->get_results( "SELECT distinct order_item_type,meta_key FROM {$wpdb->prefix}woocommerce_order_items AS items
|
284 |
+
INNER JOIN (SELECT ID AS order_id FROM {$wpdb->prefix}posts WHERE post_type='shop_order' ORDER BY ID DESC LIMIT 1000) AS orders ON orders.order_id = items.order_id
|
285 |
+
JOIN {$wpdb->prefix}woocommerce_order_itemmeta AS meta ON meta.order_item_id = items.order_item_id
|
286 |
+
ORDER BY order_item_type,meta_key" );
|
287 |
+
|
288 |
+
$keys = array();
|
289 |
+
foreach($names as $n)
|
290 |
+
$keys[$n->order_item_type][$n->meta_key] = $n->meta_key;
|
291 |
+
return $keys;
|
292 |
+
}
|
293 |
+
|
294 |
+
public static function get_order_item_meta_key_values( $meta_key ) {
|
295 |
+
global $wpdb;
|
296 |
+
|
297 |
+
self::extract_item_type_and_key( $meta_key , $type, $key );
|
298 |
+
|
299 |
+
//we skip serialized and long values!
|
300 |
+
$values = $wpdb->get_col( $wpdb->prepare( "SELECT distinct meta_value FROM {$wpdb->prefix}woocommerce_order_items AS items
|
301 |
+
JOIN {$wpdb->prefix}woocommerce_order_itemmeta AS meta ON meta.order_item_id = items.order_item_id
|
302 |
+
WHERE items.order_item_type = %s AND meta.meta_key=%s
|
303 |
+
AND meta_value NOT LIKE 'a:%' AND LENGTH(meta_value)<20
|
304 |
+
ORDER BY meta_value", $type,$key ) );
|
305 |
+
return $values;
|
306 |
+
}
|
307 |
+
|
308 |
+
|
309 |
|
310 |
|
311 |
public static function get_order_product_fields( $format ) {
|
313 |
'item_id' => array( 'label' => __( 'Item ID', 'woo-order-export-lite' ), 'checked' => 0 ),
|
314 |
'line_id' => array( 'label' => __( 'Item #', 'woo-order-export-lite' ), 'checked' => 1 ),
|
315 |
'sku' => array( 'label' => __( 'SKU', 'woo-order-export-lite' ), 'checked' => 1 ),
|
316 |
+
'name' => array( 'label' => __( 'Item Name', 'woo-order-export-lite' ), 'checked' => 1 ),
|
317 |
+
'product_name'=> array( 'label' => __( 'Product Name', 'woo-order-export-lite' ), 'checked' => 0 ),
|
318 |
'product_variation' => array( 'label' => __( 'Product Variation', 'woo-order-export-lite' ), 'checked' => 0 ),
|
319 |
'seller' => array( 'label' => __( 'Item Seller', 'woo-order-export-lite' ), 'checked' => 0 ),
|
320 |
'qty' => array( 'label' => __( 'Quantity', 'woo-order-export-lite' ), 'checked' => 1 ),
|
414 |
|
415 |
public static function get_order_fields_user() {
|
416 |
return array(
|
417 |
+
'customer_ip_address' => array( 'label' => __( 'Customer IP address', 'woo-order-export-lite' ), 'checked' => 0 ),
|
418 |
+
'customer_user' => array( 'label' => __( 'Customer User ID', 'woo-order-export-lite' ), 'checked' => 0 ),
|
419 |
+
'user_login' => array( 'label' => __( 'Customer Username', 'woo-order-export-lite' ), 'checked' => 0 ),
|
420 |
+
'user_email' => array( 'label' => __( 'Customer User Email', 'woo-order-export-lite' ), 'checked' => 0 ),
|
421 |
+
'user_role' => array( 'label' => __( 'Customer Role', 'woo-order-export-lite' ), 'checked' => 0 ),
|
422 |
+
'customer_total_orders' => array( 'label' => __( 'Customer Total Orders', 'woo-order-export-lite' ), 'checked' => 0 ),
|
423 |
);
|
424 |
}
|
425 |
|
classes/core/class-wc-order-export-data-extractor.php
CHANGED
@@ -15,13 +15,23 @@ class WC_Order_Export_Data_Extractor {
|
|
15 |
static $object_type = 'shop_order';
|
16 |
static $export_subcategories_separator;
|
17 |
static $export_line_categories_separator;
|
|
|
18 |
static $track_sql_queries = false;
|
19 |
static $sql_queries;
|
|
|
20 |
const HUGE_SHOP_ORDERS = 1000;// more than 1000 orders
|
21 |
const HUGE_SHOP_PRODUCTS = 1000;// more than 1000 products
|
22 |
|
23 |
|
24 |
//Common
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
public static function get_order_custom_fields() {
|
26 |
global $wpdb;
|
27 |
$transient_key = 'woe_get_order_custom_fields_result';
|
@@ -149,14 +159,18 @@ class WC_Order_Export_Data_Extractor {
|
|
149 |
return $pair_types;
|
150 |
}
|
151 |
|
152 |
-
private static function parse_complex_pairs( $pairs, $valid_types, $mode = '' ) {
|
153 |
$pair_types = array();
|
154 |
$delimiters = array(
|
155 |
-
'=' => 'IN',
|
156 |
-
'<>' => 'NOT IN',
|
157 |
-
'LIKE' => 'LIKE',
|
158 |
'NOT SET' => 'NOT SET',
|
159 |
'IS SET' => 'IS SET',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
);
|
161 |
$single_ops = array('NOT SET', 'IS SET');
|
162 |
|
@@ -186,9 +200,11 @@ class WC_Order_Export_Data_Extractor {
|
|
186 |
if ( $mode == 'lower_filter_label' ) {
|
187 |
$filter_type = strtolower( $filter_type );
|
188 |
} // Country=>country for locations
|
189 |
-
|
|
|
190 |
continue;
|
191 |
}
|
|
|
192 |
$filter_type = addslashes($filter_type);
|
193 |
if ( ! isset( $pair_types[ $op ] ) ) {
|
194 |
$pair_types[ $op ] = array();
|
@@ -230,7 +246,7 @@ class WC_Order_Export_Data_Extractor {
|
|
230 |
// filter by product
|
231 |
if ( $product_where ) {
|
232 |
$left_join_order_items_meta[] = "LEFT JOIN $wc_order_items_meta AS orderitemmeta_product ON orderitemmeta_product.order_item_id = order_items.order_item_id";
|
233 |
-
$order_items_meta_where[] = " (orderitemmeta_product.meta_key IN ('_variation_id', '_product_id')
|
234 |
} else {
|
235 |
$left_join_order_items_meta[] = "LEFT JOIN $wc_order_items_meta AS orderitemmeta_product ON orderitemmeta_product.order_item_id = order_items.order_item_id";
|
236 |
$order_items_meta_where[] = " orderitemmeta_product.meta_key IN ('_variation_id', '_product_id')";
|
@@ -249,10 +265,10 @@ class WC_Order_Export_Data_Extractor {
|
|
249 |
if( $operator == 'IN' OR $operator == 'NOT IN' ) {
|
250 |
$values = self::sql_subset( $values );
|
251 |
$order_items_meta_where[] = " (`orderitemmeta_{$field}`.meta_key='$field' AND `orderitemmeta_{$field}`.meta_value $operator ($values) ) ";
|
252 |
-
} elseif( $operator
|
253 |
$pairs = array();
|
254 |
foreach($values as $v)
|
255 |
-
$pairs[] = "
|
256 |
$pairs = join("OR", $pairs);
|
257 |
$order_items_meta_where[] = " (`orderitemmeta_{$field}`.meta_key='$field' AND ($pairs) ) ";
|
258 |
}
|
@@ -276,10 +292,10 @@ class WC_Order_Export_Data_Extractor {
|
|
276 |
if( $operator == 'IN' OR $operator == 'NOT IN' ) {
|
277 |
$values = self::sql_subset( $values );
|
278 |
$order_items_meta_where[] = " (`orderitemmeta_{$field}`.meta_key='$field' AND `orderitemmeta_{$field}`.meta_value $operator ($values) ) ";
|
279 |
-
} elseif( $operator
|
280 |
$pairs = array();
|
281 |
foreach($values as $v)
|
282 |
-
$pairs[] = "
|
283 |
$pairs = join("OR", $pairs);
|
284 |
$order_items_meta_where[] = " (`orderitemmeta_{$field}`.meta_key='$field' AND ($pairs) ) ";
|
285 |
}
|
@@ -311,6 +327,8 @@ class WC_Order_Export_Data_Extractor {
|
|
311 |
$left_join_order_items_meta
|
312 |
WHERE order_item_type='line_item' $order_items_meta_where GROUP BY order_item_id
|
313 |
) AS temp";
|
|
|
|
|
314 |
return $sql;
|
315 |
}
|
316 |
|
@@ -348,10 +366,10 @@ class WC_Order_Export_Data_Extractor {
|
|
348 |
if( $operator == 'IN' OR $operator == 'NOT IN' ) {
|
349 |
$values = self::sql_subset( $values );
|
350 |
$product_meta_where[] = " (productmeta_cf_{$pos}.meta_key='$field' AND productmeta_cf_{$pos}.meta_value $operator ($values)) ";
|
351 |
-
} elseif( $operator
|
352 |
$pairs = array();
|
353 |
foreach($values as $v)
|
354 |
-
$pairs[] = "
|
355 |
$pairs = join("OR", $pairs);
|
356 |
$product_meta_where[] = " (productmeta_cf_{$pos}.meta_key='$field' AND ($pairs) ) ";
|
357 |
}
|
@@ -399,17 +417,16 @@ class WC_Order_Export_Data_Extractor {
|
|
399 |
$field = $names2fields[ $label ];
|
400 |
$values = self::sql_subset( $values );
|
401 |
if ( $values ) {
|
402 |
-
$
|
403 |
-
$taxonomy_where
|
404 |
INNER JOIN {$wpdb->term_taxonomy} AS `{$field}_cat` ON `{$field}_cat`.term_taxonomy_id = `{$field}_rel`.term_taxonomy_id
|
405 |
-
WHERE `{$field}_cat`.term_id IN (SELECT term_id FROM {$wpdb->terms} WHERE name
|
406 |
-
)";
|
407 |
}
|
408 |
}
|
409 |
}
|
410 |
}
|
411 |
|
412 |
-
$product_category_where =
|
413 |
if ( $settings['product_categories'] ) {
|
414 |
$cat_ids = array( 0 );
|
415 |
foreach ( $settings['product_categories'] as $cat_id ) {
|
@@ -419,13 +436,12 @@ class WC_Order_Export_Data_Extractor {
|
|
419 |
}
|
420 |
}
|
421 |
$cat_ids = join( ',', $cat_ids );
|
422 |
-
$taxonomy_where_object_id = $taxonomy_where ? "AND object_id IN ($taxonomy_where)" : "";
|
423 |
$product_category_where = "SELECT DISTINCT object_id FROM {$wpdb->term_relationships} AS product_in_cat
|
424 |
LEFT JOIN {$wpdb->term_taxonomy} AS product_category ON product_category.term_taxonomy_id = product_in_cat.term_taxonomy_id
|
425 |
-
WHERE product_category.term_id IN ($cat_ids)
|
426 |
";
|
427 |
// get products and variations!
|
428 |
-
$product_category_where = "
|
429 |
(
|
430 |
SELECT DISTINCT ID FROM {$wpdb->posts} AS product_category_variations WHERE post_parent IN ($product_category_where)
|
431 |
UNION
|
@@ -437,20 +453,30 @@ class WC_Order_Export_Data_Extractor {
|
|
437 |
$settings['products'] = self::sql_get_filtered_product_list($settings);
|
438 |
|
439 |
// deep level still
|
440 |
-
$
|
441 |
if ( $settings['products'] ) {
|
442 |
$values = self::sql_subset( $settings['products'] );
|
443 |
if ( $values ) {
|
444 |
-
$
|
445 |
-
$product_category_where = "";
|
446 |
}
|
447 |
}
|
448 |
-
|
449 |
-
|
450 |
-
|
|
|
|
|
451 |
return $product_where ;
|
452 |
}
|
453 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
454 |
public static function sql_get_order_ids_Ver1( $settings ) {
|
455 |
global $wpdb;
|
456 |
|
@@ -463,7 +489,7 @@ class WC_Order_Export_Data_Extractor {
|
|
463 |
// filter by product
|
464 |
if ( $product_where ) {
|
465 |
$left_join_order_items_meta[] = "LEFT JOIN $wc_order_items_meta AS orderitemmeta_product ON orderitemmeta_product.order_item_id = order_items.order_item_id";
|
466 |
-
$order_items_meta_where[] = " (orderitemmeta_product.meta_key IN ('_variation_id', '_product_id')
|
467 |
}
|
468 |
|
469 |
|
@@ -480,10 +506,10 @@ class WC_Order_Export_Data_Extractor {
|
|
480 |
if( $operator == 'IN' OR $operator == 'NOT IN' ) {
|
481 |
$values = self::sql_subset( $values );
|
482 |
$order_items_meta_where[] = " (`orderitemmeta_{$field}`.meta_key='$field' AND `orderitemmeta_{$field}`.meta_value $operator ($values) ) ";
|
483 |
-
} elseif( $operator
|
484 |
$pairs = array();
|
485 |
foreach($values as $v)
|
486 |
-
$pairs[] = "
|
487 |
$pairs = join("OR", $pairs);
|
488 |
$order_items_meta_where[] = " (`orderitemmeta_{$field}`.meta_key='$field' AND ($pairs) ) ";
|
489 |
}
|
@@ -507,10 +533,10 @@ class WC_Order_Export_Data_Extractor {
|
|
507 |
if( $operator == 'IN' OR $operator == 'NOT IN' ) {
|
508 |
$values = self::sql_subset( $values );
|
509 |
$order_items_meta_where[] = " (`orderitemmeta_{$field}`.meta_key='$field' AND `orderitemmeta_{$field}`.meta_value $operator ($values) ) ";
|
510 |
-
} elseif( $operator
|
511 |
$pairs = array();
|
512 |
foreach($values as $v)
|
513 |
-
$pairs[] = "
|
514 |
$pairs = join("OR", $pairs);
|
515 |
$order_items_meta_where[] = " (`orderitemmeta_{$field}`.meta_key='$field' AND ($pairs) ) ";
|
516 |
}
|
@@ -546,22 +572,32 @@ class WC_Order_Export_Data_Extractor {
|
|
546 |
}
|
547 |
// shipping methods
|
548 |
if ( ! empty( $settings['shipping_methods'] ) ) {
|
549 |
-
$zone_values = $itemname_values = array();
|
550 |
foreach($settings['shipping_methods'] as $value) {
|
551 |
if( preg_match('#^order_item_name:(.+)#',$value, $m) )
|
552 |
-
$itemname_values[] =
|
553 |
-
else
|
554 |
-
$zone_values[] =
|
|
|
|
|
|
|
|
|
|
|
|
|
555 |
}
|
556 |
|
557 |
// where by type!
|
558 |
$ship_where = array();
|
559 |
if( $zone_values ) {
|
560 |
-
$zone_values =
|
561 |
-
$ship_where[] = " (shipping_itemmeta.meta_key='method_id' AND (
|
|
|
|
|
|
|
|
|
562 |
}
|
563 |
if( $itemname_values ) {
|
564 |
-
$itemname_values =
|
565 |
$ship_where[] = " (order_shippings.order_item_name IN ( $itemname_values ) ) ";
|
566 |
}
|
567 |
$ship_where = join( ' OR ', $ship_where);
|
@@ -571,6 +607,44 @@ class WC_Order_Export_Data_Extractor {
|
|
571 |
LEFT JOIN {$wpdb->prefix}woocommerce_order_itemmeta AS shipping_itemmeta ON shipping_itemmeta.order_item_id = order_shippings.order_item_id
|
572 |
WHERE order_shippings.order_item_type='shipping' AND $ship_where )";
|
573 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
574 |
|
575 |
// pre top
|
576 |
$left_join_order_meta = $order_meta_where = array();
|
@@ -598,10 +672,10 @@ class WC_Order_Export_Data_Extractor {
|
|
598 |
$order_meta_where [] = " ( ordermeta_cf_{$pos}.meta_value IS NULL ) ";
|
599 |
} elseif( $operator == 'IS SET' ) {
|
600 |
$order_meta_where [] = " ( ordermeta_cf_{$pos}.meta_value IS NOT NULL ) ";
|
601 |
-
} elseif( $operator
|
602 |
$pairs = array();
|
603 |
-
foreach($values as $v)
|
604 |
-
$pairs[] = "
|
605 |
$pairs = join("OR", $pairs);
|
606 |
$order_meta_where[] = " ( $pairs ) ";
|
607 |
}
|
@@ -754,6 +828,10 @@ class WC_Order_Export_Data_Extractor {
|
|
754 |
// Skip drafts and deleted
|
755 |
$where[] = "orders.post_status NOT in ('auto-draft','trash')";
|
756 |
}
|
|
|
|
|
|
|
|
|
757 |
|
758 |
public static function get_date_range( $settings, $is_for_sql, $use_timestamps=false ) {
|
759 |
$result = array();
|
@@ -761,7 +839,11 @@ class WC_Order_Export_Data_Extractor {
|
|
761 |
// fixed date range
|
762 |
if ( !empty( $settings['from_date'] ) OR !empty( $settings['to_date'] ) ) {
|
763 |
if ( $settings['from_date'] ) {
|
764 |
-
$
|
|
|
|
|
|
|
|
|
765 |
if ( $is_for_sql ) {
|
766 |
if( $use_timestamps )
|
767 |
$from_date = mysql2date( 'U', $from_date );
|
@@ -771,7 +853,11 @@ class WC_Order_Export_Data_Extractor {
|
|
771 |
}
|
772 |
|
773 |
if ( $settings['to_date'] ) {
|
774 |
-
$
|
|
|
|
|
|
|
|
|
775 |
if ( $is_for_sql ) {
|
776 |
if( $use_timestamps )
|
777 |
$to_date = mysql2date( 'U', $to_date );
|
@@ -917,6 +1003,7 @@ class WC_Order_Export_Data_Extractor {
|
|
917 |
self::$decimals = wc_get_price_decimals();
|
918 |
self::$export_subcategories_separator = apply_filters( 'woe_export_subcategories_separator', ">" );
|
919 |
self::$export_line_categories_separator = apply_filters( 'woe_export_line_categories_separator', ",\n" );
|
|
|
920 |
}
|
921 |
|
922 |
//for debug
|
@@ -1031,9 +1118,11 @@ class WC_Order_Export_Data_Extractor {
|
|
1031 |
if( $export_refunds AND $item['qty'] == 0 ) // skip zero items, when export refunds
|
1032 |
continue;
|
1033 |
// we export only matched products?
|
1034 |
-
if( $export_only_products AND
|
|
|
|
|
|
|
1035 |
continue;
|
1036 |
-
|
1037 |
$product = $order->get_product_from_item( $item );
|
1038 |
$product = apply_filters( "woe_get_order_product", $product );
|
1039 |
$item_meta = get_metadata( 'order_item', $item_id );
|
@@ -1089,9 +1178,11 @@ class WC_Order_Export_Data_Extractor {
|
|
1089 |
} elseif ( $field == 'line_total_plus_tax' ) {
|
1090 |
$row[ $field ] = $item_meta["_line_total"][0] + $item_meta["_line_tax"][0];
|
1091 |
} elseif ( $field == 'name' ) {
|
1092 |
-
$row[
|
|
|
|
|
1093 |
} elseif ( $field == 'product_variation' ) {
|
1094 |
-
$row[
|
1095 |
} elseif ( $field == 'seller' ) {
|
1096 |
$row[ $field ] = '';
|
1097 |
if( $post ) {
|
@@ -1108,36 +1199,36 @@ class WC_Order_Export_Data_Extractor {
|
|
1108 |
$row[ $field ] = method_exists($product,'get_type') ? $product->get_type() : $product->product_type;
|
1109 |
} elseif ( $field == 'tags' ) {
|
1110 |
$terms = get_the_terms( $product_id, 'product_tag' );
|
1111 |
-
$row[
|
1112 |
if ( $terms ) {
|
1113 |
foreach ( $terms as $term ) {
|
1114 |
-
$row[
|
1115 |
}
|
1116 |
}
|
1117 |
-
$row[
|
1118 |
} elseif ( $field == 'category' ) {
|
1119 |
$terms = get_the_terms( $product_id, 'product_cat' );
|
1120 |
-
$row[
|
1121 |
if ( $terms ) {
|
1122 |
foreach ( $terms as $term ) {
|
1123 |
-
$row[
|
1124 |
}
|
1125 |
}
|
1126 |
-
$row[
|
1127 |
} elseif ( $field == 'line_no_tax' ) {
|
1128 |
-
$row[
|
1129 |
//item refund
|
1130 |
} elseif ( $field == 'line_total_refunded' ) {
|
1131 |
-
$row[
|
1132 |
} elseif ( $field == 'line_total_minus_refund' ) {
|
1133 |
-
$row[
|
1134 |
} elseif ( $field == 'qty_minus_refund' ) {
|
1135 |
-
$row[
|
1136 |
//tax refund
|
1137 |
} elseif ( $field == 'line_tax_refunded' ) {
|
1138 |
-
$row[
|
1139 |
} elseif ( $field == 'line_tax_minus_refund' ) {
|
1140 |
-
$row[
|
1141 |
} elseif ( $field == 'line_id' ) {
|
1142 |
$row[ $field ] = $i;
|
1143 |
} elseif ( $field == 'item_id' ) {
|
@@ -1181,13 +1272,13 @@ class WC_Order_Export_Data_Extractor {
|
|
1181 |
} elseif ( isset( $static_vals[ $field ] ) ) {
|
1182 |
$row[ $field ] = $static_vals[ $field ];
|
1183 |
} elseif ( isset( $item_meta[ $field ] ) ) { //meta from order
|
1184 |
-
$row[ $field ] = $item_meta[ $field ]
|
1185 |
} elseif ( isset( $item_meta[ "_" . $field ] ) ) {// or hidden field
|
1186 |
-
$row[ $field ] = $item_meta[ "_" . $field ]
|
1187 |
} elseif ( isset( $item['item_meta'][ $field ] ) ) { // meta from item line
|
1188 |
-
$row[ $field ] = $item['item_meta'][ $field ]
|
1189 |
} elseif ( isset( $item['item_meta'][ "_" . $field ] ) ) { // or hidden field
|
1190 |
-
$row[ $field ] = $item['item_meta'][ "_" . $field ]
|
1191 |
} else {
|
1192 |
$row[ $field ] = '';
|
1193 |
if( !empty( $item['variation_id'] ) )
|
@@ -1315,13 +1406,15 @@ class WC_Order_Export_Data_Extractor {
|
|
1315 |
}
|
1316 |
|
1317 |
// we know parent!
|
1318 |
-
if ( $export['products'] OR isset( $labels['order']['count_unique_products'] ) OR isset( $labels['order']['total_weight_items'] ) ) {
|
1319 |
$temp = $labels['products'];
|
1320 |
$temp['qty'] = '';
|
1321 |
$temp['weight'] = '';
|
1322 |
$data['products'] = self::fetch_order_products( $order, $temp, $format,
|
1323 |
$filters_active['products'], $static_vals['products'], $options['include_products'],
|
1324 |
$options['export_refunds'] , $options['skip_refunded_items'], $options['strip_tags_product_fields'], $options['format_number_fields'] );
|
|
|
|
|
1325 |
}
|
1326 |
if ( $export['coupons'] OR isset( $labels['order']['coupons_used'] ) ) {
|
1327 |
// get coupons from main order
|
@@ -1402,6 +1495,8 @@ class WC_Order_Export_Data_Extractor {
|
|
1402 |
$row[ $field ] = $user ? $user->$field : "";
|
1403 |
} elseif ( $field == 'user_role' ) {
|
1404 |
$row[ $field ] = ( isset($user->roles[0]) && isset($wp_roles->roles[$user->roles[0]]) ) ? $wp_roles->roles[$user->roles[0]]['name'] : ""; // take first role Name
|
|
|
|
|
1405 |
} elseif ( $field == 'billing_address' ) {
|
1406 |
$row[ $field ] = join(", ", array_filter( array( $order_meta["_billing_address_1"] , $order_meta["_billing_address_2"] ) ) );
|
1407 |
} elseif ( $field == 'shipping_address' ) {
|
@@ -1426,7 +1521,7 @@ class WC_Order_Export_Data_Extractor {
|
|
1426 |
$row[ $field ] = self::get_city_state_postcode_field_value($order, 'shipping');
|
1427 |
} elseif ( $field == 'products' OR $field == 'coupons' ) {
|
1428 |
if ( $format == 'xls' OR $format == 'csv' OR $format == 'tsv' ) {
|
1429 |
-
if ( $
|
1430 |
//print_r(array_values($row));die();
|
1431 |
//echo count($row)."-".(count($row)+count($labels[$field])-1)."|";
|
1432 |
$items = apply_filters('woe_get_'. $field .'_items_for_' . $format.'_rows', array_values( $data[ $field ] ), $order); // remove keys for items in merge
|
@@ -1443,7 +1538,9 @@ class WC_Order_Export_Data_Extractor {
|
|
1443 |
} elseif ( $field == 'shipping_method' ) {
|
1444 |
$shipping_methods = $order->get_items( 'shipping' );
|
1445 |
$shipping_method = reset($shipping_methods); // take first entry
|
1446 |
-
|
|
|
|
|
1447 |
} elseif ( $field == 'coupons_used' ) {
|
1448 |
$row[ $field ] = count( $data['coupons'] );
|
1449 |
} elseif ( $field == 'total_weight_items' ) {
|
@@ -1453,6 +1550,13 @@ class WC_Order_Export_Data_Extractor {
|
|
1453 |
}
|
1454 |
} elseif ( $field == 'count_total_items' ) {
|
1455 |
$row[ $field ] = $order->get_item_count();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1456 |
} elseif ( $field == 'count_unique_products' ) { // speed! replace with own counter ?
|
1457 |
$row[ $field ] = count( $data['products'] );
|
1458 |
} elseif ( $field == 'customer_note' ) {
|
@@ -1530,6 +1634,8 @@ class WC_Order_Export_Data_Extractor {
|
|
1530 |
} //if order field set
|
1531 |
}
|
1532 |
|
|
|
|
|
1533 |
// Must fill child cells?
|
1534 |
if ( empty($options['item_rows_start_from_new_line']) AND !empty($options['populate_other_columns_product_rows']) AND $extra_rows ) {
|
1535 |
foreach ( $extra_rows as $idx=> $extra_row ) {
|
15 |
static $object_type = 'shop_order';
|
16 |
static $export_subcategories_separator;
|
17 |
static $export_line_categories_separator;
|
18 |
+
static $export_itemmeta_values_separator;
|
19 |
static $track_sql_queries = false;
|
20 |
static $sql_queries;
|
21 |
+
static $operator_must_check_values = array( 'LIKE', '>', '<', '>=', '<=' );
|
22 |
const HUGE_SHOP_ORDERS = 1000;// more than 1000 orders
|
23 |
const HUGE_SHOP_PRODUCTS = 1000;// more than 1000 products
|
24 |
|
25 |
|
26 |
//Common
|
27 |
+
|
28 |
+
// to parse "item_type:meta_key" strings
|
29 |
+
public static function extract_item_type_and_key( $meta_key, &$type, &$key ) {
|
30 |
+
$t = explode( ":", $meta_key);
|
31 |
+
$type = array_shift($t);
|
32 |
+
$key = join( ":", $t);
|
33 |
+
}
|
34 |
+
|
35 |
public static function get_order_custom_fields() {
|
36 |
global $wpdb;
|
37 |
$transient_key = 'woe_get_order_custom_fields_result';
|
159 |
return $pair_types;
|
160 |
}
|
161 |
|
162 |
+
private static function parse_complex_pairs( $pairs, $valid_types = false, $mode = '' ) {
|
163 |
$pair_types = array();
|
164 |
$delimiters = array(
|
|
|
|
|
|
|
165 |
'NOT SET' => 'NOT SET',
|
166 |
'IS SET' => 'IS SET',
|
167 |
+
'LIKE' => 'LIKE',
|
168 |
+
'<>' => 'NOT IN',
|
169 |
+
'>=' => '>=',
|
170 |
+
'<=' => '<=',
|
171 |
+
'>' => '>',
|
172 |
+
'<' => '<',
|
173 |
+
'=' => 'IN',
|
174 |
);
|
175 |
$single_ops = array('NOT SET', 'IS SET');
|
176 |
|
200 |
if ( $mode == 'lower_filter_label' ) {
|
201 |
$filter_type = strtolower( $filter_type );
|
202 |
} // Country=>country for locations
|
203 |
+
|
204 |
+
if ( $valid_types AND !in_array( $filter_type, $valid_types ) ) {
|
205 |
continue;
|
206 |
}
|
207 |
+
|
208 |
$filter_type = addslashes($filter_type);
|
209 |
if ( ! isset( $pair_types[ $op ] ) ) {
|
210 |
$pair_types[ $op ] = array();
|
246 |
// filter by product
|
247 |
if ( $product_where ) {
|
248 |
$left_join_order_items_meta[] = "LEFT JOIN $wc_order_items_meta AS orderitemmeta_product ON orderitemmeta_product.order_item_id = order_items.order_item_id";
|
249 |
+
$order_items_meta_where[] = " (orderitemmeta_product.meta_key IN ('_variation_id', '_product_id') $product_where)";
|
250 |
} else {
|
251 |
$left_join_order_items_meta[] = "LEFT JOIN $wc_order_items_meta AS orderitemmeta_product ON orderitemmeta_product.order_item_id = order_items.order_item_id";
|
252 |
$order_items_meta_where[] = " orderitemmeta_product.meta_key IN ('_variation_id', '_product_id')";
|
265 |
if( $operator == 'IN' OR $operator == 'NOT IN' ) {
|
266 |
$values = self::sql_subset( $values );
|
267 |
$order_items_meta_where[] = " (`orderitemmeta_{$field}`.meta_key='$field' AND `orderitemmeta_{$field}`.meta_value $operator ($values) ) ";
|
268 |
+
} elseif( in_array($operator, self::$operator_must_check_values) ) {
|
269 |
$pairs = array();
|
270 |
foreach($values as $v)
|
271 |
+
$pairs[] = self::operator_compare_field_and_value( "`orderitemmeta_{$field}`.meta_value", $operator ,$v);
|
272 |
$pairs = join("OR", $pairs);
|
273 |
$order_items_meta_where[] = " (`orderitemmeta_{$field}`.meta_key='$field' AND ($pairs) ) ";
|
274 |
}
|
292 |
if( $operator == 'IN' OR $operator == 'NOT IN' ) {
|
293 |
$values = self::sql_subset( $values );
|
294 |
$order_items_meta_where[] = " (`orderitemmeta_{$field}`.meta_key='$field' AND `orderitemmeta_{$field}`.meta_value $operator ($values) ) ";
|
295 |
+
} elseif( in_array($operator, self::$operator_must_check_values) ) {
|
296 |
$pairs = array();
|
297 |
foreach($values as $v)
|
298 |
+
$pairs[] = self::operator_compare_field_and_value( "`orderitemmeta_{$field}`.meta_value", $operator ,$v);
|
299 |
$pairs = join("OR", $pairs);
|
300 |
$order_items_meta_where[] = " (`orderitemmeta_{$field}`.meta_key='$field' AND ($pairs) ) ";
|
301 |
}
|
327 |
$left_join_order_items_meta
|
328 |
WHERE order_item_type='line_item' $order_items_meta_where GROUP BY order_item_id
|
329 |
) AS temp";
|
330 |
+
if( self::$track_sql_queries )
|
331 |
+
self::$sql_queries[] = $sql;
|
332 |
return $sql;
|
333 |
}
|
334 |
|
366 |
if( $operator == 'IN' OR $operator == 'NOT IN' ) {
|
367 |
$values = self::sql_subset( $values );
|
368 |
$product_meta_where[] = " (productmeta_cf_{$pos}.meta_key='$field' AND productmeta_cf_{$pos}.meta_value $operator ($values)) ";
|
369 |
+
} elseif( in_array($operator, self::$operator_must_check_values) ) {
|
370 |
$pairs = array();
|
371 |
foreach($values as $v)
|
372 |
+
$pairs[] = self::operator_compare_field_and_value( "`productmeta_cf_{$pos}`.meta_value", $operator ,$v);
|
373 |
$pairs = join("OR", $pairs);
|
374 |
$product_meta_where[] = " (productmeta_cf_{$pos}.meta_key='$field' AND ($pairs) ) ";
|
375 |
}
|
417 |
$field = $names2fields[ $label ];
|
418 |
$values = self::sql_subset( $values );
|
419 |
if ( $values ) {
|
420 |
+
$label = esc_sql($label);
|
421 |
+
$taxonomy_where .= " AND orderitemmeta_product.meta_value $operator (SELECT object_id FROM {$wpdb->term_relationships} AS `{$field}_rel`
|
422 |
INNER JOIN {$wpdb->term_taxonomy} AS `{$field}_cat` ON `{$field}_cat`.term_taxonomy_id = `{$field}_rel`.term_taxonomy_id
|
423 |
+
WHERE `{$field}_cat`.taxonomy='$label' AND `{$field}_cat`.term_id IN (SELECT term_id FROM {$wpdb->terms} WHERE name IN ($values) ) )";
|
|
|
424 |
}
|
425 |
}
|
426 |
}
|
427 |
}
|
428 |
|
429 |
+
$product_category_where = "";
|
430 |
if ( $settings['product_categories'] ) {
|
431 |
$cat_ids = array( 0 );
|
432 |
foreach ( $settings['product_categories'] as $cat_id ) {
|
436 |
}
|
437 |
}
|
438 |
$cat_ids = join( ',', $cat_ids );
|
|
|
439 |
$product_category_where = "SELECT DISTINCT object_id FROM {$wpdb->term_relationships} AS product_in_cat
|
440 |
LEFT JOIN {$wpdb->term_taxonomy} AS product_category ON product_category.term_taxonomy_id = product_in_cat.term_taxonomy_id
|
441 |
+
WHERE product_category.term_id IN ($cat_ids)
|
442 |
";
|
443 |
// get products and variations!
|
444 |
+
$product_category_where = "AND orderitemmeta_product.meta_value IN
|
445 |
(
|
446 |
SELECT DISTINCT ID FROM {$wpdb->posts} AS product_category_variations WHERE post_parent IN ($product_category_where)
|
447 |
UNION
|
453 |
$settings['products'] = self::sql_get_filtered_product_list($settings);
|
454 |
|
455 |
// deep level still
|
456 |
+
$exact_product_where = '';
|
457 |
if ( $settings['products'] ) {
|
458 |
$values = self::sql_subset( $settings['products'] );
|
459 |
if ( $values ) {
|
460 |
+
$exact_product_where = "AND orderitemmeta_product.meta_value IN ($values)";
|
|
|
461 |
}
|
462 |
}
|
463 |
+
$product_where = join( " ", array_filter( array( $taxonomy_where, $product_category_where, $exact_product_where) ) );
|
464 |
+
|
465 |
+
//skip empty values
|
466 |
+
if( $product_where )
|
467 |
+
$product_where = "AND orderitemmeta_product.meta_value<>'0' " . $product_where ;
|
468 |
return $product_where ;
|
469 |
}
|
470 |
|
471 |
+
static function operator_compare_field_and_value( $field, $operator, $value) {
|
472 |
+
if($operator == "LIKE") {
|
473 |
+
$value = "'%$value%'";
|
474 |
+
} else { // compare numbers!
|
475 |
+
$field = "cast($field as signed)";
|
476 |
+
}
|
477 |
+
return " $field $operator $value ";
|
478 |
+
}
|
479 |
+
|
480 |
public static function sql_get_order_ids_Ver1( $settings ) {
|
481 |
global $wpdb;
|
482 |
|
489 |
// filter by product
|
490 |
if ( $product_where ) {
|
491 |
$left_join_order_items_meta[] = "LEFT JOIN $wc_order_items_meta AS orderitemmeta_product ON orderitemmeta_product.order_item_id = order_items.order_item_id";
|
492 |
+
$order_items_meta_where[] = " (orderitemmeta_product.meta_key IN ('_variation_id', '_product_id') $product_where)";
|
493 |
}
|
494 |
|
495 |
|
506 |
if( $operator == 'IN' OR $operator == 'NOT IN' ) {
|
507 |
$values = self::sql_subset( $values );
|
508 |
$order_items_meta_where[] = " (`orderitemmeta_{$field}`.meta_key='$field' AND `orderitemmeta_{$field}`.meta_value $operator ($values) ) ";
|
509 |
+
} elseif( in_array($operator, self::$operator_must_check_values) ) {
|
510 |
$pairs = array();
|
511 |
foreach($values as $v)
|
512 |
+
$pairs[] = self::operator_compare_field_and_value( "`orderitemmeta_{$field}`.meta_value", $operator ,$v);
|
513 |
$pairs = join("OR", $pairs);
|
514 |
$order_items_meta_where[] = " (`orderitemmeta_{$field}`.meta_key='$field' AND ($pairs) ) ";
|
515 |
}
|
533 |
if( $operator == 'IN' OR $operator == 'NOT IN' ) {
|
534 |
$values = self::sql_subset( $values );
|
535 |
$order_items_meta_where[] = " (`orderitemmeta_{$field}`.meta_key='$field' AND `orderitemmeta_{$field}`.meta_value $operator ($values) ) ";
|
536 |
+
} elseif( in_array($operator, self::$operator_must_check_values) ) {
|
537 |
$pairs = array();
|
538 |
foreach($values as $v)
|
539 |
+
$pairs[] = self::operator_compare_field_and_value( "`orderitemmeta_{$field}`.meta_value", $operator ,$v);
|
540 |
$pairs = join("OR", $pairs);
|
541 |
$order_items_meta_where[] = " (`orderitemmeta_{$field}`.meta_key='$field' AND ($pairs) ) ";
|
542 |
}
|
572 |
}
|
573 |
// shipping methods
|
574 |
if ( ! empty( $settings['shipping_methods'] ) ) {
|
575 |
+
$zone_values = $zone_instance_values = $itemname_values = array();
|
576 |
foreach($settings['shipping_methods'] as $value) {
|
577 |
if( preg_match('#^order_item_name:(.+)#',$value, $m) )
|
578 |
+
$itemname_values[] = $m[1];
|
579 |
+
else {
|
580 |
+
$zone_values[] = $value;
|
581 |
+
// for zones -- take instance_id!
|
582 |
+
$m = explode(":", $value);
|
583 |
+
if( count($m) > 1) {
|
584 |
+
$zone_instance_values[] = $m[1];
|
585 |
+
}
|
586 |
+
}
|
587 |
}
|
588 |
|
589 |
// where by type!
|
590 |
$ship_where = array();
|
591 |
if( $zone_values ) {
|
592 |
+
$zone_values = self::sql_subset( $zone_values );
|
593 |
+
$ship_where[] = " (shipping_itemmeta.meta_key='method_id' AND shipping_itemmeta.meta_value IN ($zone_values) ) ";
|
594 |
+
}
|
595 |
+
if( $zone_instance_values ) { //since WooCommerce 3.4+ instead of $zone_values
|
596 |
+
$zone_instance_values = self::sql_subset( $zone_instance_values );
|
597 |
+
$ship_where[] = " (shipping_itemmeta.meta_key='instance_id' AND shipping_itemmeta.meta_value IN ($zone_instance_values ) ) ";
|
598 |
}
|
599 |
if( $itemname_values ) {
|
600 |
+
$itemname_values = self::sql_subset( $itemname_values );
|
601 |
$ship_where[] = " (order_shippings.order_item_name IN ( $itemname_values ) ) ";
|
602 |
}
|
603 |
$ship_where = join( ' OR ', $ship_where);
|
607 |
LEFT JOIN {$wpdb->prefix}woocommerce_order_itemmeta AS shipping_itemmeta ON shipping_itemmeta.order_item_id = order_shippings.order_item_id
|
608 |
WHERE order_shippings.order_item_type='shipping' AND $ship_where )";
|
609 |
}
|
610 |
+
|
611 |
+
// check item names ?
|
612 |
+
if ( ! empty( $settings['item_names'] ) ) {
|
613 |
+
$filters = self::parse_complex_pairs( $settings['item_names'],
|
614 |
+
array( 'coupon', 'fee', 'line_item', 'shipping', 'tax' ) );
|
615 |
+
foreach ( $filters as $operator => $fields) {
|
616 |
+
foreach ( $fields as $field => $values ) {
|
617 |
+
if ( $values ) {
|
618 |
+
if( $operator == 'IN' OR $operator == 'NOT IN' ) {
|
619 |
+
$values = self::sql_subset( $values );
|
620 |
+
$where_item_names = " SELECT order_id FROM {$wpdb->prefix}woocommerce_order_items WHERE order_item_type='$field' AND order_item_name $operator ($values) ";
|
621 |
+
$order_items_where .= " AND orders.ID IN ($where_item_names)";
|
622 |
+
}
|
623 |
+
}//if values
|
624 |
+
}
|
625 |
+
}
|
626 |
+
}
|
627 |
+
|
628 |
+
// check item metadata
|
629 |
+
if ( ! empty( $settings['item_metadata'] ) ) {
|
630 |
+
$filters = self::parse_complex_pairs( $settings['item_metadata'] );
|
631 |
+
foreach ( $filters as $operator => $fields) {
|
632 |
+
foreach ( $fields as $field => $values ) {
|
633 |
+
if ( $values ) {
|
634 |
+
self::extract_item_type_and_key($field, $type, $key);
|
635 |
+
$key = esc_sql($key);
|
636 |
+
if( $operator == 'IN' OR $operator == 'NOT IN' ) {
|
637 |
+
$values = self::sql_subset( $values );
|
638 |
+
$where_item_metadata = " SELECT order_id FROM {$wpdb->prefix}woocommerce_order_items AS items
|
639 |
+
JOIN {$wpdb->prefix}woocommerce_order_itemmeta AS meta ON meta.order_item_id = items.order_item_id
|
640 |
+
WHERE order_item_type='$type' AND meta_key='$key' AND meta_value $operator ($values) ";
|
641 |
+
$order_items_where .= " AND orders.ID IN ($where_item_metadata)";
|
642 |
+
}
|
643 |
+
}//if values
|
644 |
+
}
|
645 |
+
}
|
646 |
+
}
|
647 |
+
|
648 |
|
649 |
// pre top
|
650 |
$left_join_order_meta = $order_meta_where = array();
|
672 |
$order_meta_where [] = " ( ordermeta_cf_{$pos}.meta_value IS NULL ) ";
|
673 |
} elseif( $operator == 'IS SET' ) {
|
674 |
$order_meta_where [] = " ( ordermeta_cf_{$pos}.meta_value IS NOT NULL ) ";
|
675 |
+
} elseif( in_array($operator, self::$operator_must_check_values) ) {
|
676 |
$pairs = array();
|
677 |
+
foreach($values as $v)
|
678 |
+
$pairs[] = self::operator_compare_field_and_value( "`ordermeta_cf_{$pos}`.meta_value", $operator ,$v);
|
679 |
$pairs = join("OR", $pairs);
|
680 |
$order_meta_where[] = " ( $pairs ) ";
|
681 |
}
|
828 |
// Skip drafts and deleted
|
829 |
$where[] = "orders.post_status NOT in ('auto-draft','trash')";
|
830 |
}
|
831 |
+
|
832 |
+
public static function is_datetime_timestamp($ts) {
|
833 |
+
return $ts % (24*3600) > 0;
|
834 |
+
}
|
835 |
|
836 |
public static function get_date_range( $settings, $is_for_sql, $use_timestamps=false ) {
|
837 |
$result = array();
|
839 |
// fixed date range
|
840 |
if ( !empty( $settings['from_date'] ) OR !empty( $settings['to_date'] ) ) {
|
841 |
if ( $settings['from_date'] ) {
|
842 |
+
$ts = strtotime( $settings['from_date'] );
|
843 |
+
if( self::is_datetime_timestamp($ts) )
|
844 |
+
$from_date = date( 'Y-m-d H:i:s', $ts );
|
845 |
+
else
|
846 |
+
$from_date = date( 'Y-m-d', $ts ) . " 00:00:00";
|
847 |
if ( $is_for_sql ) {
|
848 |
if( $use_timestamps )
|
849 |
$from_date = mysql2date( 'U', $from_date );
|
853 |
}
|
854 |
|
855 |
if ( $settings['to_date'] ) {
|
856 |
+
$ts = strtotime( $settings['to_date'] );
|
857 |
+
if( self::is_datetime_timestamp($ts) )
|
858 |
+
$to_date = date( 'Y-m-d H:i:s', $ts );
|
859 |
+
else
|
860 |
+
$to_date = date( 'Y-m-d', $ts ) . " 23:59:59";
|
861 |
if ( $is_for_sql ) {
|
862 |
if( $use_timestamps )
|
863 |
$to_date = mysql2date( 'U', $to_date );
|
1003 |
self::$decimals = wc_get_price_decimals();
|
1004 |
self::$export_subcategories_separator = apply_filters( 'woe_export_subcategories_separator', ">" );
|
1005 |
self::$export_line_categories_separator = apply_filters( 'woe_export_line_categories_separator', ",\n" );
|
1006 |
+
self::$export_itemmeta_values_separator = apply_filters( 'woe_export_itemmeta_values_separator', ", " );
|
1007 |
}
|
1008 |
|
1009 |
//for debug
|
1118 |
if( $export_refunds AND $item['qty'] == 0 ) // skip zero items, when export refunds
|
1119 |
continue;
|
1120 |
// we export only matched products?
|
1121 |
+
if( $export_only_products AND
|
1122 |
+
!in_array($item['product_id'], $export_only_products ) AND // not product
|
1123 |
+
( !$item['variation_id'] OR !in_array($item['variation_id'], $export_only_products ) ) // not variation
|
1124 |
+
)
|
1125 |
continue;
|
|
|
1126 |
$product = $order->get_product_from_item( $item );
|
1127 |
$product = apply_filters( "woe_get_order_product", $product );
|
1128 |
$item_meta = get_metadata( 'order_item', $item_id );
|
1178 |
} elseif ( $field == 'line_total_plus_tax' ) {
|
1179 |
$row[ $field ] = $item_meta["_line_total"][0] + $item_meta["_line_tax"][0];
|
1180 |
} elseif ( $field == 'name' ) {
|
1181 |
+
$row[ $field ] = $item["name"];
|
1182 |
+
} elseif ( $field == 'product_name' ) {
|
1183 |
+
$row[ $field ] = $product ? $product->get_name() : '';
|
1184 |
} elseif ( $field == 'product_variation' ) {
|
1185 |
+
$row[ $field ] = self::get_product_variation( $item, $order, $item_id, $product );
|
1186 |
} elseif ( $field == 'seller' ) {
|
1187 |
$row[ $field ] = '';
|
1188 |
if( $post ) {
|
1199 |
$row[ $field ] = method_exists($product,'get_type') ? $product->get_type() : $product->product_type;
|
1200 |
} elseif ( $field == 'tags' ) {
|
1201 |
$terms = get_the_terms( $product_id, 'product_tag' );
|
1202 |
+
$row[ $field ] = array();
|
1203 |
if ( $terms ) {
|
1204 |
foreach ( $terms as $term ) {
|
1205 |
+
$row[ $field ][] = $term->name;
|
1206 |
}
|
1207 |
}
|
1208 |
+
$row[ $field ] = join( ",", $row[ $field ] );
|
1209 |
} elseif ( $field == 'category' ) {
|
1210 |
$terms = get_the_terms( $product_id, 'product_cat' );
|
1211 |
+
$row[ $field ] = array();
|
1212 |
if ( $terms ) {
|
1213 |
foreach ( $terms as $term ) {
|
1214 |
+
$row[ $field ][] = $term->name;
|
1215 |
}
|
1216 |
}
|
1217 |
+
$row[ $field ] = join( ",", $row[ $field ] );// hierarhy ???
|
1218 |
} elseif ( $field == 'line_no_tax' ) {
|
1219 |
+
$row[ $field ] = $item_meta["_line_total"][0];
|
1220 |
//item refund
|
1221 |
} elseif ( $field == 'line_total_refunded' ) {
|
1222 |
+
$row[ $field ] = $order->get_total_refunded_for_item( $item_id );
|
1223 |
} elseif ( $field == 'line_total_minus_refund' ) {
|
1224 |
+
$row[ $field ] = $item_meta["_line_total"][0] - $order->get_total_refunded_for_item( $item_id );
|
1225 |
} elseif ( $field == 'qty_minus_refund' ) {
|
1226 |
+
$row[ $field ] = $item_meta["_qty"][0] + $order->get_qty_refunded_for_item( $item_id ); // Yes we add negative! qty
|
1227 |
//tax refund
|
1228 |
} elseif ( $field == 'line_tax_refunded' ) {
|
1229 |
+
$row[ $field ] = self::get_order_item_taxes_refund($order, $item_id );
|
1230 |
} elseif ( $field == 'line_tax_minus_refund' ) {
|
1231 |
+
$row[ $field ] = $item_meta["_line_tax"][0] - self::get_order_item_taxes_refund($order, $item_id );
|
1232 |
} elseif ( $field == 'line_id' ) {
|
1233 |
$row[ $field ] = $i;
|
1234 |
} elseif ( $field == 'item_id' ) {
|
1272 |
} elseif ( isset( $static_vals[ $field ] ) ) {
|
1273 |
$row[ $field ] = $static_vals[ $field ];
|
1274 |
} elseif ( isset( $item_meta[ $field ] ) ) { //meta from order
|
1275 |
+
$row[ $field ] = join( self::$export_itemmeta_values_separator, $item_meta[ $field ] );
|
1276 |
} elseif ( isset( $item_meta[ "_" . $field ] ) ) {// or hidden field
|
1277 |
+
$row[ $field ] = join( self::$export_itemmeta_values_separator, $item_meta[ "_" . $field ] );
|
1278 |
} elseif ( isset( $item['item_meta'][ $field ] ) ) { // meta from item line
|
1279 |
+
$row[ $field ] = join( self::$export_itemmeta_values_separator, $item['item_meta'][ $field ] );
|
1280 |
} elseif ( isset( $item['item_meta'][ "_" . $field ] ) ) { // or hidden field
|
1281 |
+
$row[ $field ] = join( self::$export_itemmeta_values_separator, $item['item_meta'][ "_" . $field ] );
|
1282 |
} else {
|
1283 |
$row[ $field ] = '';
|
1284 |
if( !empty( $item['variation_id'] ) )
|
1406 |
}
|
1407 |
|
1408 |
// we know parent!
|
1409 |
+
if ( $export['products'] OR isset( $labels['order']['count_unique_products'] ) OR isset( $labels['order']['total_weight_items'] ) OR $options['include_products'] ) {
|
1410 |
$temp = $labels['products'];
|
1411 |
$temp['qty'] = '';
|
1412 |
$temp['weight'] = '';
|
1413 |
$data['products'] = self::fetch_order_products( $order, $temp, $format,
|
1414 |
$filters_active['products'], $static_vals['products'], $options['include_products'],
|
1415 |
$options['export_refunds'] , $options['skip_refunded_items'], $options['strip_tags_product_fields'], $options['format_number_fields'] );
|
1416 |
+
if( $options['include_products'] AND empty($data['products']) AND apply_filters("woe_skip_order_without_products", false) )
|
1417 |
+
return array();
|
1418 |
}
|
1419 |
if ( $export['coupons'] OR isset( $labels['order']['coupons_used'] ) ) {
|
1420 |
// get coupons from main order
|
1495 |
$row[ $field ] = $user ? $user->$field : "";
|
1496 |
} elseif ( $field == 'user_role' ) {
|
1497 |
$row[ $field ] = ( isset($user->roles[0]) && isset($wp_roles->roles[$user->roles[0]]) ) ? $wp_roles->roles[$user->roles[0]]['name'] : ""; // take first role Name
|
1498 |
+
} elseif ( $field == 'customer_total_orders' ) {
|
1499 |
+
$row[ $field ] = ( isset( $user->ID ) ) ? wc_get_customer_order_count( $user->ID ) : 0;
|
1500 |
} elseif ( $field == 'billing_address' ) {
|
1501 |
$row[ $field ] = join(", ", array_filter( array( $order_meta["_billing_address_1"] , $order_meta["_billing_address_2"] ) ) );
|
1502 |
} elseif ( $field == 'shipping_address' ) {
|
1521 |
$row[ $field ] = self::get_city_state_postcode_field_value($order, 'shipping');
|
1522 |
} elseif ( $field == 'products' OR $field == 'coupons' ) {
|
1523 |
if ( $format == 'xls' OR $format == 'csv' OR $format == 'tsv' ) {
|
1524 |
+
if ( $options[ $field . '_mode' ] == 'rows' ) {
|
1525 |
//print_r(array_values($row));die();
|
1526 |
//echo count($row)."-".(count($row)+count($labels[$field])-1)."|";
|
1527 |
$items = apply_filters('woe_get_'. $field .'_items_for_' . $format.'_rows', array_values( $data[ $field ] ), $order); // remove keys for items in merge
|
1538 |
} elseif ( $field == 'shipping_method' ) {
|
1539 |
$shipping_methods = $order->get_items( 'shipping' );
|
1540 |
$shipping_method = reset($shipping_methods); // take first entry
|
1541 |
+
if ( ! empty( $shipping_method ) ) {
|
1542 |
+
$row[ $field ] = $shipping_method['method_id'] . ':' . $shipping_method['instance_id'];
|
1543 |
+
}
|
1544 |
} elseif ( $field == 'coupons_used' ) {
|
1545 |
$row[ $field ] = count( $data['coupons'] );
|
1546 |
} elseif ( $field == 'total_weight_items' ) {
|
1550 |
}
|
1551 |
} elseif ( $field == 'count_total_items' ) {
|
1552 |
$row[ $field ] = $order->get_item_count();
|
1553 |
+
} elseif ( $field == 'count_exported_items' ) {
|
1554 |
+
$row[$field] = 0; // count only exported!
|
1555 |
+
if( $export['products'] ) {
|
1556 |
+
foreach($data['products'] as $product) {
|
1557 |
+
$row[$field] += $product['qty'];
|
1558 |
+
}
|
1559 |
+
}
|
1560 |
} elseif ( $field == 'count_unique_products' ) { // speed! replace with own counter ?
|
1561 |
$row[ $field ] = count( $data['products'] );
|
1562 |
} elseif ( $field == 'customer_note' ) {
|
1634 |
} //if order field set
|
1635 |
}
|
1636 |
|
1637 |
+
$row = apply_filters("woe_fetch_order", $row, $order);
|
1638 |
+
|
1639 |
// Must fill child cells?
|
1640 |
if ( empty($options['item_rows_start_from_new_line']) AND !empty($options['populate_other_columns_product_rows']) AND $extra_rows ) {
|
1641 |
foreach ( $extra_rows as $idx=> $extra_row ) {
|
classes/core/class-wc-order-export-engine.php
CHANGED
@@ -10,6 +10,7 @@ class WC_Order_Export_Engine {
|
|
10 |
public static $date_format;
|
11 |
|
12 |
public static $order_id = '';
|
|
|
13 |
public static $make_separate_orders = false;
|
14 |
//
|
15 |
public static function export( $settings, $filepath ) {
|
@@ -35,7 +36,14 @@ class WC_Order_Export_Engine {
|
|
35 |
$filename = self::make_filename( $settings['export_filename'] );
|
36 |
$custom_export = apply_filters('woe_custom_export_to_'.$export_type,false, $filename, $filepath, $exporter);
|
37 |
if( !$custom_export ) {
|
38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
} else {
|
40 |
$results[] = $custom_export;
|
41 |
}
|
@@ -43,6 +51,39 @@ class WC_Order_Export_Engine {
|
|
43 |
return implode( "<br>\r\n", $results );
|
44 |
}
|
45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
public static function make_filename( $mask ) {
|
47 |
if ( self::$make_separate_orders && strpos( $mask, '%order_id' ) === false ) {
|
48 |
$mask_parts = explode( '.', $mask );
|
@@ -147,7 +188,9 @@ class WC_Order_Export_Engine {
|
|
147 |
|
148 |
$class = 'WOE_Formatter_' . $format;
|
149 |
|
150 |
-
|
|
|
|
|
151 |
}
|
152 |
|
153 |
private static function init_labels( $settings, &$labels, &$static_vals, &$field_formats ) {
|
@@ -213,6 +256,7 @@ class WC_Order_Export_Engine {
|
|
213 |
|
214 |
private static function _make_header( $format, $labels, $csv_max ) {
|
215 |
$header = ( $format == 'xls' OR $format == 'csv' OR $format == 'tsv' ) ? self::_make_header_csv( $labels, $csv_max ) : '';
|
|
|
216 |
|
217 |
return $header;
|
218 |
}
|
@@ -251,7 +295,9 @@ class WC_Order_Export_Engine {
|
|
251 |
$options['populate_other_columns_product_rows'] = 1;
|
252 |
}
|
253 |
$options['item_rows_start_from_new_line'] = ( $format == 'csv' AND @$settings['format_csv_item_rows_start_from_new_line'] );
|
254 |
-
|
|
|
|
|
255 |
if( !empty($settings['all_products_from_order']) )
|
256 |
$options['include_products'] = false;
|
257 |
else
|
@@ -358,7 +404,11 @@ class WC_Order_Export_Engine {
|
|
358 |
self::$current_job_settings = $settings;
|
359 |
self::$current_job_build_mode = $make_mode;
|
360 |
self::$date_format = trim( $settings['date_format'] . ' ' . $settings['time_format'] );
|
361 |
-
|
|
|
|
|
|
|
|
|
362 |
|
363 |
if ( $output_mode == 'browser' ) {
|
364 |
$filename = 'php://output';
|
@@ -376,9 +426,6 @@ class WC_Order_Export_Engine {
|
|
376 |
return $filename;
|
377 |
}
|
378 |
|
379 |
-
//debug sql!
|
380 |
-
if ( $make_mode == 'preview' AND $settings['enable_debug'] )
|
381 |
-
WC_Order_Export_Data_Extractor::start_track_queries( );
|
382 |
|
383 |
//get IDs
|
384 |
$sql = WC_Order_Export_Data_Extractor::sql_get_order_ids( $settings );
|
@@ -419,6 +466,7 @@ class WC_Order_Export_Engine {
|
|
419 |
self::maybe_start_summary_report();
|
420 |
|
421 |
WC_Order_Export_Data_Extractor::prepare_for_export();
|
|
|
422 |
foreach ( $order_ids as $order_id ) {
|
423 |
$order_id = apply_filters( "woe_order_export_started", $order_id);
|
424 |
if( !$order_id )
|
@@ -446,7 +494,8 @@ class WC_Order_Export_Engine {
|
|
446 |
$formater->finish_partial();
|
447 |
elseif ( $make_mode == 'preview') {
|
448 |
self::maybe_output_summary_report( $formater );
|
449 |
-
|
|
|
450 |
echo "<b>" . __( 'Main SQL queries are listed below', 'woo-order-export-lite' ) . "</b>";
|
451 |
echo '<textarea rows=5 style="width:100%">';
|
452 |
$s = array();
|
@@ -508,8 +557,10 @@ class WC_Order_Export_Engine {
|
|
508 |
$header = self::_make_header( $format, $labels, $csv_max );
|
509 |
|
510 |
$formater->start( $header );
|
|
|
511 |
|
512 |
WC_Order_Export_Data_Extractor::prepare_for_export();
|
|
|
513 |
foreach ( $order_ids as $order_id ) {
|
514 |
$order_id = apply_filters( "woe_order_export_started", $order_id);
|
515 |
if( !$order_id )
|
@@ -524,13 +575,19 @@ class WC_Order_Export_Engine {
|
|
524 |
do_action( "woe_order_row_exported", $row, $order_id);
|
525 |
}
|
526 |
}
|
527 |
-
|
|
|
|
|
|
|
|
|
|
|
528 |
self::try_modify_status( $order_id, $settings );
|
529 |
self::try_mark_order( $order_id, $settings );
|
530 |
}
|
531 |
|
532 |
self::maybe_output_summary_report( $formater );
|
533 |
$formater->finish();
|
|
|
534 |
|
535 |
do_action( 'woe_export_finished');
|
536 |
return $filename;
|
@@ -600,6 +657,7 @@ class WC_Order_Export_Engine {
|
|
600 |
}
|
601 |
}
|
602 |
do_action( "woe_order_exported", $order_id);
|
|
|
603 |
self::try_modify_status( $order_id, $settings );
|
604 |
self::try_mark_order( $order_id, $settings );
|
605 |
$formater->finish();
|
@@ -634,7 +692,17 @@ class WC_Order_Export_Engine {
|
|
634 |
$result = __( 'Nothing to export. Please, adjust your filters', 'woo-order-export-lite' );
|
635 |
return $result;
|
636 |
}
|
637 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
638 |
|
639 |
//SUMMARY report starts here
|
640 |
private static function check_create_session() {
|
@@ -684,10 +752,12 @@ class WC_Order_Export_Engine {
|
|
684 |
if( !isset($products[$item_id]) )
|
685 |
continue;
|
686 |
$prepared_product = $products[$item_id];
|
|
|
687 |
|
688 |
//ok can process this product
|
689 |
$product_id = !empty($item['variation_id']) ? $item['variation_id'] : $item['product_id'];
|
690 |
$key = !empty($product_id) ? $product_id : $item['name'];
|
|
|
691 |
if( !isset($_SESSION['woe_summary_products'][$key]) ) {
|
692 |
//take only exported fields to match columns
|
693 |
$summary_product = array_intersect_key( $prepared_product, $_SESSION['woe_summary_columns'] );
|
@@ -695,6 +765,7 @@ class WC_Order_Export_Engine {
|
|
695 |
$summary_rows = apply_filters("woe_summary_column_keys", array( 'qty'=>0, 'total'=>0 ) );
|
696 |
foreach($summary_rows as $k=>$default)
|
697 |
$summary_product[ $k ] = $default;
|
|
|
698 |
$_SESSION['woe_summary_products'][$key] = $summary_product;
|
699 |
}
|
700 |
//sum items
|
10 |
public static $date_format;
|
11 |
|
12 |
public static $order_id = '';
|
13 |
+
public static $orders_exported = 0;
|
14 |
public static $make_separate_orders = false;
|
15 |
//
|
16 |
public static function export( $settings, $filepath ) {
|
36 |
$filename = self::make_filename( $settings['export_filename'] );
|
37 |
$custom_export = apply_filters('woe_custom_export_to_'.$export_type,false, $filename, $filepath, $exporter);
|
38 |
if( !$custom_export ) {
|
39 |
+
// try many times?
|
40 |
+
$num_retries = 0;
|
41 |
+
while( $num_retries < $exporter->get_num_of_retries() ) {
|
42 |
+
$num_retries++;
|
43 |
+
$results[] = $exporter->run_export( $filename, $filepath );
|
44 |
+
if( $exporter->finished_successfully )
|
45 |
+
break;
|
46 |
+
}
|
47 |
} else {
|
48 |
$results[] = $custom_export;
|
49 |
}
|
51 |
return implode( "<br>\r\n", $results );
|
52 |
}
|
53 |
|
54 |
+
public static function prepare( $settings, $filepath ) {
|
55 |
+
if( empty($settings['destination']['type']) ) {
|
56 |
+
return __( "No destination selected", 'woo-order-export-lite' );
|
57 |
+
}
|
58 |
+
|
59 |
+
if( !is_array( $settings[ 'destination' ][ 'type' ] ) ) {
|
60 |
+
$settings[ 'destination' ][ 'type' ] = array( $settings[ 'destination' ][ 'type' ] );
|
61 |
+
}
|
62 |
+
$results = array( );
|
63 |
+
foreach( $settings[ 'destination' ][ 'type' ] as $export_type ) {
|
64 |
+
$export_type = strtolower( $export_type );
|
65 |
+
if ( ! in_array( strtoupper( $export_type ), WC_Order_Export_Admin::$export_types ) ) {
|
66 |
+
return __( "Wrong export type", 'woo-order-export-lite' );
|
67 |
+
}
|
68 |
+
|
69 |
+
include_once dirname( dirname( __FILE__ ) ) . "/exports/abstract-class-woe-export.php";
|
70 |
+
include_once dirname( dirname( __FILE__ ) ) . "/exports/class-woe-export-{$export_type}.php";
|
71 |
+
$class = 'WOE_Export_' . $export_type;
|
72 |
+
$exporter = new $class( $settings['destination'] );
|
73 |
+
|
74 |
+
$filename = self::make_filename( $settings['export_filename'] );
|
75 |
+
$custom_prepare = apply_filters('woe_custom_prepare_to_'.$export_type,false, $filename, $filepath, $exporter);
|
76 |
+
if( !$custom_prepare ) {
|
77 |
+
if ( method_exists($exporter, 'prepare') ) {
|
78 |
+
$results[] = $exporter->prepare( $filename, $filepath );
|
79 |
+
}
|
80 |
+
} else {
|
81 |
+
$results[] = $custom_prepare;
|
82 |
+
}
|
83 |
+
}
|
84 |
+
return $results;
|
85 |
+
}
|
86 |
+
|
87 |
public static function make_filename( $mask ) {
|
88 |
if ( self::$make_separate_orders && strpos( $mask, '%order_id' ) === false ) {
|
89 |
$mask_parts = explode( '.', $mask );
|
188 |
|
189 |
$class = 'WOE_Formatter_' . $format;
|
190 |
|
191 |
+
do_action( 'woe_init_custom_formatter', $mode, $fname, $format_settings, $format, $labels, $field_formats, self::$date_format, $settings );
|
192 |
+
|
193 |
+
return new $class( $mode, $fname, $format_settings, $format, $labels, $field_formats, self::$date_format );
|
194 |
}
|
195 |
|
196 |
private static function init_labels( $settings, &$labels, &$static_vals, &$field_formats ) {
|
256 |
|
257 |
private static function _make_header( $format, $labels, $csv_max ) {
|
258 |
$header = ( $format == 'xls' OR $format == 'csv' OR $format == 'tsv' ) ? self::_make_header_csv( $labels, $csv_max ) : '';
|
259 |
+
do_action( 'woe_make_header_custom_formatter', $format, $labels, $csv_max );
|
260 |
|
261 |
return $header;
|
262 |
}
|
295 |
$options['populate_other_columns_product_rows'] = 1;
|
296 |
}
|
297 |
$options['item_rows_start_from_new_line'] = ( $format == 'csv' AND @$settings['format_csv_item_rows_start_from_new_line'] );
|
298 |
+
$options['products_mode'] = isset($settings['order_fields']['products']['repeat']) ? $settings['order_fields']['products']['repeat'] : "";
|
299 |
+
$options['coupons_mode'] = isset($settings['order_fields']['coupons']['repeat']) ? $settings['order_fields']['coupons']['repeat'] : "";
|
300 |
+
|
301 |
if( !empty($settings['all_products_from_order']) )
|
302 |
$options['include_products'] = false;
|
303 |
else
|
404 |
self::$current_job_settings = $settings;
|
405 |
self::$current_job_build_mode = $make_mode;
|
406 |
self::$date_format = trim( $settings['date_format'] . ' ' . $settings['time_format'] );
|
407 |
+
//debug sql?
|
408 |
+
if ( $make_mode == 'preview' AND $settings['enable_debug'] )
|
409 |
+
WC_Order_Export_Data_Extractor::start_track_queries( );
|
410 |
+
// might run sql!
|
411 |
+
self::$extractor_options = self::_install_options( $settings );
|
412 |
|
413 |
if ( $output_mode == 'browser' ) {
|
414 |
$filename = 'php://output';
|
426 |
return $filename;
|
427 |
}
|
428 |
|
|
|
|
|
|
|
429 |
|
430 |
//get IDs
|
431 |
$sql = WC_Order_Export_Data_Extractor::sql_get_order_ids( $settings );
|
466 |
self::maybe_start_summary_report();
|
467 |
|
468 |
WC_Order_Export_Data_Extractor::prepare_for_export();
|
469 |
+
self::$orders_exported = 0;// incorrect value
|
470 |
foreach ( $order_ids as $order_id ) {
|
471 |
$order_id = apply_filters( "woe_order_export_started", $order_id);
|
472 |
if( !$order_id )
|
494 |
$formater->finish_partial();
|
495 |
elseif ( $make_mode == 'preview') {
|
496 |
self::maybe_output_summary_report( $formater );
|
497 |
+
$flat_formats = array( 'XLS', 'CSV', 'TSV' );//limit debug output
|
498 |
+
if( $settings['enable_debug'] AND in_array( $settings['format'], $flat_formats ) ) {
|
499 |
echo "<b>" . __( 'Main SQL queries are listed below', 'woo-order-export-lite' ) . "</b>";
|
500 |
echo '<textarea rows=5 style="width:100%">';
|
501 |
$s = array();
|
557 |
$header = self::_make_header( $format, $labels, $csv_max );
|
558 |
|
559 |
$formater->start( $header );
|
560 |
+
do_action( 'woe_start_custom_formatter', $header );
|
561 |
|
562 |
WC_Order_Export_Data_Extractor::prepare_for_export();
|
563 |
+
self::$orders_exported = 0;
|
564 |
foreach ( $order_ids as $order_id ) {
|
565 |
$order_id = apply_filters( "woe_order_export_started", $order_id);
|
566 |
if( !$order_id )
|
575 |
do_action( "woe_order_row_exported", $row, $order_id);
|
576 |
}
|
577 |
}
|
578 |
+
do_action( "woe_order_exported", $order_id);
|
579 |
+
|
580 |
+
do_action( 'woe_formatter_output_custom_formatter', $order_id, $labels, $format, $filters_active,
|
581 |
+
$csv_max, $export, $get_coupon_meta, $static_vals, self::$extractor_options );
|
582 |
+
|
583 |
+
self::$orders_exported++;
|
584 |
self::try_modify_status( $order_id, $settings );
|
585 |
self::try_mark_order( $order_id, $settings );
|
586 |
}
|
587 |
|
588 |
self::maybe_output_summary_report( $formater );
|
589 |
$formater->finish();
|
590 |
+
do_action( 'woe_finish_custom_formatter' );
|
591 |
|
592 |
do_action( 'woe_export_finished');
|
593 |
return $filename;
|
657 |
}
|
658 |
}
|
659 |
do_action( "woe_order_exported", $order_id);
|
660 |
+
self::$orders_exported = 1;
|
661 |
self::try_modify_status( $order_id, $settings );
|
662 |
self::try_mark_order( $order_id, $settings );
|
663 |
$formater->finish();
|
692 |
$result = __( 'Nothing to export. Please, adjust your filters', 'woo-order-export-lite' );
|
693 |
return $result;
|
694 |
}
|
695 |
+
|
696 |
+
public static function build_files_and_prepare( $settings, $filename = '', $limit = 0, $order_ids = array( ) ) {
|
697 |
+
$file = self::build_file_full( $settings, $filename, $limit, $order_ids );
|
698 |
+
if ( $file !== false ) {
|
699 |
+
$result = self::prepare( $settings, $file );
|
700 |
+
return $result;
|
701 |
+
} else {
|
702 |
+
return __( 'Nothing to export. Please, adjust your filters', 'woo-order-export-lite' );
|
703 |
+
}
|
704 |
+
}
|
705 |
+
|
706 |
|
707 |
//SUMMARY report starts here
|
708 |
private static function check_create_session() {
|
752 |
if( !isset($products[$item_id]) )
|
753 |
continue;
|
754 |
$prepared_product = $products[$item_id];
|
755 |
+
$product = $order->get_product_from_item( $item );
|
756 |
|
757 |
//ok can process this product
|
758 |
$product_id = !empty($item['variation_id']) ? $item['variation_id'] : $item['product_id'];
|
759 |
$key = !empty($product_id) ? $product_id : $item['name'];
|
760 |
+
$key = apply_filters( "woe_summary_products_adjust_key", $key, $product, $item, $order );
|
761 |
if( !isset($_SESSION['woe_summary_products'][$key]) ) {
|
762 |
//take only exported fields to match columns
|
763 |
$summary_product = array_intersect_key( $prepared_product, $_SESSION['woe_summary_columns'] );
|
765 |
$summary_rows = apply_filters("woe_summary_column_keys", array( 'qty'=>0, 'total'=>0 ) );
|
766 |
foreach($summary_rows as $k=>$default)
|
767 |
$summary_product[ $k ] = $default;
|
768 |
+
$summary_product = apply_filters( "woe_summary_products_prepare_product", $summary_product, $key, $product, $item, $order );
|
769 |
$_SESSION['woe_summary_products'][$key] = $summary_product;
|
770 |
}
|
771 |
//sum items
|
classes/formats/abstract-class-woe-formatter-sv.php
CHANGED
@@ -43,7 +43,7 @@ abstract class WOE_Formatter_sv extends WOE_Formatter {
|
|
43 |
$this->rows[] = $data;
|
44 |
} else {
|
45 |
do_action( "woe_before_{$this->format}_print_header", $this->handle, $data, $this);
|
46 |
-
if( !apply_filters("woe_{$this->format}_custom_output_func",false, $this->handle, $data, $this->delimiter, $this->linebreak, $this->enclosure ) ) {
|
47 |
if ( $this->enclosure !== '' ) {
|
48 |
fputcsv( $this->handle, $data, $this->delimiter, $this->enclosure );
|
49 |
} else {
|
@@ -68,7 +68,7 @@ abstract class WOE_Formatter_sv extends WOE_Formatter {
|
|
68 |
if ( $this->mode == 'preview' ) {
|
69 |
$this->rows[] = $rec;
|
70 |
} else {
|
71 |
-
if( ! apply_filters("woe_{$this->format}_custom_output_func",false, $this->handle, $rec, $this->delimiter, $this->linebreak, $this->enclosure ) ) {
|
72 |
if ( $this->enclosure !== '' ) {
|
73 |
fputcsv( $this->handle, $rec, $this->delimiter, $this->enclosure );
|
74 |
} else {
|
@@ -99,15 +99,22 @@ abstract class WOE_Formatter_sv extends WOE_Formatter {
|
|
99 |
}
|
100 |
|
101 |
protected function prepare_array( &$arr ) {
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
if ( ! in_array( $this->encoding, array( '', 'utf-8', 'UTF-8' ) ) ) {
|
107 |
$arr = array_map( array( $this, 'encode_value' ), $arr );
|
108 |
}
|
109 |
}
|
110 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
protected function encode_value( $value ) {
|
112 |
return iconv( 'UTF-8', $this->encoding, $value );
|
113 |
}
|
43 |
$this->rows[] = $data;
|
44 |
} else {
|
45 |
do_action( "woe_before_{$this->format}_print_header", $this->handle, $data, $this);
|
46 |
+
if( !apply_filters("woe_{$this->format}_custom_output_func",false, $this->handle, $data, $this->delimiter, $this->linebreak, $this->enclosure, true ) ) {
|
47 |
if ( $this->enclosure !== '' ) {
|
48 |
fputcsv( $this->handle, $data, $this->delimiter, $this->enclosure );
|
49 |
} else {
|
68 |
if ( $this->mode == 'preview' ) {
|
69 |
$this->rows[] = $rec;
|
70 |
} else {
|
71 |
+
if( ! apply_filters("woe_{$this->format}_custom_output_func",false, $this->handle, $rec, $this->delimiter, $this->linebreak, $this->enclosure, false ) ) {
|
72 |
if ( $this->enclosure !== '' ) {
|
73 |
fputcsv( $this->handle, $rec, $this->delimiter, $this->enclosure );
|
74 |
} else {
|
99 |
}
|
100 |
|
101 |
protected function prepare_array( &$arr ) {
|
102 |
+
if( apply_filters("woe_stop_csv_injection", true) ) {
|
103 |
+
$arr = array_map( array( $this, 'stop_csv_injection' ), $arr );
|
104 |
+
}
|
105 |
+
|
106 |
if ( ! in_array( $this->encoding, array( '', 'utf-8', 'UTF-8' ) ) ) {
|
107 |
$arr = array_map( array( $this, 'encode_value' ), $arr );
|
108 |
}
|
109 |
}
|
110 |
|
111 |
+
protected function stop_csv_injection( $value ) {
|
112 |
+
$formula_chars = array( "=","+","-","@" );
|
113 |
+
if ( in_array( substr($value,0,1), $formula_chars) )
|
114 |
+
$value = " " . $value;
|
115 |
+
return $value;
|
116 |
+
}
|
117 |
+
|
118 |
protected function encode_value( $value ) {
|
119 |
return iconv( 'UTF-8', $this->encoding, $value );
|
120 |
}
|
classes/formats/class-woe-formatter-xls.php
CHANGED
@@ -142,7 +142,6 @@ class WOE_Formatter_Xls extends WOE_Formatter {
|
|
142 |
}
|
143 |
fwrite( $this->handle, '</table>' );
|
144 |
} else {
|
145 |
-
do_action ( 'woe_xls_print_footer', $this->objPHPExcel, $this );
|
146 |
if ( $this->settings['auto_width'] ) {
|
147 |
try {
|
148 |
$sheet = $this->objPHPExcel->getActiveSheet();
|
@@ -156,7 +155,7 @@ class WOE_Formatter_Xls extends WOE_Formatter {
|
|
156 |
//do nothing here , adjustment failed gracefully
|
157 |
}
|
158 |
}
|
159 |
-
|
160 |
$objWriter = PHPExcel_IOFactory::createWriter($this->objPHPExcel, $this->settings['use_xls_format'] ? 'Excel5' : 'Excel2007');
|
161 |
$objWriter->save( $this->filename );
|
162 |
}
|
142 |
}
|
143 |
fwrite( $this->handle, '</table>' );
|
144 |
} else {
|
|
|
145 |
if ( $this->settings['auto_width'] ) {
|
146 |
try {
|
147 |
$sheet = $this->objPHPExcel->getActiveSheet();
|
155 |
//do nothing here , adjustment failed gracefully
|
156 |
}
|
157 |
}
|
158 |
+
do_action ( 'woe_xls_print_footer', $this->objPHPExcel, $this );
|
159 |
$objWriter = PHPExcel_IOFactory::createWriter($this->objPHPExcel, $this->settings['use_xls_format'] ? 'Excel5' : 'Excel2007');
|
160 |
$objWriter->save( $this->filename );
|
161 |
}
|
i18n/languages/woo-order-export-lite.pot
CHANGED
@@ -3,7 +3,7 @@ msgid ""
|
|
3 |
msgstr ""
|
4 |
"Project-Id-Version: PACKAGE VERSION\n"
|
5 |
"Report-Msgid-Bugs-To: \n"
|
6 |
-
"POT-Creation-Date: 2018-
|
7 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
8 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
9 |
"Language-Team: \n"
|
@@ -20,441 +20,453 @@ msgid ""
|
|
20 |
"Order Export For WooCommerce!"
|
21 |
msgstr ""
|
22 |
|
23 |
-
#: view/settings-form.php:
|
24 |
msgid "Filter orders by"
|
25 |
msgstr ""
|
26 |
|
27 |
-
#: view/settings-form.php:
|
28 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
29 |
msgid "Order Date"
|
30 |
msgstr ""
|
31 |
|
32 |
-
#: view/settings-form.php:
|
33 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
34 |
msgid "Modification Date"
|
35 |
msgstr ""
|
36 |
|
37 |
-
#: view/settings-form.php:
|
38 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
39 |
msgid "Paid Date"
|
40 |
msgstr ""
|
41 |
|
42 |
-
#: view/settings-form.php:
|
43 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
44 |
msgid "Completed Date"
|
45 |
msgstr ""
|
46 |
|
47 |
-
#: view/settings-form.php:
|
48 |
msgid "This date range should not be saved in the scheduled task"
|
49 |
msgstr ""
|
50 |
|
51 |
-
#: view/settings-form.php:
|
52 |
msgid "Date range"
|
53 |
msgstr ""
|
54 |
|
55 |
-
#: view/settings-form.php:
|
56 |
msgid "to"
|
57 |
msgstr ""
|
58 |
|
59 |
-
#: view/settings-form.php:
|
60 |
msgid "Express export"
|
61 |
msgstr ""
|
62 |
|
63 |
-
#: view/settings-form.php:
|
64 |
msgid "Summary Report By Products"
|
65 |
msgstr ""
|
66 |
|
67 |
-
#: view/settings-form.php:
|
68 |
msgid "Set up fields"
|
69 |
msgstr ""
|
70 |
|
71 |
-
#: view/settings-form.php:
|
72 |
msgid "Export filename"
|
73 |
msgstr ""
|
74 |
|
75 |
-
#: view/settings-form.php:
|
76 |
msgid "Format"
|
77 |
msgstr ""
|
78 |
|
79 |
-
#: view/settings-form.php:
|
80 |
msgid "XLS options"
|
81 |
msgstr ""
|
82 |
|
83 |
-
#: view/settings-form.php:
|
84 |
msgid "Export as .xls (Binary File Format)"
|
85 |
msgstr ""
|
86 |
|
87 |
-
#: view/settings-form.php:
|
88 |
msgid "Use sheet name"
|
89 |
msgstr ""
|
90 |
|
91 |
-
#: view/settings-form.php:
|
92 |
-
#: view/settings-form.php:
|
93 |
msgid "Output column titles as first line"
|
94 |
msgstr ""
|
95 |
|
96 |
-
#: view/settings-form.php:
|
97 |
msgid "Auto column width"
|
98 |
msgstr ""
|
99 |
|
100 |
-
#: view/settings-form.php:
|
101 |
-
#: view/settings-form.php:
|
102 |
msgid "Populate other columns if products exported as rows"
|
103 |
msgstr ""
|
104 |
|
105 |
-
#: view/settings-form.php:
|
106 |
msgid "Right-to-Left direction"
|
107 |
msgstr ""
|
108 |
|
109 |
-
#: view/settings-form.php:
|
110 |
msgid "CSV options"
|
111 |
msgstr ""
|
112 |
|
113 |
-
#: view/settings-form.php:
|
114 |
msgid "Output UTF-8 BOM"
|
115 |
msgstr ""
|
116 |
|
117 |
-
#: view/settings-form.php:
|
118 |
msgid "Convert line breaks to literals"
|
119 |
msgstr ""
|
120 |
|
121 |
-
#: view/settings-form.php:
|
122 |
msgid "Item rows start from new line"
|
123 |
msgstr ""
|
124 |
|
125 |
-
#: view/settings-form.php:
|
126 |
msgid "Enclosure"
|
127 |
msgstr ""
|
128 |
|
129 |
-
#: view/settings-form.php:
|
130 |
msgid "Field Delimiter"
|
131 |
msgstr ""
|
132 |
|
133 |
-
#: view/settings-form.php:
|
134 |
msgid "Line Break"
|
135 |
msgstr ""
|
136 |
|
137 |
-
#: view/settings-form.php:
|
138 |
msgid "Character encoding"
|
139 |
msgstr ""
|
140 |
|
141 |
-
#: view/settings-form.php:
|
142 |
msgid "XML options"
|
143 |
msgstr ""
|
144 |
|
145 |
-
#: view/settings-form.php:
|
146 |
msgid "Prepend XML"
|
147 |
msgstr ""
|
148 |
|
149 |
-
#: view/settings-form.php:
|
150 |
msgid "Root tag"
|
151 |
msgstr ""
|
152 |
|
153 |
-
#: view/settings-form.php:
|
154 |
msgid "Order tag"
|
155 |
msgstr ""
|
156 |
|
157 |
-
#: view/settings-form.php:
|
158 |
msgid "Product tag"
|
159 |
msgstr ""
|
160 |
|
161 |
-
#: view/settings-form.php:
|
162 |
msgid "Coupon tag"
|
163 |
msgstr ""
|
164 |
|
165 |
-
#: view/settings-form.php:
|
166 |
msgid "Append XML"
|
167 |
msgstr ""
|
168 |
|
169 |
-
#: view/settings-form.php:
|
170 |
msgid "Self closing tags"
|
171 |
msgstr ""
|
172 |
|
173 |
-
#: view/settings-form.php:
|
174 |
msgid "JSON options"
|
175 |
msgstr ""
|
176 |
|
177 |
-
#: view/settings-form.php:
|
178 |
msgid "Start tag"
|
179 |
msgstr ""
|
180 |
|
181 |
-
#: view/settings-form.php:
|
182 |
msgid "End tag"
|
183 |
msgstr ""
|
184 |
|
185 |
-
#: view/settings-form.php:
|
186 |
msgid "TSV options"
|
187 |
msgstr ""
|
188 |
|
189 |
-
#: view/settings-form.php:
|
190 |
msgid "Date"
|
191 |
msgstr ""
|
192 |
|
193 |
-
#: view/settings-form.php:
|
194 |
msgid "-"
|
195 |
msgstr ""
|
196 |
|
197 |
-
#: view/settings-form.php:
|
198 |
msgid "custom"
|
199 |
msgstr ""
|
200 |
|
201 |
-
#: view/settings-form.php:
|
202 |
msgid "Time"
|
203 |
msgstr ""
|
204 |
|
205 |
-
#: view/settings-form.php:
|
206 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
207 |
msgid "Order ID"
|
208 |
msgstr ""
|
209 |
|
210 |
-
#: view/settings-form.php:
|
211 |
msgid "Descending"
|
212 |
msgstr ""
|
213 |
|
214 |
-
#: view/settings-form.php:
|
215 |
msgid "Ascending"
|
216 |
msgstr ""
|
217 |
|
218 |
-
#: view/settings-form.php:
|
219 |
#, php-format
|
220 |
msgid "Sort orders by %s in %s order"
|
221 |
msgstr ""
|
222 |
|
223 |
-
#: view/settings-form.php:
|
224 |
msgid "Change order status to"
|
225 |
msgstr ""
|
226 |
|
227 |
-
#: view/settings-form.php:
|
228 |
msgid "- don't modify -"
|
229 |
msgstr ""
|
230 |
|
231 |
-
#: view/settings-form.php:
|
232 |
msgid "Misc settings"
|
233 |
msgstr ""
|
234 |
|
235 |
-
#: view/settings-form.php:
|
236 |
msgid "Format numbers (use WC decimal separator)"
|
237 |
msgstr ""
|
238 |
|
239 |
-
#: view/settings-form.php:
|
240 |
msgid "Export all order notes"
|
241 |
msgstr ""
|
242 |
|
243 |
-
#: view/settings-form.php:
|
244 |
msgid "Export refund notes as Customer Note"
|
245 |
msgstr ""
|
246 |
|
247 |
-
#: view/settings-form.php:
|
248 |
msgid "Strip tags from Product Description/Variation"
|
249 |
msgstr ""
|
250 |
|
251 |
-
#: view/settings-form.php:
|
252 |
msgid "Cleanup phone (export only digits)"
|
253 |
msgstr ""
|
254 |
|
255 |
-
#: view/settings-form.php:
|
256 |
msgid "Enable debug output"
|
257 |
msgstr ""
|
258 |
|
259 |
-
#: view/settings-form.php:
|
260 |
msgid "Custom PHP code to modify output"
|
261 |
msgstr ""
|
262 |
|
263 |
-
#: view/settings-form.php:
|
264 |
msgid "Use only unnamed functions!"
|
265 |
msgstr ""
|
266 |
|
267 |
-
#: view/settings-form.php:
|
268 |
msgid "Filter by order"
|
269 |
msgstr ""
|
270 |
|
271 |
-
#: view/settings-form.php:
|
272 |
msgid "Don't export child orders"
|
273 |
msgstr ""
|
274 |
|
275 |
-
#: view/settings-form.php:
|
276 |
msgid "Export refunds"
|
277 |
msgstr ""
|
278 |
|
279 |
-
#: view/settings-form.php:
|
280 |
msgid "Mark exported orders"
|
281 |
msgstr ""
|
282 |
|
283 |
-
#: view/settings-form.php:
|
284 |
msgid "Export unmarked orders only"
|
285 |
msgstr ""
|
286 |
|
287 |
-
#: view/settings-form.php:
|
288 |
msgid "Order statuses"
|
289 |
msgstr ""
|
290 |
|
291 |
-
#: view/settings-form.php:
|
292 |
msgid "Custom fields"
|
293 |
msgstr ""
|
294 |
|
295 |
-
#: view/settings-form.php:
|
296 |
msgid ""
|
297 |
"The filters won't work correctly.<br>Another plugin(or theme) has loaded "
|
298 |
"outdated Select2.js"
|
299 |
msgstr ""
|
300 |
|
301 |
-
#: view/settings-form.php:
|
302 |
msgid "Filter by product"
|
303 |
msgstr ""
|
304 |
|
305 |
-
#: view/settings-form.php:
|
306 |
msgid "Export all products from a order"
|
307 |
msgstr ""
|
308 |
|
309 |
-
#: view/settings-form.php:
|
310 |
msgid "Skip fully refunded items"
|
311 |
msgstr ""
|
312 |
|
313 |
-
#: view/settings-form.php:
|
314 |
msgid "Product categories"
|
315 |
msgstr ""
|
316 |
|
317 |
-
#: view/settings-form.php:
|
318 |
msgid "Vendor/creator"
|
319 |
msgstr ""
|
320 |
|
321 |
-
#: view/settings-form.php:
|
322 |
msgid "Product"
|
323 |
msgstr ""
|
324 |
|
325 |
-
#: view/settings-form.php:
|
326 |
msgid "Product taxonomies"
|
327 |
msgstr ""
|
328 |
|
329 |
-
#: view/settings-form.php:
|
330 |
msgid "Product custom fields"
|
331 |
msgstr ""
|
332 |
|
333 |
-
#: view/settings-form.php:
|
334 |
msgid "Variable product attributes"
|
335 |
msgstr ""
|
336 |
|
337 |
-
#: view/settings-form.php:
|
338 |
msgid "Item meta data"
|
339 |
msgstr ""
|
340 |
|
341 |
-
#: view/settings-form.php:
|
342 |
msgid "Filter by customers"
|
343 |
msgstr ""
|
344 |
|
345 |
-
#: view/settings-form.php:
|
346 |
msgid "User roles"
|
347 |
msgstr ""
|
348 |
|
349 |
-
#: view/settings-form.php:
|
350 |
msgid "Usernames"
|
351 |
msgstr ""
|
352 |
|
353 |
-
#: view/settings-form.php:
|
354 |
msgid "Filter by coupons"
|
355 |
msgstr ""
|
356 |
|
357 |
-
#: view/settings-form.php:
|
358 |
msgid "Any coupon used"
|
359 |
msgstr ""
|
360 |
|
361 |
-
#: view/settings-form.php:
|
362 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
363 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
364 |
msgid "Coupons"
|
365 |
msgstr ""
|
366 |
|
367 |
-
#: view/settings-form.php:
|
368 |
msgid "Filter by billing"
|
369 |
msgstr ""
|
370 |
|
371 |
-
#: view/settings-form.php:
|
372 |
msgid "Billing locations"
|
373 |
msgstr ""
|
374 |
|
375 |
-
#: view/settings-form.php:
|
376 |
msgid "Payment methods"
|
377 |
msgstr ""
|
378 |
|
379 |
-
#: view/settings-form.php:
|
380 |
msgid "Filter by shipping"
|
381 |
msgstr ""
|
382 |
|
383 |
-
#: view/settings-form.php:
|
384 |
msgid "Shipping locations"
|
385 |
msgstr ""
|
386 |
|
387 |
-
#: view/settings-form.php:
|
388 |
msgid "Shipping methods"
|
389 |
msgstr ""
|
390 |
|
391 |
-
#: view/settings-form.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
392 |
msgid "Set up fields to export"
|
393 |
msgstr ""
|
394 |
|
395 |
-
#: view/settings-form.php:
|
396 |
msgid "Meta key"
|
397 |
msgstr ""
|
398 |
|
399 |
-
#: view/settings-form.php:
|
400 |
#: view/modal-controls.php:20 view/modal-controls.php:26
|
401 |
#: view/modal-controls.php:43 view/modal-controls.php:49
|
402 |
msgid "Column name"
|
403 |
msgstr ""
|
404 |
|
405 |
-
#: view/settings-form.php:
|
406 |
msgid "or type meta key here"
|
407 |
msgstr ""
|
408 |
|
409 |
-
#: view/settings-form.php:
|
410 |
#: view/modal-controls.php:4 view/modal-controls.php:39
|
411 |
msgid "Hide unused fields"
|
412 |
msgstr ""
|
413 |
|
414 |
-
#: view/settings-form.php:
|
415 |
msgid "Confirm"
|
416 |
msgstr ""
|
417 |
|
418 |
-
#: view/settings-form.php:
|
419 |
msgid "Cancel"
|
420 |
msgstr ""
|
421 |
|
422 |
-
#: view/settings-form.php:
|
423 |
#: view/modal-controls.php:50
|
424 |
msgid "Value"
|
425 |
msgstr ""
|
426 |
|
427 |
-
#: view/settings-form.php:
|
428 |
msgid "Use sections"
|
429 |
msgstr ""
|
430 |
|
431 |
-
#: view/settings-form.php:
|
432 |
msgid "Actions"
|
433 |
msgstr ""
|
434 |
|
435 |
-
#: view/settings-form.php:
|
436 |
#: view/modal-controls.php:45
|
437 |
msgid "Add field"
|
438 |
msgstr ""
|
439 |
|
440 |
-
#: view/settings-form.php:
|
441 |
#: view/modal-controls.php:52
|
442 |
msgid "Add static field"
|
443 |
msgstr ""
|
444 |
|
445 |
-
#: view/settings-form.php:
|
446 |
msgid "Show unused fields"
|
447 |
msgstr ""
|
448 |
|
449 |
-
#: view/settings-form.php:
|
450 |
msgid "Select all"
|
451 |
msgstr ""
|
452 |
|
453 |
-
#: view/settings-form.php:
|
454 |
msgid "Drag rows to reorder exported fields"
|
455 |
msgstr ""
|
456 |
|
457 |
-
#: view/settings-form.php:
|
458 |
#, php-format
|
459 |
msgid ""
|
460 |
"If you see this message after page load, user interface won't work correctly!"
|
@@ -462,56 +474,51 @@ msgid ""
|
|
462 |
"it). Probably, it's a conflict with another plugin or active theme."
|
463 |
msgstr ""
|
464 |
|
465 |
-
#: view/settings-form.php:
|
466 |
msgid "Preview"
|
467 |
msgstr ""
|
468 |
|
469 |
-
#: view/settings-form.php:
|
470 |
msgid "Might be different from actual export!"
|
471 |
msgstr ""
|
472 |
|
473 |
-
#: view/settings-form.php:
|
474 |
msgid "Save settings"
|
475 |
msgstr ""
|
476 |
|
477 |
-
#: view/settings-form.php:
|
478 |
msgid "Export"
|
479 |
msgstr ""
|
480 |
|
481 |
-
#: view/settings-form.php:
|
482 |
msgid "Export [w/o progressbar]"
|
483 |
msgstr ""
|
484 |
|
485 |
-
#: view/settings-form.php:
|
486 |
msgid "It might not work for huge datasets!"
|
487 |
msgstr ""
|
488 |
|
489 |
-
#: view/settings-form.php:
|
490 |
msgid "Save as a profile"
|
491 |
msgstr ""
|
492 |
|
493 |
-
#: view/settings-form.php:
|
494 |
#, php-format
|
495 |
msgid "Export total: %s orders"
|
496 |
msgstr ""
|
497 |
|
498 |
-
#: view/settings-form.php:
|
499 |
msgid "Preview size"
|
500 |
msgstr ""
|
501 |
|
502 |
-
#: view/settings-form.php:
|
503 |
msgid "Press 'Esc' to cancel the export"
|
504 |
msgstr ""
|
505 |
|
506 |
-
#: view/settings-form.php:
|
507 |
msgid "Click here to download"
|
508 |
msgstr ""
|
509 |
|
510 |
-
#: view/settings-form.php:954
|
511 |
-
#, php-format
|
512 |
-
msgid "Add %s as %s columns %s as rows"
|
513 |
-
msgstr ""
|
514 |
-
|
515 |
#: view/main.php:8
|
516 |
msgid "Settings saved"
|
517 |
msgstr ""
|
@@ -560,108 +567,114 @@ msgstr ""
|
|
560 |
msgid "All meta"
|
561 |
msgstr ""
|
562 |
|
563 |
-
#: classes/class-wc-order-export-admin.php:
|
564 |
msgid "Export Status"
|
565 |
msgstr ""
|
566 |
|
567 |
-
#: classes/class-wc-order-export-admin.php:
|
568 |
msgid ""
|
569 |
"Advanced Order Export For WooCommerce is available <a href=\"admin.php?"
|
570 |
"page=wc-order-export\">on this page</a>."
|
571 |
msgstr ""
|
572 |
|
573 |
-
#: classes/class-wc-order-export-admin.php:
|
574 |
msgid "Settings"
|
575 |
msgstr ""
|
576 |
|
577 |
-
#: classes/class-wc-order-export-admin.php:
|
578 |
msgid "Docs"
|
579 |
msgstr ""
|
580 |
|
581 |
-
#: classes/class-wc-order-export-admin.php:
|
582 |
msgid "Support"
|
583 |
msgstr ""
|
584 |
|
585 |
-
#: classes/class-wc-order-export-admin.php:
|
586 |
-
#: classes/class-wc-order-export-admin.php:
|
587 |
-
#: classes/class-wc-order-export-admin.php:
|
588 |
msgid "Export Orders"
|
589 |
msgstr ""
|
590 |
|
591 |
-
#: classes/class-wc-order-export-admin.php:
|
592 |
msgid "Copied from \"Export now\""
|
593 |
msgstr ""
|
594 |
|
595 |
-
#: classes/class-wc-order-export-admin.php:
|
|
|
|
|
|
|
|
|
|
|
596 |
msgid "empty column name"
|
597 |
msgstr ""
|
598 |
|
599 |
-
#: classes/class-wc-order-export-admin.php:
|
600 |
msgid "empty meta key"
|
601 |
msgstr ""
|
602 |
|
603 |
-
#: classes/class-wc-order-export-admin.php:
|
604 |
msgid "select product field or item field or taxonomy"
|
605 |
msgstr ""
|
606 |
|
607 |
-
#: classes/class-wc-order-export-admin.php:
|
608 |
msgid "empty value"
|
609 |
msgstr ""
|
610 |
|
611 |
-
#: classes/class-wc-order-export-admin.php:
|
612 |
msgid "title is empty"
|
613 |
msgstr ""
|
614 |
|
615 |
-
#: classes/class-wc-order-export-admin.php:
|
616 |
msgid "Date From is greater than Date To"
|
617 |
msgstr ""
|
618 |
|
619 |
-
#: classes/class-wc-order-export-admin.php:
|
620 |
msgid "Please, set up fields to export"
|
621 |
msgstr ""
|
622 |
|
623 |
-
#: classes/class-wc-order-export-admin.php:
|
624 |
-
#: classes/admin/class-wc-order-export-ajax.php:
|
625 |
-
#: classes/core/class-wc-order-export-engine.php:
|
|
|
626 |
msgid "Nothing to export. Please, adjust your filters"
|
627 |
msgstr ""
|
628 |
|
629 |
-
#: classes/class-wc-order-export-admin.php:
|
630 |
-
#: classes/core/class-wc-order-export-data-extractor.php:
|
631 |
msgid "empty"
|
632 |
msgstr ""
|
633 |
|
634 |
-
#: classes/class-wc-order-export-admin.php:
|
635 |
#, php-format
|
636 |
msgid "Status change job #%s for order #%s. Result: %s"
|
637 |
msgstr ""
|
638 |
|
639 |
-
#: classes/class-wc-order-export-admin.php:
|
640 |
#, php-format
|
641 |
msgid "Export as %s"
|
642 |
msgstr ""
|
643 |
|
644 |
-
#: classes/class-wc-order-export-admin.php:
|
645 |
msgid "Mark exported"
|
646 |
msgstr ""
|
647 |
|
648 |
-
#: classes/class-wc-order-export-admin.php:
|
649 |
msgid "Unmark exported"
|
650 |
msgstr ""
|
651 |
|
652 |
-
#: classes/class-wc-order-export-admin.php:
|
653 |
#, php-format
|
654 |
msgid "Export as profile '%s'"
|
655 |
msgstr ""
|
656 |
|
657 |
-
#: classes/class-wc-order-export-admin.php:
|
658 |
#, php-format
|
659 |
msgid "%s order marked."
|
660 |
msgid_plural "%s orders marked."
|
661 |
msgstr[0] ""
|
662 |
msgstr[1] ""
|
663 |
|
664 |
-
#: classes/class-wc-order-export-admin.php:
|
665 |
#, php-format
|
666 |
msgid "%s order unmarked."
|
667 |
msgid_plural "%s orders unmarked."
|
@@ -773,7 +786,7 @@ msgid "can not open for output"
|
|
773 |
msgstr ""
|
774 |
|
775 |
#: classes/formats/class-woe-formatter-xls.php:72
|
776 |
-
#: classes/admin/class-wc-order-export-manage.php:
|
777 |
msgid "Orders"
|
778 |
msgstr ""
|
779 |
|
@@ -809,521 +822,534 @@ msgstr ""
|
|
809 |
msgid "Wrong key for cron url!"
|
810 |
msgstr ""
|
811 |
|
812 |
-
#: classes/admin/class-wc-order-export-ajax.php:
|
813 |
msgid "Can't create temporary file"
|
814 |
msgstr ""
|
815 |
|
816 |
-
#: classes/admin/class-wc-order-export-ajax.php:
|
817 |
msgid "Can't find exported file"
|
818 |
msgstr ""
|
819 |
|
820 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
821 |
msgid "Item ID"
|
822 |
msgstr ""
|
823 |
|
824 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
825 |
msgid "Item #"
|
826 |
msgstr ""
|
827 |
|
828 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
829 |
msgid "SKU"
|
830 |
msgstr ""
|
831 |
|
832 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
833 |
-
msgid "Name"
|
|
|
|
|
|
|
|
|
834 |
msgstr ""
|
835 |
|
836 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
837 |
msgid "Product Variation"
|
838 |
msgstr ""
|
839 |
|
840 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
841 |
msgid "Item Seller"
|
842 |
msgstr ""
|
843 |
|
844 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
845 |
msgid "Quantity"
|
846 |
msgstr ""
|
847 |
|
848 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
849 |
msgid "Quantity (- Refund)"
|
850 |
msgstr ""
|
851 |
|
852 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
853 |
msgid "Item Cost"
|
854 |
msgstr ""
|
855 |
|
856 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
857 |
msgid "Product Current Price"
|
858 |
msgstr ""
|
859 |
|
860 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
861 |
msgid "Order Line (w/o tax)"
|
862 |
msgstr ""
|
863 |
|
864 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
865 |
msgid "Order Line Tax"
|
866 |
msgstr ""
|
867 |
|
868 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
869 |
msgid "Order Line Tax Refunded"
|
870 |
msgstr ""
|
871 |
|
872 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
873 |
msgid "Order Line Tax (- Refund)"
|
874 |
msgstr ""
|
875 |
|
876 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
877 |
msgid "Order Line Subtotal"
|
878 |
msgstr ""
|
879 |
|
880 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
881 |
msgid "Order Line Total"
|
882 |
msgstr ""
|
883 |
|
884 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
885 |
msgid "Order Line Total (include tax)"
|
886 |
msgstr ""
|
887 |
|
888 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
889 |
msgid "Order Line Total Refunded"
|
890 |
msgstr ""
|
891 |
|
892 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
893 |
msgid "Order Line Total (- Refund)"
|
894 |
msgstr ""
|
895 |
|
896 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
897 |
msgid "Item Discount Amount"
|
898 |
msgstr ""
|
899 |
|
900 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
901 |
msgid "Item Tax Rate"
|
902 |
msgstr ""
|
903 |
|
904 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
905 |
msgid "Type"
|
906 |
msgstr ""
|
907 |
|
908 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
909 |
msgid "Category"
|
910 |
msgstr ""
|
911 |
|
912 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
913 |
msgid "Tags"
|
914 |
msgstr ""
|
915 |
|
916 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
917 |
msgid "Width"
|
918 |
msgstr ""
|
919 |
|
920 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
921 |
msgid "Length"
|
922 |
msgstr ""
|
923 |
|
924 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
925 |
msgid "Height"
|
926 |
msgstr ""
|
927 |
|
928 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
929 |
msgid "Weight"
|
930 |
msgstr ""
|
931 |
|
932 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
933 |
msgid "Product URL"
|
934 |
msgstr ""
|
935 |
|
936 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
937 |
msgid "Download URL"
|
938 |
msgstr ""
|
939 |
|
940 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
941 |
msgid "Image URL"
|
942 |
msgstr ""
|
943 |
|
944 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
945 |
msgid "Product Shipping Class"
|
946 |
msgstr ""
|
947 |
|
948 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
949 |
msgid "Description"
|
950 |
msgstr ""
|
951 |
|
952 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
953 |
msgid "Short Description"
|
954 |
msgstr ""
|
955 |
|
956 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
957 |
msgid "Full names for categories"
|
958 |
msgstr ""
|
959 |
|
960 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
961 |
msgid "Coupon Code"
|
962 |
msgstr ""
|
963 |
|
964 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
965 |
msgid "Discount Amount"
|
966 |
msgstr ""
|
967 |
|
968 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
969 |
msgid "Discount Amount Tax"
|
970 |
msgstr ""
|
971 |
|
972 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
973 |
msgid "Discount Amount + Tax"
|
974 |
msgstr ""
|
975 |
|
976 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
977 |
msgid "Coupon Description"
|
978 |
msgstr ""
|
979 |
|
980 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
981 |
msgid "Coupon Type"
|
982 |
msgstr ""
|
983 |
|
984 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
985 |
msgid "Coupon Amount"
|
986 |
msgstr ""
|
987 |
|
988 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
989 |
msgid "Line number"
|
990 |
msgstr ""
|
991 |
|
992 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
993 |
msgid "Order Number"
|
994 |
msgstr ""
|
995 |
|
996 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
997 |
msgid "Order Status"
|
998 |
msgstr ""
|
999 |
|
1000 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1001 |
msgid "Transaction ID"
|
1002 |
msgstr ""
|
1003 |
|
1004 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1005 |
msgid "Date of first refund"
|
1006 |
msgstr ""
|
1007 |
|
1008 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1009 |
msgid "Customer Note"
|
1010 |
msgstr ""
|
1011 |
|
1012 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1013 |
msgid "Order Notes"
|
1014 |
msgstr ""
|
1015 |
|
1016 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1017 |
msgid "Customer IP address"
|
1018 |
msgstr ""
|
1019 |
|
1020 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1021 |
msgid "Customer User ID"
|
1022 |
msgstr ""
|
1023 |
|
1024 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1025 |
msgid "Customer Username"
|
1026 |
msgstr ""
|
1027 |
|
1028 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1029 |
msgid "Customer User Email"
|
1030 |
msgstr ""
|
1031 |
|
1032 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1033 |
msgid "Customer Role"
|
1034 |
msgstr ""
|
1035 |
|
1036 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
|
|
|
|
|
|
|
|
1037 |
msgid "First Name (Billing)"
|
1038 |
msgstr ""
|
1039 |
|
1040 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1041 |
msgid "Last Name (Billing)"
|
1042 |
msgstr ""
|
1043 |
|
1044 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1045 |
msgid "Full Name (Billing)"
|
1046 |
msgstr ""
|
1047 |
|
1048 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1049 |
msgid "Company (Billing)"
|
1050 |
msgstr ""
|
1051 |
|
1052 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1053 |
msgid "Address 1&2 (Billing)"
|
1054 |
msgstr ""
|
1055 |
|
1056 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1057 |
msgid "Address 1 (Billing)"
|
1058 |
msgstr ""
|
1059 |
|
1060 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1061 |
msgid "Address 2 (Billing)"
|
1062 |
msgstr ""
|
1063 |
|
1064 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1065 |
msgid "City (Billing)"
|
1066 |
msgstr ""
|
1067 |
|
1068 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1069 |
msgid "State Code (Billing)"
|
1070 |
msgstr ""
|
1071 |
|
1072 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1073 |
msgid "City, State, Zip (Billing)"
|
1074 |
msgstr ""
|
1075 |
|
1076 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1077 |
msgid "State Name (Billing)"
|
1078 |
msgstr ""
|
1079 |
|
1080 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1081 |
msgid "Postcode (Billing)"
|
1082 |
msgstr ""
|
1083 |
|
1084 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1085 |
msgid "Country Code (Billing)"
|
1086 |
msgstr ""
|
1087 |
|
1088 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1089 |
msgid "Country Name (Billing)"
|
1090 |
msgstr ""
|
1091 |
|
1092 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1093 |
msgid "Email (Billing)"
|
1094 |
msgstr ""
|
1095 |
|
1096 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1097 |
msgid "Phone (Billing)"
|
1098 |
msgstr ""
|
1099 |
|
1100 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1101 |
msgid "First Name (Shipping)"
|
1102 |
msgstr ""
|
1103 |
|
1104 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1105 |
msgid "Last Name (Shipping)"
|
1106 |
msgstr ""
|
1107 |
|
1108 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1109 |
msgid "Full Name (Shipping)"
|
1110 |
msgstr ""
|
1111 |
|
1112 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1113 |
msgid "Company (Shipping)"
|
1114 |
msgstr ""
|
1115 |
|
1116 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1117 |
msgid "Address 1&2 (Shipping)"
|
1118 |
msgstr ""
|
1119 |
|
1120 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1121 |
msgid "Address 1 (Shipping)"
|
1122 |
msgstr ""
|
1123 |
|
1124 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1125 |
msgid "Address 2 (Shipping)"
|
1126 |
msgstr ""
|
1127 |
|
1128 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1129 |
msgid "City (Shipping)"
|
1130 |
msgstr ""
|
1131 |
|
1132 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1133 |
msgid "State Code (Shipping)"
|
1134 |
msgstr ""
|
1135 |
|
1136 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1137 |
msgid "City, State, Zip (Shipping)"
|
1138 |
msgstr ""
|
1139 |
|
1140 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1141 |
msgid "State Name (Shipping)"
|
1142 |
msgstr ""
|
1143 |
|
1144 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1145 |
msgid "Postcode (Shipping)"
|
1146 |
msgstr ""
|
1147 |
|
1148 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1149 |
msgid "Country Code (Shipping)"
|
1150 |
msgstr ""
|
1151 |
|
1152 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1153 |
msgid "Country Name (Shipping)"
|
1154 |
msgstr ""
|
1155 |
|
1156 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1157 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1158 |
msgid "Products"
|
1159 |
msgstr ""
|
1160 |
|
1161 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1162 |
msgid "Shipping Method Title"
|
1163 |
msgstr ""
|
1164 |
|
1165 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1166 |
msgid "Shipping Method"
|
1167 |
msgstr ""
|
1168 |
|
1169 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1170 |
msgid "Payment Method Title"
|
1171 |
msgstr ""
|
1172 |
|
1173 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1174 |
msgid "Payment Method"
|
1175 |
msgstr ""
|
1176 |
|
1177 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1178 |
msgid "Coupons Used"
|
1179 |
msgstr ""
|
1180 |
|
1181 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1182 |
msgid "Cart Discount Amount"
|
1183 |
msgstr ""
|
1184 |
|
1185 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1186 |
msgid "Cart Discount Amount Tax"
|
1187 |
msgstr ""
|
1188 |
|
1189 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1190 |
msgid "Order Subtotal Amount"
|
1191 |
msgstr ""
|
1192 |
|
1193 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1194 |
msgid "Order Subtotal Amount Refunded"
|
1195 |
msgstr ""
|
1196 |
|
1197 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1198 |
msgid "Order Subtotal Amount (- Refund)"
|
1199 |
msgstr ""
|
1200 |
|
1201 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1202 |
msgid "Order Tax Amount"
|
1203 |
msgstr ""
|
1204 |
|
1205 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1206 |
msgid "Order Shipping Amount"
|
1207 |
msgstr ""
|
1208 |
|
1209 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1210 |
msgid "Order Shipping Amount Refunded"
|
1211 |
msgstr ""
|
1212 |
|
1213 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1214 |
msgid "Order Shipping Amount (- Refund)"
|
1215 |
msgstr ""
|
1216 |
|
1217 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1218 |
msgid "Order Shipping Tax Amount"
|
1219 |
msgstr ""
|
1220 |
|
1221 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1222 |
msgid "Order Shipping Tax Refunded"
|
1223 |
msgstr ""
|
1224 |
|
1225 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1226 |
msgid "Order Shipping Tax Amount (- Refund)"
|
1227 |
msgstr ""
|
1228 |
|
1229 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1230 |
msgid "Order Refund Amount"
|
1231 |
msgstr ""
|
1232 |
|
1233 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1234 |
msgid "Order Total Amount (- Refund)"
|
1235 |
msgstr ""
|
1236 |
|
1237 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1238 |
msgid "Order Total Amount"
|
1239 |
msgstr ""
|
1240 |
|
1241 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1242 |
msgid "Order Total Amount without Tax"
|
1243 |
msgstr ""
|
1244 |
|
1245 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1246 |
msgid "Order Total Tax Amount"
|
1247 |
msgstr ""
|
1248 |
|
1249 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1250 |
msgid "Order Total Tax Amount Refunded"
|
1251 |
msgstr ""
|
1252 |
|
1253 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1254 |
msgid "Order Total Tax Amount (- Refund)"
|
1255 |
msgstr ""
|
1256 |
|
1257 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1258 |
msgid "Currency"
|
1259 |
msgstr ""
|
1260 |
|
1261 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1262 |
msgid "Total weight"
|
1263 |
msgstr ""
|
1264 |
|
1265 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1266 |
msgid "Total items"
|
1267 |
msgstr ""
|
1268 |
|
1269 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1270 |
msgid "Total products"
|
1271 |
msgstr ""
|
1272 |
|
1273 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1274 |
msgid "Common"
|
1275 |
msgstr ""
|
1276 |
|
1277 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1278 |
msgid "User"
|
1279 |
msgstr ""
|
1280 |
|
1281 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1282 |
msgid "Billing"
|
1283 |
msgstr ""
|
1284 |
|
1285 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1286 |
msgid "Shipping"
|
1287 |
msgstr ""
|
1288 |
|
1289 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1290 |
msgid "Cart"
|
1291 |
msgstr ""
|
1292 |
|
1293 |
-
#: classes/core/class-wc-order-export-data-extractor-ui.php:
|
1294 |
msgid "Others"
|
1295 |
msgstr ""
|
1296 |
|
1297 |
-
#: classes/core/class-wc-order-export-data-extractor.php:
|
1298 |
msgid "[Rest of the World]"
|
1299 |
msgstr ""
|
1300 |
|
1301 |
-
#: classes/core/class-wc-order-export-engine.php:
|
|
|
1302 |
msgid "No destination selected"
|
1303 |
msgstr ""
|
1304 |
|
1305 |
-
#: classes/core/class-wc-order-export-engine.php:
|
1306 |
msgid "Wrong format"
|
1307 |
msgstr ""
|
1308 |
|
1309 |
-
#: classes/core/class-wc-order-export-engine.php:
|
|
|
|
|
|
|
|
|
1310 |
msgid "Don't Panic"
|
1311 |
msgstr ""
|
1312 |
|
1313 |
-
#: classes/core/class-wc-order-export-engine.php:
|
1314 |
#, php-format
|
1315 |
msgid "The code you are trying to save produced a fatal error on line %d:"
|
1316 |
msgstr ""
|
1317 |
|
1318 |
-
#: classes/core/class-wc-order-export-engine.php:
|
1319 |
msgid "Main SQL queries are listed below"
|
1320 |
msgstr ""
|
1321 |
|
1322 |
-
#: classes/core/class-wc-order-export-engine.php:
|
1323 |
msgid "Total Quantity"
|
1324 |
msgstr ""
|
1325 |
|
1326 |
-
#: classes/core/class-wc-order-export-engine.php:
|
1327 |
msgid "Total Amount"
|
1328 |
msgstr ""
|
1329 |
|
3 |
msgstr ""
|
4 |
"Project-Id-Version: PACKAGE VERSION\n"
|
5 |
"Report-Msgid-Bugs-To: \n"
|
6 |
+
"POT-Creation-Date: 2018-06-08 11:21+0000\n"
|
7 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
8 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
9 |
"Language-Team: \n"
|
20 |
"Order Export For WooCommerce!"
|
21 |
msgstr ""
|
22 |
|
23 |
+
#: view/settings-form.php:55
|
24 |
msgid "Filter orders by"
|
25 |
msgstr ""
|
26 |
|
27 |
+
#: view/settings-form.php:59 view/settings-form.php:228
|
28 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:404
|
29 |
msgid "Order Date"
|
30 |
msgstr ""
|
31 |
|
32 |
+
#: view/settings-form.php:64 view/settings-form.php:229
|
33 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:405
|
34 |
msgid "Modification Date"
|
35 |
msgstr ""
|
36 |
|
37 |
+
#: view/settings-form.php:69
|
38 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:408
|
39 |
msgid "Paid Date"
|
40 |
msgstr ""
|
41 |
|
42 |
+
#: view/settings-form.php:74
|
43 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:407
|
44 |
msgid "Completed Date"
|
45 |
msgstr ""
|
46 |
|
47 |
+
#: view/settings-form.php:78
|
48 |
msgid "This date range should not be saved in the scheduled task"
|
49 |
msgstr ""
|
50 |
|
51 |
+
#: view/settings-form.php:80
|
52 |
msgid "Date range"
|
53 |
msgstr ""
|
54 |
|
55 |
+
#: view/settings-form.php:82
|
56 |
msgid "to"
|
57 |
msgstr ""
|
58 |
|
59 |
+
#: view/settings-form.php:86
|
60 |
msgid "Express export"
|
61 |
msgstr ""
|
62 |
|
63 |
+
#: view/settings-form.php:87
|
64 |
msgid "Summary Report By Products"
|
65 |
msgstr ""
|
66 |
|
67 |
+
#: view/settings-form.php:88
|
68 |
msgid "Set up fields"
|
69 |
msgstr ""
|
70 |
|
71 |
+
#: view/settings-form.php:96
|
72 |
msgid "Export filename"
|
73 |
msgstr ""
|
74 |
|
75 |
+
#: view/settings-form.php:106
|
76 |
msgid "Format"
|
77 |
msgstr ""
|
78 |
|
79 |
+
#: view/settings-form.php:117
|
80 |
msgid "XLS options"
|
81 |
msgstr ""
|
82 |
|
83 |
+
#: view/settings-form.php:123
|
84 |
msgid "Export as .xls (Binary File Format)"
|
85 |
msgstr ""
|
86 |
|
87 |
+
#: view/settings-form.php:124
|
88 |
msgid "Use sheet name"
|
89 |
msgstr ""
|
90 |
|
91 |
+
#: view/settings-form.php:125 view/settings-form.php:137
|
92 |
+
#: view/settings-form.php:167
|
93 |
msgid "Output column titles as first line"
|
94 |
msgstr ""
|
95 |
|
96 |
+
#: view/settings-form.php:126
|
97 |
msgid "Auto column width"
|
98 |
msgstr ""
|
99 |
|
100 |
+
#: view/settings-form.php:127 view/settings-form.php:138
|
101 |
+
#: view/settings-form.php:168
|
102 |
msgid "Populate other columns if products exported as rows"
|
103 |
msgstr ""
|
104 |
|
105 |
+
#: view/settings-form.php:128
|
106 |
msgid "Right-to-Left direction"
|
107 |
msgstr ""
|
108 |
|
109 |
+
#: view/settings-form.php:130
|
110 |
msgid "CSV options"
|
111 |
msgstr ""
|
112 |
|
113 |
+
#: view/settings-form.php:136 view/settings-form.php:166
|
114 |
msgid "Output UTF-8 BOM"
|
115 |
msgstr ""
|
116 |
|
117 |
+
#: view/settings-form.php:139
|
118 |
msgid "Convert line breaks to literals"
|
119 |
msgstr ""
|
120 |
|
121 |
+
#: view/settings-form.php:140
|
122 |
msgid "Item rows start from new line"
|
123 |
msgstr ""
|
124 |
|
125 |
+
#: view/settings-form.php:141
|
126 |
msgid "Enclosure"
|
127 |
msgstr ""
|
128 |
|
129 |
+
#: view/settings-form.php:142
|
130 |
msgid "Field Delimiter"
|
131 |
msgstr ""
|
132 |
|
133 |
+
#: view/settings-form.php:143 view/settings-form.php:169
|
134 |
msgid "Line Break"
|
135 |
msgstr ""
|
136 |
|
137 |
+
#: view/settings-form.php:145 view/settings-form.php:171
|
138 |
msgid "Character encoding"
|
139 |
msgstr ""
|
140 |
|
141 |
+
#: view/settings-form.php:148
|
142 |
msgid "XML options"
|
143 |
msgstr ""
|
144 |
|
145 |
+
#: view/settings-form.php:150
|
146 |
msgid "Prepend XML"
|
147 |
msgstr ""
|
148 |
|
149 |
+
#: view/settings-form.php:151
|
150 |
msgid "Root tag"
|
151 |
msgstr ""
|
152 |
|
153 |
+
#: view/settings-form.php:152
|
154 |
msgid "Order tag"
|
155 |
msgstr ""
|
156 |
|
157 |
+
#: view/settings-form.php:153
|
158 |
msgid "Product tag"
|
159 |
msgstr ""
|
160 |
|
161 |
+
#: view/settings-form.php:154
|
162 |
msgid "Coupon tag"
|
163 |
msgstr ""
|
164 |
|
165 |
+
#: view/settings-form.php:155
|
166 |
msgid "Append XML"
|
167 |
msgstr ""
|
168 |
|
169 |
+
#: view/settings-form.php:156
|
170 |
msgid "Self closing tags"
|
171 |
msgstr ""
|
172 |
|
173 |
+
#: view/settings-form.php:158
|
174 |
msgid "JSON options"
|
175 |
msgstr ""
|
176 |
|
177 |
+
#: view/settings-form.php:159
|
178 |
msgid "Start tag"
|
179 |
msgstr ""
|
180 |
|
181 |
+
#: view/settings-form.php:160
|
182 |
msgid "End tag"
|
183 |
msgstr ""
|
184 |
|
185 |
+
#: view/settings-form.php:162
|
186 |
msgid "TSV options"
|
187 |
msgstr ""
|
188 |
|
189 |
+
#: view/settings-form.php:178
|
190 |
msgid "Date"
|
191 |
msgstr ""
|
192 |
|
193 |
+
#: view/settings-form.php:191 view/settings-form.php:213
|
194 |
msgid "-"
|
195 |
msgstr ""
|
196 |
|
197 |
+
#: view/settings-form.php:193 view/settings-form.php:215
|
198 |
msgid "custom"
|
199 |
msgstr ""
|
200 |
|
201 |
+
#: view/settings-form.php:201
|
202 |
msgid "Time"
|
203 |
msgstr ""
|
204 |
|
205 |
+
#: view/settings-form.php:227
|
206 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:401
|
207 |
msgid "Order ID"
|
208 |
msgstr ""
|
209 |
|
210 |
+
#: view/settings-form.php:244
|
211 |
msgid "Descending"
|
212 |
msgstr ""
|
213 |
|
214 |
+
#: view/settings-form.php:245
|
215 |
msgid "Ascending"
|
216 |
msgstr ""
|
217 |
|
218 |
+
#: view/settings-form.php:250
|
219 |
#, php-format
|
220 |
msgid "Sort orders by %s in %s order"
|
221 |
msgstr ""
|
222 |
|
223 |
+
#: view/settings-form.php:255
|
224 |
msgid "Change order status to"
|
225 |
msgstr ""
|
226 |
|
227 |
+
#: view/settings-form.php:257
|
228 |
msgid "- don't modify -"
|
229 |
msgstr ""
|
230 |
|
231 |
+
#: view/settings-form.php:267
|
232 |
msgid "Misc settings"
|
233 |
msgstr ""
|
234 |
|
235 |
+
#: view/settings-form.php:272
|
236 |
msgid "Format numbers (use WC decimal separator)"
|
237 |
msgstr ""
|
238 |
|
239 |
+
#: view/settings-form.php:276
|
240 |
msgid "Export all order notes"
|
241 |
msgstr ""
|
242 |
|
243 |
+
#: view/settings-form.php:280
|
244 |
msgid "Export refund notes as Customer Note"
|
245 |
msgstr ""
|
246 |
|
247 |
+
#: view/settings-form.php:284
|
248 |
msgid "Strip tags from Product Description/Variation"
|
249 |
msgstr ""
|
250 |
|
251 |
+
#: view/settings-form.php:288
|
252 |
msgid "Cleanup phone (export only digits)"
|
253 |
msgstr ""
|
254 |
|
255 |
+
#: view/settings-form.php:292
|
256 |
msgid "Enable debug output"
|
257 |
msgstr ""
|
258 |
|
259 |
+
#: view/settings-form.php:296
|
260 |
msgid "Custom PHP code to modify output"
|
261 |
msgstr ""
|
262 |
|
263 |
+
#: view/settings-form.php:297
|
264 |
msgid "Use only unnamed functions!"
|
265 |
msgstr ""
|
266 |
|
267 |
+
#: view/settings-form.php:310
|
268 |
msgid "Filter by order"
|
269 |
msgstr ""
|
270 |
|
271 |
+
#: view/settings-form.php:313
|
272 |
msgid "Don't export child orders"
|
273 |
msgstr ""
|
274 |
|
275 |
+
#: view/settings-form.php:314
|
276 |
msgid "Export refunds"
|
277 |
msgstr ""
|
278 |
|
279 |
+
#: view/settings-form.php:315
|
280 |
msgid "Mark exported orders"
|
281 |
msgstr ""
|
282 |
|
283 |
+
#: view/settings-form.php:316
|
284 |
msgid "Export unmarked orders only"
|
285 |
msgstr ""
|
286 |
|
287 |
+
#: view/settings-form.php:317
|
288 |
msgid "Order statuses"
|
289 |
msgstr ""
|
290 |
|
291 |
+
#: view/settings-form.php:324
|
292 |
msgid "Custom fields"
|
293 |
msgstr ""
|
294 |
|
295 |
+
#: view/settings-form.php:363
|
296 |
msgid ""
|
297 |
"The filters won't work correctly.<br>Another plugin(or theme) has loaded "
|
298 |
"outdated Select2.js"
|
299 |
msgstr ""
|
300 |
|
301 |
+
#: view/settings-form.php:364
|
302 |
msgid "Filter by product"
|
303 |
msgstr ""
|
304 |
|
305 |
+
#: view/settings-form.php:367
|
306 |
msgid "Export all products from a order"
|
307 |
msgstr ""
|
308 |
|
309 |
+
#: view/settings-form.php:368
|
310 |
msgid "Skip fully refunded items"
|
311 |
msgstr ""
|
312 |
|
313 |
+
#: view/settings-form.php:369
|
314 |
msgid "Product categories"
|
315 |
msgstr ""
|
316 |
|
317 |
+
#: view/settings-form.php:379
|
318 |
msgid "Vendor/creator"
|
319 |
msgstr ""
|
320 |
|
321 |
+
#: view/settings-form.php:392
|
322 |
msgid "Product"
|
323 |
msgstr ""
|
324 |
|
325 |
+
#: view/settings-form.php:404
|
326 |
msgid "Product taxonomies"
|
327 |
msgstr ""
|
328 |
|
329 |
+
#: view/settings-form.php:430
|
330 |
msgid "Product custom fields"
|
331 |
msgstr ""
|
332 |
|
333 |
+
#: view/settings-form.php:461
|
334 |
msgid "Variable product attributes"
|
335 |
msgstr ""
|
336 |
|
337 |
+
#: view/settings-form.php:488
|
338 |
msgid "Item meta data"
|
339 |
msgstr ""
|
340 |
|
341 |
+
#: view/settings-form.php:525
|
342 |
msgid "Filter by customers"
|
343 |
msgstr ""
|
344 |
|
345 |
+
#: view/settings-form.php:528
|
346 |
msgid "User roles"
|
347 |
msgstr ""
|
348 |
|
349 |
+
#: view/settings-form.php:537
|
350 |
msgid "Usernames"
|
351 |
msgstr ""
|
352 |
|
353 |
+
#: view/settings-form.php:553
|
354 |
msgid "Filter by coupons"
|
355 |
msgstr ""
|
356 |
|
357 |
+
#: view/settings-form.php:558
|
358 |
msgid "Any coupon used"
|
359 |
msgstr ""
|
360 |
|
361 |
+
#: view/settings-form.php:560
|
362 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:476
|
363 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:538
|
364 |
msgid "Coupons"
|
365 |
msgstr ""
|
366 |
|
367 |
+
#: view/settings-form.php:575
|
368 |
msgid "Filter by billing"
|
369 |
msgstr ""
|
370 |
|
371 |
+
#: view/settings-form.php:578
|
372 |
msgid "Billing locations"
|
373 |
msgstr ""
|
374 |
|
375 |
+
#: view/settings-form.php:602
|
376 |
msgid "Payment methods"
|
377 |
msgstr ""
|
378 |
|
379 |
+
#: view/settings-form.php:614
|
380 |
msgid "Filter by shipping"
|
381 |
msgstr ""
|
382 |
|
383 |
+
#: view/settings-form.php:617
|
384 |
msgid "Shipping locations"
|
385 |
msgstr ""
|
386 |
|
387 |
+
#: view/settings-form.php:641
|
388 |
msgid "Shipping methods"
|
389 |
msgstr ""
|
390 |
|
391 |
+
#: view/settings-form.php:653
|
392 |
+
msgid "Filter by item and metadata"
|
393 |
+
msgstr ""
|
394 |
+
|
395 |
+
#: view/settings-form.php:656
|
396 |
+
msgid "Item names"
|
397 |
+
msgstr ""
|
398 |
+
|
399 |
+
#: view/settings-form.php:680
|
400 |
+
msgid "Item metadata"
|
401 |
+
msgstr ""
|
402 |
+
|
403 |
+
#: view/settings-form.php:714 classes/class-wc-order-export-admin.php:525
|
404 |
msgid "Set up fields to export"
|
405 |
msgstr ""
|
406 |
|
407 |
+
#: view/settings-form.php:720 view/modal-controls.php:36
|
408 |
msgid "Meta key"
|
409 |
msgstr ""
|
410 |
|
411 |
+
#: view/settings-form.php:728 view/settings-form.php:740
|
412 |
#: view/modal-controls.php:20 view/modal-controls.php:26
|
413 |
#: view/modal-controls.php:43 view/modal-controls.php:49
|
414 |
msgid "Column name"
|
415 |
msgstr ""
|
416 |
|
417 |
+
#: view/settings-form.php:731
|
418 |
msgid "or type meta key here"
|
419 |
msgstr ""
|
420 |
|
421 |
+
#: view/settings-form.php:732 view/settings-form.php:760
|
422 |
#: view/modal-controls.php:4 view/modal-controls.php:39
|
423 |
msgid "Hide unused fields"
|
424 |
msgstr ""
|
425 |
|
426 |
+
#: view/settings-form.php:735 view/settings-form.php:743
|
427 |
msgid "Confirm"
|
428 |
msgstr ""
|
429 |
|
430 |
+
#: view/settings-form.php:736 view/settings-form.php:744
|
431 |
msgid "Cancel"
|
432 |
msgstr ""
|
433 |
|
434 |
+
#: view/settings-form.php:741 view/modal-controls.php:27
|
435 |
#: view/modal-controls.php:50
|
436 |
msgid "Value"
|
437 |
msgstr ""
|
438 |
|
439 |
+
#: view/settings-form.php:747
|
440 |
msgid "Use sections"
|
441 |
msgstr ""
|
442 |
|
443 |
+
#: view/settings-form.php:754
|
444 |
msgid "Actions"
|
445 |
msgstr ""
|
446 |
|
447 |
+
#: view/settings-form.php:755 view/modal-controls.php:22
|
448 |
#: view/modal-controls.php:45
|
449 |
msgid "Add field"
|
450 |
msgstr ""
|
451 |
|
452 |
+
#: view/settings-form.php:757 view/modal-controls.php:29
|
453 |
#: view/modal-controls.php:52
|
454 |
msgid "Add static field"
|
455 |
msgstr ""
|
456 |
|
457 |
+
#: view/settings-form.php:761
|
458 |
msgid "Show unused fields"
|
459 |
msgstr ""
|
460 |
|
461 |
+
#: view/settings-form.php:769
|
462 |
msgid "Select all"
|
463 |
msgstr ""
|
464 |
|
465 |
+
#: view/settings-form.php:772
|
466 |
msgid "Drag rows to reorder exported fields"
|
467 |
msgstr ""
|
468 |
|
469 |
+
#: view/settings-form.php:783
|
470 |
#, php-format
|
471 |
msgid ""
|
472 |
"If you see this message after page load, user interface won't work correctly!"
|
474 |
"it). Probably, it's a conflict with another plugin or active theme."
|
475 |
msgstr ""
|
476 |
|
477 |
+
#: view/settings-form.php:785
|
478 |
msgid "Preview"
|
479 |
msgstr ""
|
480 |
|
481 |
+
#: view/settings-form.php:785
|
482 |
msgid "Might be different from actual export!"
|
483 |
msgstr ""
|
484 |
|
485 |
+
#: view/settings-form.php:786
|
486 |
msgid "Save settings"
|
487 |
msgstr ""
|
488 |
|
489 |
+
#: view/settings-form.php:788
|
490 |
msgid "Export"
|
491 |
msgstr ""
|
492 |
|
493 |
+
#: view/settings-form.php:791
|
494 |
msgid "Export [w/o progressbar]"
|
495 |
msgstr ""
|
496 |
|
497 |
+
#: view/settings-form.php:791
|
498 |
msgid "It might not work for huge datasets!"
|
499 |
msgstr ""
|
500 |
|
501 |
+
#: view/settings-form.php:794
|
502 |
msgid "Save as a profile"
|
503 |
msgstr ""
|
504 |
|
505 |
+
#: view/settings-form.php:797
|
506 |
#, php-format
|
507 |
msgid "Export total: %s orders"
|
508 |
msgstr ""
|
509 |
|
510 |
+
#: view/settings-form.php:798
|
511 |
msgid "Preview size"
|
512 |
msgstr ""
|
513 |
|
514 |
+
#: view/settings-form.php:806
|
515 |
msgid "Press 'Esc' to cancel the export"
|
516 |
msgstr ""
|
517 |
|
518 |
+
#: view/settings-form.php:807
|
519 |
msgid "Click here to download"
|
520 |
msgstr ""
|
521 |
|
|
|
|
|
|
|
|
|
|
|
522 |
#: view/main.php:8
|
523 |
msgid "Settings saved"
|
524 |
msgstr ""
|
567 |
msgid "All meta"
|
568 |
msgstr ""
|
569 |
|
570 |
+
#: classes/class-wc-order-export-admin.php:87
|
571 |
msgid "Export Status"
|
572 |
msgstr ""
|
573 |
|
574 |
+
#: classes/class-wc-order-export-admin.php:127
|
575 |
msgid ""
|
576 |
"Advanced Order Export For WooCommerce is available <a href=\"admin.php?"
|
577 |
"page=wc-order-export\">on this page</a>."
|
578 |
msgstr ""
|
579 |
|
580 |
+
#: classes/class-wc-order-export-admin.php:135
|
581 |
msgid "Settings"
|
582 |
msgstr ""
|
583 |
|
584 |
+
#: classes/class-wc-order-export-admin.php:136
|
585 |
msgid "Docs"
|
586 |
msgstr ""
|
587 |
|
588 |
+
#: classes/class-wc-order-export-admin.php:137
|
589 |
msgid "Support"
|
590 |
msgstr ""
|
591 |
|
592 |
+
#: classes/class-wc-order-export-admin.php:206
|
593 |
+
#: classes/class-wc-order-export-admin.php:208
|
594 |
+
#: classes/class-wc-order-export-admin.php:208
|
595 |
msgid "Export Orders"
|
596 |
msgstr ""
|
597 |
|
598 |
+
#: classes/class-wc-order-export-admin.php:498
|
599 |
msgid "Copied from \"Export now\""
|
600 |
msgstr ""
|
601 |
|
602 |
+
#: classes/class-wc-order-export-admin.php:526
|
603 |
+
#, php-format
|
604 |
+
msgid "Add %s as %s columns %s as rows"
|
605 |
+
msgstr ""
|
606 |
+
|
607 |
+
#: classes/class-wc-order-export-admin.php:567
|
608 |
msgid "empty column name"
|
609 |
msgstr ""
|
610 |
|
611 |
+
#: classes/class-wc-order-export-admin.php:568
|
612 |
msgid "empty meta key"
|
613 |
msgstr ""
|
614 |
|
615 |
+
#: classes/class-wc-order-export-admin.php:569
|
616 |
msgid "select product field or item field or taxonomy"
|
617 |
msgstr ""
|
618 |
|
619 |
+
#: classes/class-wc-order-export-admin.php:570
|
620 |
msgid "empty value"
|
621 |
msgstr ""
|
622 |
|
623 |
+
#: classes/class-wc-order-export-admin.php:571
|
624 |
msgid "title is empty"
|
625 |
msgstr ""
|
626 |
|
627 |
+
#: classes/class-wc-order-export-admin.php:572
|
628 |
msgid "Date From is greater than Date To"
|
629 |
msgstr ""
|
630 |
|
631 |
+
#: classes/class-wc-order-export-admin.php:573
|
632 |
msgid "Please, set up fields to export"
|
633 |
msgstr ""
|
634 |
|
635 |
+
#: classes/class-wc-order-export-admin.php:574
|
636 |
+
#: classes/admin/class-wc-order-export-ajax.php:335
|
637 |
+
#: classes/core/class-wc-order-export-engine.php:692
|
638 |
+
#: classes/core/class-wc-order-export-engine.php:702
|
639 |
msgid "Nothing to export. Please, adjust your filters"
|
640 |
msgstr ""
|
641 |
|
642 |
+
#: classes/class-wc-order-export-admin.php:575
|
643 |
+
#: classes/core/class-wc-order-export-data-extractor.php:195
|
644 |
msgid "empty"
|
645 |
msgstr ""
|
646 |
|
647 |
+
#: classes/class-wc-order-export-admin.php:667
|
648 |
#, php-format
|
649 |
msgid "Status change job #%s for order #%s. Result: %s"
|
650 |
msgstr ""
|
651 |
|
652 |
+
#: classes/class-wc-order-export-admin.php:727
|
653 |
#, php-format
|
654 |
msgid "Export as %s"
|
655 |
msgstr ""
|
656 |
|
657 |
+
#: classes/class-wc-order-export-admin.php:732
|
658 |
msgid "Mark exported"
|
659 |
msgstr ""
|
660 |
|
661 |
+
#: classes/class-wc-order-export-admin.php:733
|
662 |
msgid "Unmark exported"
|
663 |
msgstr ""
|
664 |
|
665 |
+
#: classes/class-wc-order-export-admin.php:739
|
666 |
#, php-format
|
667 |
msgid "Export as profile '%s'"
|
668 |
msgstr ""
|
669 |
|
670 |
+
#: classes/class-wc-order-export-admin.php:805
|
671 |
#, php-format
|
672 |
msgid "%s order marked."
|
673 |
msgid_plural "%s orders marked."
|
674 |
msgstr[0] ""
|
675 |
msgstr[1] ""
|
676 |
|
677 |
+
#: classes/class-wc-order-export-admin.php:814
|
678 |
#, php-format
|
679 |
msgid "%s order unmarked."
|
680 |
msgid_plural "%s orders unmarked."
|
786 |
msgstr ""
|
787 |
|
788 |
#: classes/formats/class-woe-formatter-xls.php:72
|
789 |
+
#: classes/admin/class-wc-order-export-manage.php:204
|
790 |
msgid "Orders"
|
791 |
msgstr ""
|
792 |
|
822 |
msgid "Wrong key for cron url!"
|
823 |
msgstr ""
|
824 |
|
825 |
+
#: classes/admin/class-wc-order-export-ajax.php:232
|
826 |
msgid "Can't create temporary file"
|
827 |
msgstr ""
|
828 |
|
829 |
+
#: classes/admin/class-wc-order-export-ajax.php:254
|
830 |
msgid "Can't find exported file"
|
831 |
msgstr ""
|
832 |
|
833 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:313
|
834 |
msgid "Item ID"
|
835 |
msgstr ""
|
836 |
|
837 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:314
|
838 |
msgid "Item #"
|
839 |
msgstr ""
|
840 |
|
841 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:315
|
842 |
msgid "SKU"
|
843 |
msgstr ""
|
844 |
|
845 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:316
|
846 |
+
msgid "Item Name"
|
847 |
+
msgstr ""
|
848 |
+
|
849 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:317
|
850 |
+
msgid "Product Name"
|
851 |
msgstr ""
|
852 |
|
853 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:318
|
854 |
msgid "Product Variation"
|
855 |
msgstr ""
|
856 |
|
857 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:319
|
858 |
msgid "Item Seller"
|
859 |
msgstr ""
|
860 |
|
861 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:320
|
862 |
msgid "Quantity"
|
863 |
msgstr ""
|
864 |
|
865 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:321
|
866 |
msgid "Quantity (- Refund)"
|
867 |
msgstr ""
|
868 |
|
869 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:322
|
870 |
msgid "Item Cost"
|
871 |
msgstr ""
|
872 |
|
873 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:323
|
874 |
msgid "Product Current Price"
|
875 |
msgstr ""
|
876 |
|
877 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:324
|
878 |
msgid "Order Line (w/o tax)"
|
879 |
msgstr ""
|
880 |
|
881 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:325
|
882 |
msgid "Order Line Tax"
|
883 |
msgstr ""
|
884 |
|
885 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:326
|
886 |
msgid "Order Line Tax Refunded"
|
887 |
msgstr ""
|
888 |
|
889 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:327
|
890 |
msgid "Order Line Tax (- Refund)"
|
891 |
msgstr ""
|
892 |
|
893 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:328
|
894 |
msgid "Order Line Subtotal"
|
895 |
msgstr ""
|
896 |
|
897 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:329
|
898 |
msgid "Order Line Total"
|
899 |
msgstr ""
|
900 |
|
901 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:330
|
902 |
msgid "Order Line Total (include tax)"
|
903 |
msgstr ""
|
904 |
|
905 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:331
|
906 |
msgid "Order Line Total Refunded"
|
907 |
msgstr ""
|
908 |
|
909 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:332
|
910 |
msgid "Order Line Total (- Refund)"
|
911 |
msgstr ""
|
912 |
|
913 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:333
|
914 |
msgid "Item Discount Amount"
|
915 |
msgstr ""
|
916 |
|
917 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:334
|
918 |
msgid "Item Tax Rate"
|
919 |
msgstr ""
|
920 |
|
921 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:335
|
922 |
msgid "Type"
|
923 |
msgstr ""
|
924 |
|
925 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:336
|
926 |
msgid "Category"
|
927 |
msgstr ""
|
928 |
|
929 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:337
|
930 |
msgid "Tags"
|
931 |
msgstr ""
|
932 |
|
933 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:338
|
934 |
msgid "Width"
|
935 |
msgstr ""
|
936 |
|
937 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:339
|
938 |
msgid "Length"
|
939 |
msgstr ""
|
940 |
|
941 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:340
|
942 |
msgid "Height"
|
943 |
msgstr ""
|
944 |
|
945 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:341
|
946 |
msgid "Weight"
|
947 |
msgstr ""
|
948 |
|
949 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:342
|
950 |
msgid "Product URL"
|
951 |
msgstr ""
|
952 |
|
953 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:343
|
954 |
msgid "Download URL"
|
955 |
msgstr ""
|
956 |
|
957 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:344
|
958 |
msgid "Image URL"
|
959 |
msgstr ""
|
960 |
|
961 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:345
|
962 |
msgid "Product Shipping Class"
|
963 |
msgstr ""
|
964 |
|
965 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:346
|
966 |
msgid "Description"
|
967 |
msgstr ""
|
968 |
|
969 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:347
|
970 |
msgid "Short Description"
|
971 |
msgstr ""
|
972 |
|
973 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:348
|
974 |
msgid "Full names for categories"
|
975 |
msgstr ""
|
976 |
|
977 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:361
|
978 |
msgid "Coupon Code"
|
979 |
msgstr ""
|
980 |
|
981 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:362
|
982 |
msgid "Discount Amount"
|
983 |
msgstr ""
|
984 |
|
985 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:363
|
986 |
msgid "Discount Amount Tax"
|
987 |
msgstr ""
|
988 |
|
989 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:364
|
990 |
msgid "Discount Amount + Tax"
|
991 |
msgstr ""
|
992 |
|
993 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:365
|
994 |
msgid "Coupon Description"
|
995 |
msgstr ""
|
996 |
|
997 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:366
|
998 |
msgid "Coupon Type"
|
999 |
msgstr ""
|
1000 |
|
1001 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:367
|
1002 |
msgid "Coupon Amount"
|
1003 |
msgstr ""
|
1004 |
|
1005 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:400
|
1006 |
msgid "Line number"
|
1007 |
msgstr ""
|
1008 |
|
1009 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:402
|
1010 |
msgid "Order Number"
|
1011 |
msgstr ""
|
1012 |
|
1013 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:403
|
1014 |
msgid "Order Status"
|
1015 |
msgstr ""
|
1016 |
|
1017 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:406
|
1018 |
msgid "Transaction ID"
|
1019 |
msgstr ""
|
1020 |
|
1021 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:409
|
1022 |
msgid "Date of first refund"
|
1023 |
msgstr ""
|
1024 |
|
1025 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:410
|
1026 |
msgid "Customer Note"
|
1027 |
msgstr ""
|
1028 |
|
1029 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:411
|
1030 |
msgid "Order Notes"
|
1031 |
msgstr ""
|
1032 |
|
1033 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:417
|
1034 |
msgid "Customer IP address"
|
1035 |
msgstr ""
|
1036 |
|
1037 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:418
|
1038 |
msgid "Customer User ID"
|
1039 |
msgstr ""
|
1040 |
|
1041 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:419
|
1042 |
msgid "Customer Username"
|
1043 |
msgstr ""
|
1044 |
|
1045 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:420
|
1046 |
msgid "Customer User Email"
|
1047 |
msgstr ""
|
1048 |
|
1049 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:421
|
1050 |
msgid "Customer Role"
|
1051 |
msgstr ""
|
1052 |
|
1053 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:422
|
1054 |
+
msgid "Customer Total Orders"
|
1055 |
+
msgstr ""
|
1056 |
+
|
1057 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:428
|
1058 |
msgid "First Name (Billing)"
|
1059 |
msgstr ""
|
1060 |
|
1061 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:429
|
1062 |
msgid "Last Name (Billing)"
|
1063 |
msgstr ""
|
1064 |
|
1065 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:430
|
1066 |
msgid "Full Name (Billing)"
|
1067 |
msgstr ""
|
1068 |
|
1069 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:431
|
1070 |
msgid "Company (Billing)"
|
1071 |
msgstr ""
|
1072 |
|
1073 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:432
|
1074 |
msgid "Address 1&2 (Billing)"
|
1075 |
msgstr ""
|
1076 |
|
1077 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:433
|
1078 |
msgid "Address 1 (Billing)"
|
1079 |
msgstr ""
|
1080 |
|
1081 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:434
|
1082 |
msgid "Address 2 (Billing)"
|
1083 |
msgstr ""
|
1084 |
|
1085 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:435
|
1086 |
msgid "City (Billing)"
|
1087 |
msgstr ""
|
1088 |
|
1089 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:436
|
1090 |
msgid "State Code (Billing)"
|
1091 |
msgstr ""
|
1092 |
|
1093 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:437
|
1094 |
msgid "City, State, Zip (Billing)"
|
1095 |
msgstr ""
|
1096 |
|
1097 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:438
|
1098 |
msgid "State Name (Billing)"
|
1099 |
msgstr ""
|
1100 |
|
1101 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:439
|
1102 |
msgid "Postcode (Billing)"
|
1103 |
msgstr ""
|
1104 |
|
1105 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:440
|
1106 |
msgid "Country Code (Billing)"
|
1107 |
msgstr ""
|
1108 |
|
1109 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:441
|
1110 |
msgid "Country Name (Billing)"
|
1111 |
msgstr ""
|
1112 |
|
1113 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:442
|
1114 |
msgid "Email (Billing)"
|
1115 |
msgstr ""
|
1116 |
|
1117 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:443
|
1118 |
msgid "Phone (Billing)"
|
1119 |
msgstr ""
|
1120 |
|
1121 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:449
|
1122 |
msgid "First Name (Shipping)"
|
1123 |
msgstr ""
|
1124 |
|
1125 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:450
|
1126 |
msgid "Last Name (Shipping)"
|
1127 |
msgstr ""
|
1128 |
|
1129 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:451
|
1130 |
msgid "Full Name (Shipping)"
|
1131 |
msgstr ""
|
1132 |
|
1133 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:452
|
1134 |
msgid "Company (Shipping)"
|
1135 |
msgstr ""
|
1136 |
|
1137 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:453
|
1138 |
msgid "Address 1&2 (Shipping)"
|
1139 |
msgstr ""
|
1140 |
|
1141 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:454
|
1142 |
msgid "Address 1 (Shipping)"
|
1143 |
msgstr ""
|
1144 |
|
1145 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:455
|
1146 |
msgid "Address 2 (Shipping)"
|
1147 |
msgstr ""
|
1148 |
|
1149 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:456
|
1150 |
msgid "City (Shipping)"
|
1151 |
msgstr ""
|
1152 |
|
1153 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:457
|
1154 |
msgid "State Code (Shipping)"
|
1155 |
msgstr ""
|
1156 |
|
1157 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:458
|
1158 |
msgid "City, State, Zip (Shipping)"
|
1159 |
msgstr ""
|
1160 |
|
1161 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:459
|
1162 |
msgid "State Name (Shipping)"
|
1163 |
msgstr ""
|
1164 |
|
1165 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:460
|
1166 |
msgid "Postcode (Shipping)"
|
1167 |
msgstr ""
|
1168 |
|
1169 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:461
|
1170 |
msgid "Country Code (Shipping)"
|
1171 |
msgstr ""
|
1172 |
|
1173 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:462
|
1174 |
msgid "Country Name (Shipping)"
|
1175 |
msgstr ""
|
1176 |
|
1177 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:469
|
1178 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:537
|
1179 |
msgid "Products"
|
1180 |
msgstr ""
|
1181 |
|
1182 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:482
|
1183 |
msgid "Shipping Method Title"
|
1184 |
msgstr ""
|
1185 |
|
1186 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:483
|
1187 |
msgid "Shipping Method"
|
1188 |
msgstr ""
|
1189 |
|
1190 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:484
|
1191 |
msgid "Payment Method Title"
|
1192 |
msgstr ""
|
1193 |
|
1194 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:485
|
1195 |
msgid "Payment Method"
|
1196 |
msgstr ""
|
1197 |
|
1198 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:486
|
1199 |
msgid "Coupons Used"
|
1200 |
msgstr ""
|
1201 |
|
1202 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:487
|
1203 |
msgid "Cart Discount Amount"
|
1204 |
msgstr ""
|
1205 |
|
1206 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:488
|
1207 |
msgid "Cart Discount Amount Tax"
|
1208 |
msgstr ""
|
1209 |
|
1210 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:489
|
1211 |
msgid "Order Subtotal Amount"
|
1212 |
msgstr ""
|
1213 |
|
1214 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:491
|
1215 |
msgid "Order Subtotal Amount Refunded"
|
1216 |
msgstr ""
|
1217 |
|
1218 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:492
|
1219 |
msgid "Order Subtotal Amount (- Refund)"
|
1220 |
msgstr ""
|
1221 |
|
1222 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:493
|
1223 |
msgid "Order Tax Amount"
|
1224 |
msgstr ""
|
1225 |
|
1226 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:494
|
1227 |
msgid "Order Shipping Amount"
|
1228 |
msgstr ""
|
1229 |
|
1230 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:495
|
1231 |
msgid "Order Shipping Amount Refunded"
|
1232 |
msgstr ""
|
1233 |
|
1234 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:496
|
1235 |
msgid "Order Shipping Amount (- Refund)"
|
1236 |
msgstr ""
|
1237 |
|
1238 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:497
|
1239 |
msgid "Order Shipping Tax Amount"
|
1240 |
msgstr ""
|
1241 |
|
1242 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:498
|
1243 |
msgid "Order Shipping Tax Refunded"
|
1244 |
msgstr ""
|
1245 |
|
1246 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:499
|
1247 |
msgid "Order Shipping Tax Amount (- Refund)"
|
1248 |
msgstr ""
|
1249 |
|
1250 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:500
|
1251 |
msgid "Order Refund Amount"
|
1252 |
msgstr ""
|
1253 |
|
1254 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:501
|
1255 |
msgid "Order Total Amount (- Refund)"
|
1256 |
msgstr ""
|
1257 |
|
1258 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:502
|
1259 |
msgid "Order Total Amount"
|
1260 |
msgstr ""
|
1261 |
|
1262 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:503
|
1263 |
msgid "Order Total Amount without Tax"
|
1264 |
msgstr ""
|
1265 |
|
1266 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:504
|
1267 |
msgid "Order Total Tax Amount"
|
1268 |
msgstr ""
|
1269 |
|
1270 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:505
|
1271 |
msgid "Order Total Tax Amount Refunded"
|
1272 |
msgstr ""
|
1273 |
|
1274 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:506
|
1275 |
msgid "Order Total Tax Amount (- Refund)"
|
1276 |
msgstr ""
|
1277 |
|
1278 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:507
|
1279 |
msgid "Currency"
|
1280 |
msgstr ""
|
1281 |
|
1282 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:513
|
1283 |
msgid "Total weight"
|
1284 |
msgstr ""
|
1285 |
|
1286 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:514
|
1287 |
msgid "Total items"
|
1288 |
msgstr ""
|
1289 |
|
1290 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:515
|
1291 |
msgid "Total products"
|
1292 |
msgstr ""
|
1293 |
|
1294 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:533
|
1295 |
msgid "Common"
|
1296 |
msgstr ""
|
1297 |
|
1298 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:534
|
1299 |
msgid "User"
|
1300 |
msgstr ""
|
1301 |
|
1302 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:535
|
1303 |
msgid "Billing"
|
1304 |
msgstr ""
|
1305 |
|
1306 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:536
|
1307 |
msgid "Shipping"
|
1308 |
msgstr ""
|
1309 |
|
1310 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:539
|
1311 |
msgid "Cart"
|
1312 |
msgstr ""
|
1313 |
|
1314 |
+
#: classes/core/class-wc-order-export-data-extractor-ui.php:540
|
1315 |
msgid "Others"
|
1316 |
msgstr ""
|
1317 |
|
1318 |
+
#: classes/core/class-wc-order-export-data-extractor.php:1848
|
1319 |
msgid "[Rest of the World]"
|
1320 |
msgstr ""
|
1321 |
|
1322 |
+
#: classes/core/class-wc-order-export-engine.php:18
|
1323 |
+
#: classes/core/class-wc-order-export-engine.php:56
|
1324 |
msgid "No destination selected"
|
1325 |
msgstr ""
|
1326 |
|
1327 |
+
#: classes/core/class-wc-order-export-engine.php:28
|
1328 |
msgid "Wrong format"
|
1329 |
msgstr ""
|
1330 |
|
1331 |
+
#: classes/core/class-wc-order-export-engine.php:66
|
1332 |
+
msgid "Wrong export type"
|
1333 |
+
msgstr ""
|
1334 |
+
|
1335 |
+
#: classes/core/class-wc-order-export-engine.php:372
|
1336 |
msgid "Don't Panic"
|
1337 |
msgstr ""
|
1338 |
|
1339 |
+
#: classes/core/class-wc-order-export-engine.php:373
|
1340 |
#, php-format
|
1341 |
msgid "The code you are trying to save produced a fatal error on line %d:"
|
1342 |
msgstr ""
|
1343 |
|
1344 |
+
#: classes/core/class-wc-order-export-engine.php:499
|
1345 |
msgid "Main SQL queries are listed below"
|
1346 |
msgstr ""
|
1347 |
|
1348 |
+
#: classes/core/class-wc-order-export-engine.php:731
|
1349 |
msgid "Total Quantity"
|
1350 |
msgstr ""
|
1351 |
|
1352 |
+
#: classes/core/class-wc-order-export-engine.php:731
|
1353 |
msgid "Total Amount"
|
1354 |
msgstr ""
|
1355 |
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: woocommerce,export,order,xls,csv,xml,woo export lite,export orders,orders
|
|
5 |
Requires PHP: 5.3.0
|
6 |
Requires at least: 4.7
|
7 |
Tested up to: 4.9
|
8 |
-
Stable tag: 1.5.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -65,8 +65,8 @@ Need help? Create ticket in [helpdesk system](https://algolplus.freshdesk.com).
|
|
65 |
|
66 |
Check [some snippets](https://algolplus.com/plugins/snippets-plugins/) for popular plugins or review [this page](https://algolplus.com/plugins/code-samples/) to study how to extend the plugin.
|
67 |
|
68 |
-
= I want to add
|
69 |
-
Check screenshot #5! You should open section "Set up fields", scroll down to field "Products", click button "Set up fields",
|
70 |
|
71 |
= I can't filter/export custom attribute for Simple Product =
|
72 |
I'm sorry, but it's impossible. You should add this attribute to Products>Attributes at first and use "Filter by Product Taxonomies".
|
@@ -81,7 +81,7 @@ Please, increase "memory_limit" upto 256M or ask hosting support to do it.
|
|
81 |
Open order, look at items and remember meta name.
|
82 |
Visit WooCommerce>Export Orders,
|
83 |
open section "Set up fields", scroll down to "Products", click button "Set up fields" ( you will see popup)
|
84 |
-
select SAME name in
|
85 |
|
86 |
= When exporting .csv containing european special characters , I want to open this csv in Excel without extra actions =
|
87 |
You should open tab "CSV" and set up ISO-8859-1 as codepage.
|
@@ -103,6 +103,21 @@ Yes, you can email a request to aprokaev@gmail.com. We intensively develop this
|
|
103 |
|
104 |
== Changelog ==
|
105 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
= 1.5.4 - 2018-04-25 =
|
107 |
* Prompting to save changes if user modifies settings
|
108 |
* Product fields and order item fields were separated in popup "Setup fields"
|
5 |
Requires PHP: 5.3.0
|
6 |
Requires at least: 4.7
|
7 |
Tested up to: 4.9
|
8 |
+
Stable tag: 1.5.5
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
65 |
|
66 |
Check [some snippets](https://algolplus.com/plugins/snippets-plugins/) for popular plugins or review [this page](https://algolplus.com/plugins/code-samples/) to study how to extend the plugin.
|
67 |
|
68 |
+
= I want to add a product attribute to the export =
|
69 |
+
Check screenshot #5! You should open section "Set up fields", scroll down to field "Products", click button "Set up fields", select field in the dropdown, type column title and press button "Add field".
|
70 |
|
71 |
= I can't filter/export custom attribute for Simple Product =
|
72 |
I'm sorry, but it's impossible. You should add this attribute to Products>Attributes at first and use "Filter by Product Taxonomies".
|
81 |
Open order, look at items and remember meta name.
|
82 |
Visit WooCommerce>Export Orders,
|
83 |
open section "Set up fields", scroll down to "Products", click button "Set up fields" ( you will see popup)
|
84 |
+
select SAME name in second dropdown
|
85 |
|
86 |
= When exporting .csv containing european special characters , I want to open this csv in Excel without extra actions =
|
87 |
You should open tab "CSV" and set up ISO-8859-1 as codepage.
|
103 |
|
104 |
== Changelog ==
|
105 |
|
106 |
+
= 1.5.5 - 2018-06-08 =
|
107 |
+
* Added filter by item name
|
108 |
+
* Added filter by item metadata
|
109 |
+
* Added operators <,>,>=,<= for order and product custom fields
|
110 |
+
* Updated filter by shipping method (adapted for WooCommerce 3.4)
|
111 |
+
* Fixed bug in filter by product taxonomies
|
112 |
+
* Allow to enter time in date range filter (after date)
|
113 |
+
* Show sections "Filter by order" and "Filter by coupon" as opened if some checkboxes are ON in these sections
|
114 |
+
* Added order field "Total Orders For Customer"
|
115 |
+
* Splited product field "Name" to "Item Name" and "Product Name" (to export current product name)
|
116 |
+
* Automatically scroll section "Setup Fields" to bottom after adding new field
|
117 |
+
* Export multiple values from same item meta
|
118 |
+
* Added new hooks for summary reports
|
119 |
+
* Prevent csv injection (we add space if cell value starts with =,+,-,@). Thank Bhushan Patil for finding this vulnerability!
|
120 |
+
|
121 |
= 1.5.4 - 2018-04-25 =
|
122 |
* Prompting to save changes if user modifies settings
|
123 |
* Product fields and order item fields were separated in popup "Setup fields"
|
view/settings-form.php
CHANGED
@@ -3,7 +3,14 @@ if ( !defined( 'ABSPATH' ) ) {
|
|
3 |
exit; // Exit if accessed directly
|
4 |
}
|
5 |
add_thickbox();
|
6 |
-
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
$settings = WC_Order_Export_Manage::get( $mode, $id );
|
8 |
$settings = apply_filters('woe_settings_page_prepare', $settings );
|
9 |
$order_custom_meta_fields = WC_Order_Export_Data_Extractor_UI::get_all_order_custom_meta_fields();
|
@@ -21,10 +28,6 @@ $readonly_php = WC_Order_Export_Admin::user_can_add_custom_php() ? '' : 'readonl
|
|
21 |
var order_products_custom_meta_fields = <?php echo json_encode( WC_Order_Export_Data_Extractor_UI::get_product_custom_fields() ) ?>;
|
22 |
var order_order_item_custom_meta_fields = <?php echo json_encode( WC_Order_Export_Data_Extractor_UI::get_product_itemmeta() ) ?>;
|
23 |
var order_coupons_custom_meta_fields = <?php echo json_encode( WC_Order_Export_Data_Extractor_UI::get_all_coupon_custom_meta_fields() ) ?>;
|
24 |
-
var flat_formats = ['XLS', 'CSV', 'TSV'];
|
25 |
-
var object_formats = ['XML', 'JSON'];
|
26 |
-
var xml_formats = ['XML'];
|
27 |
-
var day_names = <?php echo json_encode( WC_Order_Export_Manage::get_days() ) ?>;
|
28 |
var summary_mode = <?php echo $settings['summary_report_by_products'] ?>;
|
29 |
</script>
|
30 |
|
@@ -330,6 +333,10 @@ $readonly_php = WC_Order_Export_Admin::user_can_add_custom_php() ? '' : 'readonl
|
|
330 |
<option>=</option>
|
331 |
<option><></option>
|
332 |
<option>LIKE</option>
|
|
|
|
|
|
|
|
|
333 |
<option>NOT SET</option>
|
334 |
<option>IS SET</option>
|
335 |
</select>
|
@@ -432,6 +439,10 @@ $readonly_php = WC_Order_Export_Admin::user_can_add_custom_php() ? '' : 'readonl
|
|
432 |
<option>=</option>
|
433 |
<option><></option>
|
434 |
<option>LIKE</option>
|
|
|
|
|
|
|
|
|
435 |
</select>
|
436 |
|
437 |
<input type="text" id="text_product_custom_fields" disabled class="like-input" style="display: none;">
|
@@ -486,6 +497,10 @@ $readonly_php = WC_Order_Export_Admin::user_can_add_custom_php() ? '' : 'readonl
|
|
486 |
<option>=</option>
|
487 |
<option><></option>
|
488 |
<option>LIKE</option>
|
|
|
|
|
|
|
|
|
489 |
</select>
|
490 |
|
491 |
<input type="text" id="text_itemmeta" disabled class="like-input" style="display: none;">
|
@@ -632,6 +647,65 @@ $readonly_php = WC_Order_Export_Admin::user_can_add_custom_php() ? '' : 'readonl
|
|
632 |
</div>
|
633 |
</div>
|
634 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
635 |
</div>
|
636 |
|
637 |
<div class="clearfix"></div>
|
@@ -748,900 +822,4 @@ $readonly_php = WC_Order_Export_Admin::user_can_add_custom_php() ? '' : 'readonl
|
|
748 |
<input name="mode" type="hidden" value="<?php echo $mode ?>">
|
749 |
<input name="id" type="hidden" value="<?php echo $id ?>">
|
750 |
<input name="json" type="hidden">
|
751 |
-
</form>
|
752 |
-
|
753 |
-
<script>
|
754 |
-
function makeJsonVar( obj ) {
|
755 |
-
return encodeURIComponent( makeJson( obj ) ) ;
|
756 |
-
}
|
757 |
-
function makeJson( obj ) {
|
758 |
-
return JSON.stringify( obj.serializeJSON() ) ;
|
759 |
-
}
|
760 |
-
|
761 |
-
jQuery( document ).ready( function( $ ) {
|
762 |
-
|
763 |
-
$( '#d-schedule-3 .btn-add' ).click( function(e) {
|
764 |
-
var times = $( 'input[name="settings[schedule][times]"]' ).val();
|
765 |
-
var weekday = $( '#d-schedule-3 .wc_oe-select-weekday' ).val();
|
766 |
-
var time = $( '#d-schedule-3 .wc_oe-select-time' ).val();
|
767 |
-
|
768 |
-
if( times.indexOf( weekday + ' ' + time) != -1 ) {
|
769 |
-
return;
|
770 |
-
}
|
771 |
-
|
772 |
-
var data = [];
|
773 |
-
if( times != '' ) {
|
774 |
-
data = times.split( ',' ).map( function( time ) {
|
775 |
-
var arr = time.split( ' ' );
|
776 |
-
return { weekday: arr[ 0 ], time: arr[ 1 ] };
|
777 |
-
} );
|
778 |
-
}
|
779 |
-
|
780 |
-
data.push( { weekday: weekday, time: time } );
|
781 |
-
|
782 |
-
var weekdays = {
|
783 |
-
'Sun': 1,
|
784 |
-
'Mon': 2,
|
785 |
-
'Tue': 3,
|
786 |
-
'Wed': 4,
|
787 |
-
'Thu': 5,
|
788 |
-
'Fri': 6,
|
789 |
-
'Sat': 7,
|
790 |
-
};
|
791 |
-
|
792 |
-
data.sort( function( a, b ) {
|
793 |
-
if( weekdays[ a.weekday ] == weekdays[ b.weekday ] ) {
|
794 |
-
return new Date( '1970/01/01 ' + a.time ) - new Date( '1970/01/01 ' + b.time );
|
795 |
-
} else {
|
796 |
-
return weekdays[ a.weekday ] - weekdays[ b.weekday ];
|
797 |
-
}
|
798 |
-
} );
|
799 |
-
|
800 |
-
var html = data.map( function( elem ) {
|
801 |
-
var weekday = day_names[elem.weekday] ;
|
802 |
-
return '<div class="time"><span class="btn-delete">×</span>'
|
803 |
-
+ weekday + ' ' + elem.time + '</div>';
|
804 |
-
} ).join( '' );
|
805 |
-
|
806 |
-
times = data.map( function( elem ) {
|
807 |
-
return elem.weekday + ' ' + elem.time;
|
808 |
-
} ).join();
|
809 |
-
|
810 |
-
$( '#d-schedule-3 .input-times' ).html( html );
|
811 |
-
$( '#d-schedule-3 .btn-delete' ).click( shedule3_time_delete );
|
812 |
-
|
813 |
-
$( 'input[name="settings[schedule][times]"]' ).val( times );
|
814 |
-
} );
|
815 |
-
|
816 |
-
$( '#d-schedule-3 .input-times' ).ready( function() {
|
817 |
-
var times = $( 'input[name="settings[schedule][times]"]' ).val();
|
818 |
-
if( !times || times == '' ) {
|
819 |
-
return;
|
820 |
-
}
|
821 |
-
var data = times.split( ',' );
|
822 |
-
var html = data.map( function( elem ) {
|
823 |
-
var x = elem.split(' ');
|
824 |
-
var weekday = day_names[x[0]] + ' ' + x[1];
|
825 |
-
return '<div class="time"><span class="btn-delete">×</span>' + weekday + '</div>';
|
826 |
-
} ).join( '' );
|
827 |
-
$( '#d-schedule-3 .input-times' ).html( html );
|
828 |
-
$( '#d-schedule-3 .btn-delete' ).click( shedule3_time_delete );
|
829 |
-
} );
|
830 |
-
|
831 |
-
function shedule3_time_delete( e ) {
|
832 |
-
var index = $( this ).parent().index();
|
833 |
-
var data = $( 'input[name="settings[schedule][times]"]' ).val().split( ',' );
|
834 |
-
data.splice( index, 1 );
|
835 |
-
$( 'input[name="settings[schedule][times]"]' ).val( data.join() );
|
836 |
-
$( this ).parent().remove();
|
837 |
-
}
|
838 |
-
|
839 |
-
|
840 |
-
$( '#schedule-1,#schedule-2,#schedule-3' ).change( function() {
|
841 |
-
if ( $( '#schedule-1' ).is( ':checked' ) && $( '#schedule-1' ).val() == 'schedule-1' ) {
|
842 |
-
$( '#d-schedule-2 input:not(input[type=radio])' ).attr( 'disabled', true )
|
843 |
-
$( '#d-schedule-2 select' ).attr( 'disabled', true )
|
844 |
-
$( '#d-schedule-1 input:not(input[type=radio])' ).attr( 'disabled', false )
|
845 |
-
$( '#d-schedule-1 select' ).attr( 'disabled', false )
|
846 |
-
$( '#d-schedule-3 .block' ).addClass( 'disabled' );
|
847 |
-
} else if( $( '#schedule-2' ).is( ':checked' ) && $( '#schedule-2' ).val() == 'schedule-2' ) {
|
848 |
-
$( '#d-schedule-1 input:not(input[type=radio])' ).attr( 'disabled', true )
|
849 |
-
$( '#d-schedule-1 select' ).attr( 'disabled', true )
|
850 |
-
$( '#d-schedule-2 select' ).attr( 'disabled', false )
|
851 |
-
$( '#d-schedule-2 input:not(input[type=radio]) ' ).attr( 'disabled', false )
|
852 |
-
$( '#d-schedule-3 .block' ).addClass( 'disabled' );
|
853 |
-
} else if( $( '#schedule-3' ).is( ':checked' ) && $( '#schedule-3' ).val() == 'schedule-3' ) {
|
854 |
-
$( '#d-schedule-1 input:not(input[type=radio])' ).attr( 'disabled', true )
|
855 |
-
$( '#d-schedule-1 select' ).attr( 'disabled', true )
|
856 |
-
|
857 |
-
$( '#d-schedule-2 input:not(input[type=radio])' ).attr( 'disabled', true )
|
858 |
-
$( '#d-schedule-2 select' ).attr( 'disabled', true )
|
859 |
-
|
860 |
-
$( '#d-schedule-3 .block' ).removeClass( 'disabled' );
|
861 |
-
}
|
862 |
-
} );
|
863 |
-
$( '#schedule-1' ).change()
|
864 |
-
$( '.wc_oe-select-interval' ).change( function() {
|
865 |
-
var interval = $( this ).val()
|
866 |
-
if ( interval == 'custom' ) {
|
867 |
-
$( '#custom_interval' ).show()
|
868 |
-
} else {
|
869 |
-
$( '#custom_interval' ).hide()
|
870 |
-
}
|
871 |
-
} );
|
872 |
-
$( '.wc_oe-select-interval' ).change()
|
873 |
-
|
874 |
-
$( '.output_destination' ).click( function() {
|
875 |
-
var input = $( this ).find( 'input' );
|
876 |
-
var target = input.val();
|
877 |
-
$( '.set-destination:not(#' + target + ')' ).hide();
|
878 |
-
$( '.my-icon-triangle' ).removeClass( 'ui-icon-triangle-1-n' );
|
879 |
-
$( '.my-icon-triangle' ).addClass( 'ui-icon-triangle-1-s' );
|
880 |
-
if ( !jQuery( '#' + target ).is( ':hidden' ) ) {
|
881 |
-
jQuery( '#' + target ).hide();
|
882 |
-
}
|
883 |
-
else {
|
884 |
-
if ( jQuery( '#' + target ).is( ':hidden' ) ) {
|
885 |
-
jQuery( '#' + target ).show();
|
886 |
-
$( '#test_reply_div' ).hide();
|
887 |
-
$( input ).next().removeClass( 'ui-icon-triangle-1-s' );
|
888 |
-
$( input ).next().addClass( 'ui-icon-triangle-1-n' );
|
889 |
-
}
|
890 |
-
}
|
891 |
-
} );
|
892 |
-
|
893 |
-
var is_unchecked_shown = true;
|
894 |
-
$('#hide_unchecked').on('click', function(e) {
|
895 |
-
e.preventDefault();
|
896 |
-
is_unchecked_shown = !is_unchecked_shown;
|
897 |
-
$("#order_fields li input:checkbox:not(:checked)").closest('.mapping_row').toggle(is_unchecked_shown);
|
898 |
-
$('#hide_unchecked div').toggle();
|
899 |
-
});
|
900 |
-
|
901 |
-
function my_hide( item ) {
|
902 |
-
if ( $( item ).is( ':hidden' ) ) {
|
903 |
-
$( item ).show();
|
904 |
-
return false;
|
905 |
-
}
|
906 |
-
else {
|
907 |
-
$( item ).hide();
|
908 |
-
return true;
|
909 |
-
}
|
910 |
-
}
|
911 |
-
|
912 |
-
$( '.my-hide-parent' ).click( function() {
|
913 |
-
my_hide( $( this ).parent() );
|
914 |
-
} );
|
915 |
-
|
916 |
-
$( '.my-hide-next' ).click( function() {
|
917 |
-
var f = my_hide( $( this ).next() );
|
918 |
-
if ( f ) {
|
919 |
-
$( this ).find( 'span' ).removeClass( 'ui-icon-triangle-1-n' );
|
920 |
-
$( this ).find( 'span' ).addClass( 'ui-icon-triangle-1-s' );
|
921 |
-
}
|
922 |
-
else {
|
923 |
-
$( this ).find( 'span' ).removeClass( 'ui-icon-triangle-1-s' );
|
924 |
-
$( this ).find( 'span' ).addClass( 'ui-icon-triangle-1-n' );
|
925 |
-
}
|
926 |
-
return false;
|
927 |
-
} );
|
928 |
-
|
929 |
-
|
930 |
-
$( '.wc_oe_test' ).click( function() {
|
931 |
-
var test = $( this ).attr( 'data-test' );
|
932 |
-
var data = 'json=' + makeJsonVar( $( '#export_job_settings' ) )
|
933 |
-
data = data + "&action=order_exporter&method=test_destination&mode=" + mode + "&id=" + job_id + "&destination=" + test;
|
934 |
-
$( '#test_reply_div' ).hide();
|
935 |
-
$.post( ajaxurl, data, function( data ) {
|
936 |
-
$( '#test_reply' ).val( data );
|
937 |
-
$( '#test_reply_div' ).show();
|
938 |
-
} )
|
939 |
-
} )
|
940 |
-
} )
|
941 |
-
|
942 |
-
function remove_custom_field( item ) {
|
943 |
-
jQuery( item ).parent().parent().remove();
|
944 |
-
return false;
|
945 |
-
}
|
946 |
-
|
947 |
-
function create_fields( format , format_changed) {
|
948 |
-
jQuery( '#export_job_settings' ).prepend( jQuery( "#fields_control_products" ) );
|
949 |
-
jQuery( '#export_job_settings' ).prepend( jQuery( "#fields_control_coupons" ) );
|
950 |
-
jQuery( "#order_fields" ).html();
|
951 |
-
jQuery( "#modal_content" ).html( "" );
|
952 |
-
|
953 |
-
var html = '';
|
954 |
-
js_tpl_popup = "<?php _e( 'Add %s as %s columns %s as rows', 'woo-order-export-lite' ) ?>";
|
955 |
-
jQuery.each( window['order_fields'], function( index, value ) {
|
956 |
-
var checked = ( value.checked == 1 ) ? 'checked' : '';
|
957 |
-
var colname = value.colname;
|
958 |
-
|
959 |
-
colname = escapeStr(colname);
|
960 |
-
value.label = escapeStr(value.label);
|
961 |
-
index = escapeStr(index);
|
962 |
-
value.value = escapeStr(value.value);
|
963 |
-
|
964 |
-
// console.log(index);
|
965 |
-
// console.log(value);
|
966 |
-
|
967 |
-
if(format_changed) {
|
968 |
-
if( is_flat_format( format ) )
|
969 |
-
colname = value.label;
|
970 |
-
else if ( is_xml_format( format ) )
|
971 |
-
colname = to_xml_tags( index );
|
972 |
-
else
|
973 |
-
colname = index;;
|
974 |
-
}
|
975 |
-
|
976 |
-
|
977 |
-
if ( index == 'products' || index == 'coupons' ) {
|
978 |
-
var sel_rows = ( value.repeat == 'rows' ) ? 'checked' : '';
|
979 |
-
var sel_cols = ( value.repeat == 'columns' ) ? 'checked' : '';
|
980 |
-
var max_cols = ( typeof(value.max_cols) !== 'undefined' ) ? value.max_cols : "10";
|
981 |
-
var modal = '<div id="modal-manage-' + index + '" style="display:none;"><p>';
|
982 |
-
modal += create_modal_fields( format, index, format_changed);
|
983 |
-
modal += '</p></div>';
|
984 |
-
jQuery( "#modal_content" ).append( modal );
|
985 |
-
var row = '<li class="mapping_row segment_' + value.segment + '">\
|
986 |
-
<div class="mapping_col_1">\
|
987 |
-
<input type=hidden name="orders[segment][' + index + ']" value="' + value.segment + '">\
|
988 |
-
<input type=hidden name="orders[label][' + index + ']" value="' + value.label + '">\
|
989 |
-
<input type=hidden name="orders[exported][' + index + ']" value="0">\
|
990 |
-
<input type=checkbox name="orders[exported][' + index + ']" ' + checked + ' value="1">\
|
991 |
-
</div>\
|
992 |
-
<div class="mapping_col_2">' + value.label + '</div>\
|
993 |
-
<div class="mapping_col_3">';
|
994 |
-
if ( is_flat_format( format ) ) {
|
995 |
-
|
996 |
-
var popup_options = js_tpl_popup;
|
997 |
-
popup_options = popup_options.replace('%s', '<input type=radio name="orders[repeat][' + index + ']" value="columns" ' + sel_cols + ' >')
|
998 |
-
popup_options = popup_options.replace('%s', '<input type=text size=2 name="orders[max_cols][' + index + ']" value="'+max_cols+'">')
|
999 |
-
popup_options = popup_options.replace('%s', '<input type=radio name="orders[repeat][' + index + ']" value="rows" ' + sel_rows + ' >')
|
1000 |
-
row += popup_options;
|
1001 |
-
}
|
1002 |
-
row += '<input class="mapping_fieldname" type=input name="orders[colname][' + index + ']" value="' + colname + '">\
|
1003 |
-
<input type="button" class="button-primary" id="btn_modal_manage_' + index + '" value="<?php _e( 'Set up fields to export', 'woo-order-export-lite' ) ?>" /><a href="#TB_inline?width=600&height=550&inlineId=modal-manage-' + index + '" class="thickbox " id="link_modal_manage_' + index + '"> </a></div>\
|
1004 |
-
</li>\
|
1005 |
-
';
|
1006 |
-
}
|
1007 |
-
else {
|
1008 |
-
var value_part = ''
|
1009 |
-
var label_part = '';
|
1010 |
-
if ( index.indexOf( 'custom_field' ) >= 0 ) {
|
1011 |
-
value_part = '<div class="mapping_col_3"><input class="mapping_fieldname" type=input name="orders[value][' + index + ']" value="' + value.value + '"></div>';
|
1012 |
-
label_part = '<a href="#" onclick="return remove_custom_field(this);" style="float: right;"><span class="ui-icon ui-icon-trash"></span></a>';
|
1013 |
-
}
|
1014 |
-
else if ( index.charAt( 0 ) == '_' || !value.default) {
|
1015 |
-
label_part = '<a href="#" onclick="return remove_custom_field(this);" style="float: right;"><span class="ui-icon ui-icon-trash"></span></a>';
|
1016 |
-
}
|
1017 |
-
|
1018 |
-
var row = '<li class="mapping_row segment_' + value.segment + '">\
|
1019 |
-
<div class="mapping_col_1">\
|
1020 |
-
<input type=hidden name="orders[segment][' + index + ']" value="' + value.segment + '">\
|
1021 |
-
<input type=hidden name="orders[label][' + index + ']" value="' + value.label + '">\
|
1022 |
-
<input type=hidden name="orders[exported][' + index + ']" value="0">\
|
1023 |
-
<input type=checkbox name="orders[exported][' + index + ']" ' + checked + ' value="1">\
|
1024 |
-
</div>\
|
1025 |
-
<div class="mapping_col_2">' + value.label + label_part + '</div>\
|
1026 |
-
<div class="mapping_col_3"><input class="mapping_fieldname" type=input name="orders[colname][' + index + ']" value="' + colname + '"></div> ' + value_part + '\
|
1027 |
-
</li>\
|
1028 |
-
';
|
1029 |
-
}
|
1030 |
-
html += row;
|
1031 |
-
} );
|
1032 |
-
|
1033 |
-
jQuery( "#order_fields" ).html( html );
|
1034 |
-
jQuery( '#modal-manage-products' ).prepend( jQuery( "#fields_control_products" ) );
|
1035 |
-
jQuery( '#modal-manage-coupons' ).prepend( jQuery( "#fields_control_coupons" ) );
|
1036 |
-
jQuery( "#fields_control_products" ).css( 'display', 'inline-block' );
|
1037 |
-
jQuery( "#fields_control_coupons" ).css( 'display', 'inline-block' );
|
1038 |
-
add_bind_for_custom_fields( 'products', output_format, jQuery( "#sort_products" ) );
|
1039 |
-
add_bind_for_custom_fields( 'coupons', output_format, jQuery( "#sort_coupons" ) );
|
1040 |
-
|
1041 |
-
}
|
1042 |
-
|
1043 |
-
|
1044 |
-
|
1045 |
-
function create_modal_fields( format, index_p, format_changed ) {
|
1046 |
-
//console.log( 'order_' + index_p + '_fields', window['order_' + index_p + '_fields'] );
|
1047 |
-
|
1048 |
-
var modal = "<div id='sort_" + index_p + "'>";
|
1049 |
-
jQuery.each( window['order_' + index_p + '_fields'], function( index, value ) {
|
1050 |
-
var checked = ( value.checked == 1 ) ? 'checked' : '';
|
1051 |
-
var colname = value.colname;
|
1052 |
-
|
1053 |
-
// console.log(index);
|
1054 |
-
// console.log(value);
|
1055 |
-
|
1056 |
-
|
1057 |
-
colname = escapeStr(colname);
|
1058 |
-
value.label = escapeStr(value.label);
|
1059 |
-
index = escapeStr(index);
|
1060 |
-
value.value = escapeStr(value.value);
|
1061 |
-
|
1062 |
-
if(format_changed) {
|
1063 |
-
if( is_flat_format( format ) )
|
1064 |
-
colname = value.label;
|
1065 |
-
else if ( is_xml_format( format ) )
|
1066 |
-
colname = to_xml_tags( index );
|
1067 |
-
else
|
1068 |
-
colname = index;;
|
1069 |
-
}
|
1070 |
-
|
1071 |
-
var value_part = ''
|
1072 |
-
var label_part = '';
|
1073 |
-
if ( index.indexOf( 'custom_field' ) >= 0 ) {
|
1074 |
-
value_part = '<div class="mapping_col_3"><input class="mapping_fieldname" type=input name="' + index_p + '[value][' + index + ']" value="' + value.value + '"></div>';
|
1075 |
-
label_part = '<a href="#" onclick="return remove_custom_field(this);" style="float: right;"><span class="ui-icon ui-icon-trash"></span></a>';
|
1076 |
-
}
|
1077 |
-
else if ( index.charAt( 0 ) == '_' || index.substr( 0,3 ) == 'pa_' || !value.default) {
|
1078 |
-
label_part = '<a href="#" onclick="return remove_custom_field(this);" style="float: right;"><span class="ui-icon ui-icon-trash"></span></a>';
|
1079 |
-
}
|
1080 |
-
|
1081 |
-
var row = '<li class="mapping_row segment_modal_' + index + '">\
|
1082 |
-
<div class="mapping_col_1">\
|
1083 |
-
<input type=hidden name="' + index_p + '[label][' + index + ']" value="' + value.label + '">\
|
1084 |
-
<input type=hidden name="' + index_p + '[exported][' + index + ']" value="0">\
|
1085 |
-
<input type=checkbox name="' + index_p + '[exported][' + index + ']" ' + checked + ' value="1">\
|
1086 |
-
</div>\
|
1087 |
-
<div class="mapping_col_2">' + value.label + label_part + '</div>\
|
1088 |
-
<div class="mapping_col_3"><input class="mapping_fieldname" type=input name="' + index_p + '[colname][' + index + ']" value="' + colname + '"></div>' + value_part + '\
|
1089 |
-
</li>\
|
1090 |
-
';
|
1091 |
-
modal += row;
|
1092 |
-
} );
|
1093 |
-
modal += "</div>";
|
1094 |
-
return modal;
|
1095 |
-
}
|
1096 |
-
|
1097 |
-
//for XML labels
|
1098 |
-
function to_xml_tags( str ) {
|
1099 |
-
var arr = str.split( /_/ );
|
1100 |
-
for ( var i = 0, l = arr.length; i < l; i++ ) {
|
1101 |
-
arr[i] = arr[i].substr( 0, 1 ).toUpperCase() + ( arr[i].length > 1 ? arr[i].substr( 1 ).toLowerCase() : "" );
|
1102 |
-
}
|
1103 |
-
return arr.join( "_" );
|
1104 |
-
}
|
1105 |
-
|
1106 |
-
|
1107 |
-
function change_filename_ext() {
|
1108 |
-
if ( jQuery( '#export_filename' ).size() ) {
|
1109 |
-
var filename = jQuery( '#export_filename input' ).val();
|
1110 |
-
var ext = output_format.toLowerCase();
|
1111 |
-
if( ext=='xls' && !jQuery( '#format_xls_use_xls_format' ).prop('checked') ) //fix for XLSX
|
1112 |
-
ext = 'xlsx';
|
1113 |
-
|
1114 |
-
var file = filename.replace( /^(.*)\..+$/, "$1." + ext );
|
1115 |
-
if( file.indexOf(".") == -1) //no dots??
|
1116 |
-
file = file + "." + ext;
|
1117 |
-
jQuery( '#export_filename input' ).val( file );
|
1118 |
-
show_summary_report(output_format);
|
1119 |
-
}
|
1120 |
-
}
|
1121 |
-
|
1122 |
-
function show_summary_report(ext) {
|
1123 |
-
if( is_flat_format(ext) ) {
|
1124 |
-
jQuery( '#summary_report_by_products' ).show();
|
1125 |
-
} else {
|
1126 |
-
jQuery( '#summary_report_by_products' ).hide();
|
1127 |
-
jQuery( '#summary_setup_fields' ).hide();
|
1128 |
-
jQuery( '#summary_report_by_products_checkbox' ).prop('checked', false);
|
1129 |
-
}
|
1130 |
-
}
|
1131 |
-
|
1132 |
-
function modal_buttons()
|
1133 |
-
{
|
1134 |
-
jQuery('body').on('click', '#btn_modal_manage_products', function() {
|
1135 |
-
|
1136 |
-
jQuery('input[name=custom_meta_products_mode]').change();
|
1137 |
-
jQuery('#link_modal_manage_products').click();
|
1138 |
-
|
1139 |
-
return false;
|
1140 |
-
});
|
1141 |
-
|
1142 |
-
jQuery('body').on('click', '#btn_modal_manage_coupons', function() {
|
1143 |
-
|
1144 |
-
jQuery('#custom_meta_coupons_mode_all').attr('checked', 'checked');
|
1145 |
-
jQuery('#custom_meta_coupons_mode_all').change();
|
1146 |
-
jQuery('#link_modal_manage_coupons').click();
|
1147 |
-
|
1148 |
-
return false;
|
1149 |
-
});
|
1150 |
-
|
1151 |
-
}
|
1152 |
-
|
1153 |
-
jQuery( document ).ready( function( $ ) {
|
1154 |
-
|
1155 |
-
try {
|
1156 |
-
select2_inits();
|
1157 |
-
}
|
1158 |
-
catch ( err ) {
|
1159 |
-
console.log( err.message );
|
1160 |
-
jQuery( '#select2_warning' ).show();
|
1161 |
-
}
|
1162 |
-
|
1163 |
-
jQuery( "#settings_title" ).focus();
|
1164 |
-
|
1165 |
-
bind_events();
|
1166 |
-
jQuery( '#taxonomies' ).change();
|
1167 |
-
jQuery( '#attributes' ).change();
|
1168 |
-
if ( jQuery( '#itemmeta option' ).length>0 )
|
1169 |
-
jQuery( '#itemmeta' ).change();
|
1170 |
-
jQuery( '#custom_fields' ).change();
|
1171 |
-
jQuery( '#product_custom_fields' ).change();
|
1172 |
-
jQuery( '#shipping_locations' ).change();
|
1173 |
-
jQuery( '#billing_locations' ).change();
|
1174 |
-
// jQuery( '#' + output_format + '_options' ).show();
|
1175 |
-
|
1176 |
-
//jQuery('#fields').toggle(); //debug
|
1177 |
-
create_fields( output_format, false );
|
1178 |
-
$( '#test_reply_div' ).hide();
|
1179 |
-
// jQuery( '#' + output_format + '_options' ).hide();
|
1180 |
-
|
1181 |
-
jQuery( "#sort_products" ).sortable()/*.disableSelection()*/;
|
1182 |
-
jQuery( "#sort_coupons" ).sortable()/*.disableSelection()*/;
|
1183 |
-
jQuery( "#order_fields" ).sortable({ scroll: true, scrollSensitivity: 100, scrollSpeed: 100 });/*.disableSelection()*/;
|
1184 |
-
|
1185 |
-
|
1186 |
-
modal_buttons();
|
1187 |
-
|
1188 |
-
jQuery( '.date' ).datepicker( {
|
1189 |
-
dateFormat: 'yy-mm-dd'
|
1190 |
-
} );
|
1191 |
-
|
1192 |
-
jQuery( '#adjust-fields-btn' ).click( function() {
|
1193 |
-
jQuery( '#fields' ).toggle();
|
1194 |
-
jQuery( '#fields_control' ).toggle();
|
1195 |
-
return false;
|
1196 |
-
} );
|
1197 |
-
|
1198 |
-
jQuery( '.field_section' ).click( function() {
|
1199 |
-
var section = jQuery( this ).val();
|
1200 |
-
var checked = jQuery( this ).is( ':checked' );
|
1201 |
-
|
1202 |
-
jQuery( '.segment_' + section ).each( function( index ) {
|
1203 |
-
if ( checked ) {
|
1204 |
-
jQuery( this ).show();
|
1205 |
-
//jQuery(this).find('input:checkbox:first').attr('checked', true);
|
1206 |
-
}
|
1207 |
-
else {
|
1208 |
-
jQuery( this ).hide();
|
1209 |
-
jQuery( this ).find( 'input:checkbox:first' ).attr( 'checked', false );
|
1210 |
-
}
|
1211 |
-
} );
|
1212 |
-
} );
|
1213 |
-
|
1214 |
-
jQuery( '.output_format' ).click( function() {
|
1215 |
-
var new_format = jQuery( this ).val();
|
1216 |
-
jQuery( '#my-format .my-icon-triangle' ).removeClass( 'ui-icon-triangle-1-n' );
|
1217 |
-
jQuery( '#my-format .my-icon-triangle' ).addClass( 'ui-icon-triangle-1-s' );
|
1218 |
-
|
1219 |
-
if ( new_format != output_format ) {
|
1220 |
-
jQuery( this ).next().removeClass( 'ui-icon-triangle-1-s' );
|
1221 |
-
jQuery( this ).next().addClass( 'ui-icon-triangle-1-n' );
|
1222 |
-
jQuery( '#' + output_format + '_options' ).hide();
|
1223 |
-
jQuery( '#' + new_format + '_options' ).show();
|
1224 |
-
output_format = new_format;
|
1225 |
-
create_fields( output_format, true )
|
1226 |
-
jQuery( '#output_preview, #output_preview_csv' ).hide();
|
1227 |
-
// jQuery( '#fields' ).hide();
|
1228 |
-
// jQuery( '#fields_control' ).hide();
|
1229 |
-
change_filename_ext();
|
1230 |
-
}
|
1231 |
-
else {
|
1232 |
-
if ( !jQuery( '#' + new_format + '_options' ).is( ':hidden' ) ) {
|
1233 |
-
jQuery( '#' + new_format + '_options' ).hide();
|
1234 |
-
}
|
1235 |
-
else {
|
1236 |
-
if ( jQuery( '#' + new_format + '_options' ).is( ':hidden' ) ) {
|
1237 |
-
jQuery( '#' + new_format + '_options' ).show();
|
1238 |
-
jQuery( this ).next().removeClass( 'ui-icon-triangle-1-s' );
|
1239 |
-
jQuery( this ).next().addClass( 'ui-icon-triangle-1-n' );
|
1240 |
-
}
|
1241 |
-
}
|
1242 |
-
}
|
1243 |
-
|
1244 |
-
} );
|
1245 |
-
|
1246 |
-
$( '#date_format_block select' ).change( function() {
|
1247 |
-
var value = $( this ).val();
|
1248 |
-
if( value == 'custom' ) {
|
1249 |
-
$( '#custom_date_format_block' ).show();
|
1250 |
-
} else {
|
1251 |
-
$( '#custom_date_format_block' ).hide();
|
1252 |
-
$( 'input[name="settings[date_format]"]' ).val( value );
|
1253 |
-
}
|
1254 |
-
} );
|
1255 |
-
|
1256 |
-
$( '#time_format_block select' ).change( function() {
|
1257 |
-
var value = $( this ).val();
|
1258 |
-
if( value == 'custom' ) {
|
1259 |
-
$( '#custom_time_format_block' ).show();
|
1260 |
-
} else {
|
1261 |
-
$( '#custom_time_format_block' ).hide();
|
1262 |
-
$( 'input[name="settings[time_format]"]' ).val( value );
|
1263 |
-
}
|
1264 |
-
} );
|
1265 |
-
|
1266 |
-
$( 'input[type="checkbox"][name="settings[custom_php]"]' ).change( function() {
|
1267 |
-
$( 'textarea[name="settings[custom_php_code]"]' ).toggle( $( this ).is( ':checked' ) );
|
1268 |
-
} );
|
1269 |
-
|
1270 |
-
$( '#order_fields input[type=checkbox]' ).change( function() {
|
1271 |
-
if ( $( '#order_fields input[type=checkbox]:not(:checked)' ).size() ) {
|
1272 |
-
$( 'input[name=orders_all]' ).attr( 'checked', false );
|
1273 |
-
}
|
1274 |
-
else {
|
1275 |
-
$( 'input[name=orders_all]' ).attr( 'checked', true );
|
1276 |
-
}
|
1277 |
-
} );
|
1278 |
-
|
1279 |
-
$( 'input[name=orders_all]' ).change( function() {
|
1280 |
-
if ( $( 'input[name=orders_all]' ).is( ':checked' ) ) {
|
1281 |
-
$( '#order_fields input[type=checkbox]' ).attr( 'checked', true );
|
1282 |
-
}
|
1283 |
-
else {
|
1284 |
-
$( '#order_fields input[type=checkbox]' ).attr( 'checked', false );
|
1285 |
-
}
|
1286 |
-
} );
|
1287 |
-
|
1288 |
-
if ( $( '#order_fields input[type=checkbox]' ).size() ) {
|
1289 |
-
$( '#order_fields input[type=checkbox]:first' ).change();
|
1290 |
-
}
|
1291 |
-
|
1292 |
-
|
1293 |
-
|
1294 |
-
|
1295 |
-
$( ".preview-btn" ).click( function() {
|
1296 |
-
preview(jQuery(this).attr('data-limit'));
|
1297 |
-
return false;
|
1298 |
-
} );
|
1299 |
-
|
1300 |
-
$( '#progress_div .title-download' ).click( function() {
|
1301 |
-
$( '#progress_div .title-download' ).hide();
|
1302 |
-
$( '#progress_div .title-cancel' ).show();
|
1303 |
-
$( '#progressBar' ).show();
|
1304 |
-
jQuery( '#progress_div' ).hide();
|
1305 |
-
closeWaitingDialog();
|
1306 |
-
});
|
1307 |
-
|
1308 |
-
function preview(size) {
|
1309 |
-
jQuery( '#output_preview, #output_preview_csv' ).hide();
|
1310 |
-
var data = 'json=' + makeJsonVar( $( '#export_job_settings' ) );
|
1311 |
-
var estimate_data = data + "&action=order_exporter&method=estimate&mode=" + mode + "&id=" + job_id;
|
1312 |
-
$.post( ajaxurl, estimate_data, function( response ) {
|
1313 |
-
if ( response.total !== undefined ) {
|
1314 |
-
jQuery( '#output_preview_total' ).find( 'span' ).html( response.total );
|
1315 |
-
jQuery( '#preview_actions' ).removeClass( 'hide' );
|
1316 |
-
}
|
1317 |
-
}, "json"
|
1318 |
-
);
|
1319 |
-
|
1320 |
-
function showPreview( response ) {
|
1321 |
-
var id = 'output_preview';
|
1322 |
-
if ( is_flat_format( output_format ) )
|
1323 |
-
id = 'output_preview_csv';
|
1324 |
-
if ( is_object_format( output_format ) ) {
|
1325 |
-
jQuery( '#' + id ).text( response );
|
1326 |
-
}
|
1327 |
-
else {
|
1328 |
-
jQuery( '#' + id ).html( response );
|
1329 |
-
}
|
1330 |
-
jQuery( '#' + id ).show();
|
1331 |
-
window.scrollTo( 0, document.body.scrollHeight );
|
1332 |
-
}
|
1333 |
-
|
1334 |
-
data = data + "&action=order_exporter&method=preview&limit="+size+"&mode=" + mode + "&id=" + job_id;
|
1335 |
-
$.post( ajaxurl, data, showPreview, "html" ).fail( function( xhr, textStatus, errorThrown ) {
|
1336 |
-
showPreview( xhr.responseText );
|
1337 |
-
});
|
1338 |
-
}
|
1339 |
-
// EXPORT FUNCTIONS
|
1340 |
-
function get_data() {
|
1341 |
-
var data = new Array();
|
1342 |
-
data.push( { name: 'json', value: makeJson( $( '#export_job_settings' )) } );
|
1343 |
-
data.push( { name: 'action', value: 'order_exporter' } );
|
1344 |
-
data.push( { name: 'mode', value: mode } );
|
1345 |
-
data.push( { name: 'id', value: job_id } );
|
1346 |
-
return data;
|
1347 |
-
}
|
1348 |
-
|
1349 |
-
function progress( percent, $element ) {
|
1350 |
-
|
1351 |
-
if ( percent == 0 ) {
|
1352 |
-
$element.find( 'div' ).html( percent + "% " ).animate( { width: 0 }, 0 );
|
1353 |
-
waitingDialog();
|
1354 |
-
jQuery( '#progress_div' ).show();
|
1355 |
-
}
|
1356 |
-
else {
|
1357 |
-
var progressBarWidth = percent * $element.width() / 100;
|
1358 |
-
$element.find( 'div' ).html( percent + "% " ).animate( { width: progressBarWidth }, 200 );
|
1359 |
-
|
1360 |
-
if ( percent >= 100 ) {
|
1361 |
-
if(!is_iPad_or_iPhone()) {
|
1362 |
-
jQuery( '#progress_div' ).hide();
|
1363 |
-
closeWaitingDialog();
|
1364 |
-
}
|
1365 |
-
}
|
1366 |
-
}
|
1367 |
-
}
|
1368 |
-
|
1369 |
-
function get_all( start, percent, method ) {
|
1370 |
-
if (window.cancelling) {
|
1371 |
-
return;
|
1372 |
-
}
|
1373 |
-
|
1374 |
-
progress( parseInt( percent, 10 ), jQuery( '#progressBar' ) );
|
1375 |
-
|
1376 |
-
if ( percent < 100 ) {
|
1377 |
-
data = get_data();
|
1378 |
-
data.push( { name: 'method', value: method } );
|
1379 |
-
data.push( { name: 'start', value: start } );
|
1380 |
-
data.push( { name: 'file_id', value: window.file_id } );
|
1381 |
-
|
1382 |
-
jQuery.ajax( {
|
1383 |
-
type: "post",
|
1384 |
-
data: data,
|
1385 |
-
cache: false,
|
1386 |
-
url: ajaxurl,
|
1387 |
-
dataType: "json",
|
1388 |
-
error: function( xhr, status, error ) {
|
1389 |
-
alert( xhr.responseText );
|
1390 |
-
progress( 100, jQuery( '#progressBar' ) );
|
1391 |
-
},
|
1392 |
-
success: function( response ) {
|
1393 |
-
get_all( response.start, ( response.start / window.count ) * 100, method )
|
1394 |
-
}
|
1395 |
-
} );
|
1396 |
-
}
|
1397 |
-
else {
|
1398 |
-
data = get_data();
|
1399 |
-
data.push( { name: 'method', value: 'export_finish' } );
|
1400 |
-
data.push( { name: 'file_id', value: window.file_id } );
|
1401 |
-
jQuery.ajax( {
|
1402 |
-
type: "post",
|
1403 |
-
data: data,
|
1404 |
-
cache: false,
|
1405 |
-
url: ajaxurl,
|
1406 |
-
dataType: "json",
|
1407 |
-
error: function( xhr, status, error ) {
|
1408 |
-
alert( xhr.responseText );
|
1409 |
-
},
|
1410 |
-
success: function( response ) {
|
1411 |
-
var download_format = output_format;
|
1412 |
-
if( output_format=='XLS' && !jQuery( '#format_xls_use_xls_format' ).prop('checked') )
|
1413 |
-
download_format = 'XLSX';
|
1414 |
-
|
1415 |
-
if(is_iPad_or_iPhone()) {
|
1416 |
-
$( '#progress_div .title-download a' ).attr( 'href', ajaxurl + (ajaxurl.indexOf('?') === -1? '?':'&')+'action=order_exporter&method=export_download&format=' + download_format + '&file_id=' + window.file_id );
|
1417 |
-
$( '#progress_div .title-download' ).show();
|
1418 |
-
$( '#progress_div .title-cancel' ).hide();
|
1419 |
-
$( '#progressBar' ).hide();
|
1420 |
-
} else {
|
1421 |
-
$( '#export_new_window_frame' ).attr( "src", ajaxurl + (ajaxurl.indexOf('?') === -1? '?':'&')+'action=order_exporter&method=export_download&format=' + download_format + '&file_id=' + window.file_id );
|
1422 |
-
}
|
1423 |
-
|
1424 |
-
reset_date_filter_for_cron();
|
1425 |
-
}
|
1426 |
-
} );
|
1427 |
-
}
|
1428 |
-
}
|
1429 |
-
|
1430 |
-
function is_iPad_or_iPhone() {
|
1431 |
-
return navigator.platform.match(/i(Phone|Pad)/i)
|
1432 |
-
}
|
1433 |
-
|
1434 |
-
function waitingDialog() {
|
1435 |
-
jQuery( "#background" ).addClass( "loading" );
|
1436 |
-
jQuery( '#wpbody-content' ).keydown(function(event) {
|
1437 |
-
if ( event.keyCode == 27 ) {
|
1438 |
-
if (!window.cancelling) {
|
1439 |
-
event.preventDefault();
|
1440 |
-
window.cancelling = true;
|
1441 |
-
|
1442 |
-
jQuery.ajax( {
|
1443 |
-
type: "post",
|
1444 |
-
data: {
|
1445 |
-
action: 'order_exporter',
|
1446 |
-
method: 'cancel_export',
|
1447 |
-
file_id: window.file_id,
|
1448 |
-
},
|
1449 |
-
cache: false,
|
1450 |
-
url: ajaxurl,
|
1451 |
-
dataType: "json",
|
1452 |
-
error: function( xhr, status, error ) {
|
1453 |
-
alert( xhr.responseText );
|
1454 |
-
progress( 100, jQuery( '#progressBar' ) );
|
1455 |
-
},
|
1456 |
-
success: function( response ) {
|
1457 |
-
progress( 100, jQuery( '#progressBar' ) );
|
1458 |
-
}
|
1459 |
-
} );
|
1460 |
-
|
1461 |
-
window.count = 0;
|
1462 |
-
window.file_id = '';
|
1463 |
-
jQuery( '#wpbody-content' ).off('keydown');
|
1464 |
-
}
|
1465 |
-
return false;
|
1466 |
-
}
|
1467 |
-
});
|
1468 |
-
}
|
1469 |
-
function closeWaitingDialog() {
|
1470 |
-
jQuery( "#background" ).removeClass( "loading" );
|
1471 |
-
}
|
1472 |
-
|
1473 |
-
function openFilter(object_id) {
|
1474 |
-
var f = false;
|
1475 |
-
$( '#'+object_id+' ul' ).each( function( index ) {
|
1476 |
-
if ( $( this ).find( 'li:not(:first)' ).size() ) {
|
1477 |
-
f = true;
|
1478 |
-
}
|
1479 |
-
} );
|
1480 |
-
if ( f ) {
|
1481 |
-
$( '#'+object_id ).prev().click();
|
1482 |
-
}
|
1483 |
-
}
|
1484 |
-
|
1485 |
-
function validateExport() {
|
1486 |
-
if ( ( mode == '<?php echo WC_Order_Export_Manage::EXPORT_PROFILE; ?>' ) && ( !$( "[name='settings[title]']" ).val() ) ) {
|
1487 |
-
alert( export_messages.empty_title );
|
1488 |
-
$( "[name='settings[title]']" ).focus();
|
1489 |
-
return false;
|
1490 |
-
}
|
1491 |
-
|
1492 |
-
if ( ( $( "#from_date" ).val() ) && ( $( "#to_date" ).val() ) ) {
|
1493 |
-
var d1 = new Date( $( "#from_date" ).val() );
|
1494 |
-
var d2 = new Date( $( "#to_date" ).val() );
|
1495 |
-
if ( d1.getTime() > d2.getTime() ) {
|
1496 |
-
alert( export_messages.wrong_date_range );
|
1497 |
-
return false;
|
1498 |
-
}
|
1499 |
-
}
|
1500 |
-
if ( $( '#order_fields input[type=checkbox]:checked' ).size() == 0 )
|
1501 |
-
{
|
1502 |
-
alert( export_messages.no_fields );
|
1503 |
-
return false;
|
1504 |
-
}
|
1505 |
-
|
1506 |
-
return true;
|
1507 |
-
}
|
1508 |
-
// EXPORT FUNCTIONS END
|
1509 |
-
$( "#export-wo-pb-btn" ).click( function() {
|
1510 |
-
$( '#export_wo_pb_form' ).attr( "action", ajaxurl );
|
1511 |
-
$( '#export_wo_pb_form' ).find( '[name=json]' ).val( makeJson( $( '#export_job_settings' ) ) );
|
1512 |
-
$( '#export_wo_pb_form' ).submit();
|
1513 |
-
return false;
|
1514 |
-
} );
|
1515 |
-
|
1516 |
-
$( "#export-btn, #my-quick-export-btn" ).click( function() {
|
1517 |
-
window.cancelling = false;
|
1518 |
-
|
1519 |
-
data = get_data();
|
1520 |
-
|
1521 |
-
data.push( { name: 'method', value: 'export_start' } );
|
1522 |
-
if ( ( $( "#from_date" ).val() ) && ( $( "#to_date" ).val() ) ) {
|
1523 |
-
var d1 = new Date( $( "#from_date" ).val() );
|
1524 |
-
var d2 = new Date( $( "#to_date" ).val() );
|
1525 |
-
if ( d1.getTime() > d2.getTime() ) {
|
1526 |
-
alert( export_messages.wrong_date_range );
|
1527 |
-
return false;
|
1528 |
-
}
|
1529 |
-
}
|
1530 |
-
|
1531 |
-
if ( $( '#order_fields input[type=checkbox]:checked' ).size() == 0 )
|
1532 |
-
{
|
1533 |
-
alert( export_messages.no_fields );
|
1534 |
-
return false;
|
1535 |
-
}
|
1536 |
-
|
1537 |
-
|
1538 |
-
jQuery.ajax( {
|
1539 |
-
type: "post",
|
1540 |
-
data: data,
|
1541 |
-
cache: false,
|
1542 |
-
url: ajaxurl,
|
1543 |
-
dataType: "json",
|
1544 |
-
error: function( xhr, status, error ) {
|
1545 |
-
alert( xhr.responseText.replace(/<\/?[^>]+(>|$)/g, "") );
|
1546 |
-
},
|
1547 |
-
success: function( response ) {
|
1548 |
-
window.count = response['total'];
|
1549 |
-
window.file_id = response['file_id'];
|
1550 |
-
console.log( window.count );
|
1551 |
-
|
1552 |
-
if ( window.count > 0 )
|
1553 |
-
get_all( 0, 0, 'export_part' );
|
1554 |
-
else {
|
1555 |
-
alert( export_messages.no_results );
|
1556 |
-
reset_date_filter_for_cron();
|
1557 |
-
}
|
1558 |
-
}
|
1559 |
-
} );
|
1560 |
-
|
1561 |
-
return false;
|
1562 |
-
} );
|
1563 |
-
$( "#save-btn" ).click( function() {
|
1564 |
-
if (!validateExport()) {
|
1565 |
-
return false;
|
1566 |
-
}
|
1567 |
-
setFormSubmitting();
|
1568 |
-
|
1569 |
-
var data = 'json=' + makeJsonVar( $( '#export_job_settings' ) )
|
1570 |
-
data = data + "&action=order_exporter&method=save_settings&mode=" + mode + "&id=" + job_id;
|
1571 |
-
$.post( ajaxurl, data, function( response ) {
|
1572 |
-
if ( mode == '<?php echo WC_Order_Export_Manage::EXPORT_SCHEDULE; ?>' ) {
|
1573 |
-
document.location = '<?php echo admin_url( 'admin.php?page=wc-order-export&tab=schedules&save=y' ) ?>';
|
1574 |
-
} else if ( mode == '<?php echo WC_Order_Export_Manage::EXPORT_PROFILE; ?>' ) {
|
1575 |
-
document.location = '<?php echo admin_url( 'admin.php?page=wc-order-export&tab=profiles&save=y' ) ?>';
|
1576 |
-
} else if ( mode == '<?php echo WC_Order_Export_Manage::EXPORT_ORDER_ACTION; ?>' ) {
|
1577 |
-
document.location = '<?php echo admin_url( 'admin.php?page=wc-order-export&tab=order_actions&save=y' ) ?>';
|
1578 |
-
} else {
|
1579 |
-
document.location = '<?php echo admin_url( 'admin.php?page=wc-order-export&tab=export&save=y' ) ?>';
|
1580 |
-
}
|
1581 |
-
}, "json" );
|
1582 |
-
return false;
|
1583 |
-
} );
|
1584 |
-
$( "#copy-to-profiles" ).click( function() {
|
1585 |
-
if (!validateExport()) {
|
1586 |
-
return false;
|
1587 |
-
}
|
1588 |
-
|
1589 |
-
var data = 'json=' + makeJsonVar( $( '#export_job_settings' ) )
|
1590 |
-
data = data + "&action=order_exporter&method=save_settings&mode=<?php echo WC_Order_Export_Manage::EXPORT_PROFILE; ?>&id=";
|
1591 |
-
$.post( ajaxurl, data, function( response ) {
|
1592 |
-
document.location = '<?php echo admin_url( 'admin.php?page=wc-order-export&tab=profiles&wc_oe=edit_profile&profile_id=' ) ?>' + response.id;
|
1593 |
-
}, "json" );
|
1594 |
-
return false;
|
1595 |
-
} );
|
1596 |
-
|
1597 |
-
openFilter('my-order');
|
1598 |
-
|
1599 |
-
openFilter('my-products');
|
1600 |
-
|
1601 |
-
openFilter('my-shipping');
|
1602 |
-
|
1603 |
-
openFilter('my-users');
|
1604 |
-
|
1605 |
-
openFilter('my-coupons');
|
1606 |
-
|
1607 |
-
openFilter('my-billing');
|
1608 |
-
|
1609 |
-
if ( mode == '<?php echo WC_Order_Export_Manage::EXPORT_SCHEDULE; ?>' )
|
1610 |
-
setup_alert_date_filter();
|
1611 |
-
//for XLSX
|
1612 |
-
$('#format_xls_use_xls_format').click(function() {
|
1613 |
-
change_filename_ext();
|
1614 |
-
});
|
1615 |
-
|
1616 |
-
show_summary_report( output_format );
|
1617 |
-
if( !summary_mode )
|
1618 |
-
jQuery('#summary_setup_fields').hide();
|
1619 |
-
//logic for setup link
|
1620 |
-
jQuery( "#summary_report_by_products_checkbox" ).change( function() {
|
1621 |
-
if( jQuery(this).prop('checked') )
|
1622 |
-
jQuery('#summary_setup_fields').show();
|
1623 |
-
else
|
1624 |
-
jQuery('#summary_setup_fields').hide();
|
1625 |
-
});
|
1626 |
-
|
1627 |
-
// this line must be last , we don't have any errors
|
1628 |
-
jQuery('#JS_error_onload').hide();
|
1629 |
-
} );
|
1630 |
-
|
1631 |
-
function is_flat_format(format) {
|
1632 |
-
return (flat_formats.indexOf(format) > -1);
|
1633 |
-
}
|
1634 |
-
function is_object_format(format) {
|
1635 |
-
return (object_formats.indexOf(format) > -1);
|
1636 |
-
}
|
1637 |
-
function is_xml_format(format) {
|
1638 |
-
return (xml_formats.indexOf(format) > -1);
|
1639 |
-
}
|
1640 |
-
function reset_date_filter_for_cron() {
|
1641 |
-
if(mode == 'cron') {
|
1642 |
-
jQuery( "#from_date" ).val("");
|
1643 |
-
jQuery( "#to_date" ).val("");
|
1644 |
-
try_color_date_filter();
|
1645 |
-
}
|
1646 |
-
}
|
1647 |
-
</script>
|
3 |
exit; // Exit if accessed directly
|
4 |
}
|
5 |
add_thickbox();
|
6 |
+
/**
|
7 |
+
* @var WC_Order_Export_Admin $WC_Order_Export WC_Order_Export_Admin instance
|
8 |
+
* @var string $mode ( now | profiles | cron | order-action )
|
9 |
+
* @var integer $id job id
|
10 |
+
* @var string $ajaxurl
|
11 |
+
* @var array $show
|
12 |
+
*
|
13 |
+
*/
|
14 |
$settings = WC_Order_Export_Manage::get( $mode, $id );
|
15 |
$settings = apply_filters('woe_settings_page_prepare', $settings );
|
16 |
$order_custom_meta_fields = WC_Order_Export_Data_Extractor_UI::get_all_order_custom_meta_fields();
|
28 |
var order_products_custom_meta_fields = <?php echo json_encode( WC_Order_Export_Data_Extractor_UI::get_product_custom_fields() ) ?>;
|
29 |
var order_order_item_custom_meta_fields = <?php echo json_encode( WC_Order_Export_Data_Extractor_UI::get_product_itemmeta() ) ?>;
|
30 |
var order_coupons_custom_meta_fields = <?php echo json_encode( WC_Order_Export_Data_Extractor_UI::get_all_coupon_custom_meta_fields() ) ?>;
|
|
|
|
|
|
|
|
|
31 |
var summary_mode = <?php echo $settings['summary_report_by_products'] ?>;
|
32 |
</script>
|
33 |
|
333 |
<option>=</option>
|
334 |
<option><></option>
|
335 |
<option>LIKE</option>
|
336 |
+
<option>></option>
|
337 |
+
<option>>=</option>
|
338 |
+
<option><</option>
|
339 |
+
<option><=</option>
|
340 |
<option>NOT SET</option>
|
341 |
<option>IS SET</option>
|
342 |
</select>
|
439 |
<option>=</option>
|
440 |
<option><></option>
|
441 |
<option>LIKE</option>
|
442 |
+
<option>></option>
|
443 |
+
<option>>=</option>
|
444 |
+
<option><</option>
|
445 |
+
<option><=</option>
|
446 |
</select>
|
447 |
|
448 |
<input type="text" id="text_product_custom_fields" disabled class="like-input" style="display: none;">
|
497 |
<option>=</option>
|
498 |
<option><></option>
|
499 |
<option>LIKE</option>
|
500 |
+
<option>></option>
|
501 |
+
<option>>=</option>
|
502 |
+
<option><</option>
|
503 |
+
<option><=</option>
|
504 |
</select>
|
505 |
|
506 |
<input type="text" id="text_itemmeta" disabled class="like-input" style="display: none;">
|
647 |
</div>
|
648 |
</div>
|
649 |
|
650 |
+
<br>
|
651 |
+
|
652 |
+
<div class="my-block">
|
653 |
+
<span class="my-hide-next "><?php _e( 'Filter by item and metadata', 'woo-order-export-lite' ) ?>
|
654 |
+
<span class="ui-icon ui-icon-triangle-1-s my-icon-triangle"></span></span>
|
655 |
+
<div id="my-items-meta" hidden="hidden">
|
656 |
+
<span class="wc-oe-header"><?php _e( 'Item names', 'woo-order-export-lite' ) ?></span>
|
657 |
+
<br>
|
658 |
+
<select id="item_names">
|
659 |
+
<option>coupon</option>
|
660 |
+
<option>fee</option>
|
661 |
+
<option>line_item</option>
|
662 |
+
<option>shipping</option>
|
663 |
+
<option>tax</option>
|
664 |
+
</select>
|
665 |
+
<select id="item_name_compare" class="select_compare">
|
666 |
+
<option>=</option>
|
667 |
+
<option><></option>
|
668 |
+
</select>
|
669 |
+
<button id="add_item_names" class="button-secondary"><span class="dashicons dashicons-plus-alt"></span></button>
|
670 |
+
<br>
|
671 |
+
<select id="item_names_check" multiple name="settings[item_names][]" style="width: 100%; max-width: 25%;">
|
672 |
+
<?php
|
673 |
+
if ( $settings[ 'item_names' ] )
|
674 |
+
foreach ( $settings[ 'item_names' ] as $name ) {
|
675 |
+
?>
|
676 |
+
<option selected value="<?php echo $name; ?>"> <?php echo $name; ?></option>
|
677 |
+
<?php } ?>
|
678 |
+
</select>
|
679 |
+
|
680 |
+
<span class="wc-oe-header"><?php _e( 'Item metadata', 'woo-order-export-lite' ) ?></span>
|
681 |
+
<br>
|
682 |
+
<select id="item_metadata">
|
683 |
+
<?php foreach ( WC_Order_Export_Data_Extractor_UI::get_item_meta_keys() as $type=>$meta_keys ) { ?>
|
684 |
+
<optgroup label="<?php echo ucwords($type); ?>">
|
685 |
+
<?php foreach ( $meta_keys as $item_meta_key ) { ?>
|
686 |
+
<option value="<?php echo $type.":".$item_meta_key; ?>" ><?php echo $item_meta_key; ?></option>
|
687 |
+
<?php } ?>
|
688 |
+
</optgroup>
|
689 |
+
<?php } ?>
|
690 |
+
</select>
|
691 |
+
<select id="item_metadata_compare" class="select_compare">
|
692 |
+
<option>=</option>
|
693 |
+
<option><></option>
|
694 |
+
</select>
|
695 |
+
<button id="add_item_metadata" class="button-secondary"><span class="dashicons dashicons-plus-alt"></span></button>
|
696 |
+
<br>
|
697 |
+
<select id="item_metadata_check" multiple name="settings[item_metadata][]" style="width: 100%; max-width: 25%;">
|
698 |
+
<?php
|
699 |
+
if ( $settings[ 'item_metadata' ] )
|
700 |
+
foreach ( $settings[ 'item_metadata' ] as $meta) {
|
701 |
+
?>
|
702 |
+
<option selected value="<?php echo $meta; ?>"> <?php echo $meta; ?></option>
|
703 |
+
<?php } ?>
|
704 |
+
</select>
|
705 |
+
|
706 |
+
</div>
|
707 |
+
</div>
|
708 |
+
|
709 |
</div>
|
710 |
|
711 |
<div class="clearfix"></div>
|
822 |
<input name="mode" type="hidden" value="<?php echo $mode ?>">
|
823 |
<input name="id" type="hidden" value="<?php echo $id ?>">
|
824 |
<input name="json" type="hidden">
|
825 |
+
</form>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
view/tab/tools.php
CHANGED
@@ -83,7 +83,7 @@ $type_labels = !$WC_Order_Export::is_full_version() ? array() : array(
|
|
83 |
jQuery( this ).select();
|
84 |
} );
|
85 |
|
86 |
-
jQuery( '#tools-import-text' ).on( '
|
87 |
var $textarea = jQuery( this ).val();
|
88 |
var disable = ( $textarea.length == '' );
|
89 |
$( "#submit-import" ).prop( "disabled", disable );
|
83 |
jQuery( this ).select();
|
84 |
} );
|
85 |
|
86 |
+
jQuery( '#tools-import-text' ).on( 'input propertychange', function () {
|
87 |
var $textarea = jQuery( this ).val();
|
88 |
var disable = ( $textarea.length == '' );
|
89 |
$( "#submit-import" ).prop( "disabled", disable );
|
woo-order-export-lite.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* Description: Export orders from WooCommerce with ease (Excel/CSV/XML/JSON supported)
|
6 |
* Author: AlgolPlus
|
7 |
* Author URI: https://algolplus.com/
|
8 |
-
* Version: 1.5.
|
9 |
* Text Domain: woo-order-export-lite
|
10 |
* Domain Path: /i18n/languages/
|
11 |
* WC requires at least: 2.6.0
|
@@ -73,7 +73,7 @@ include 'classes/core/class-wc-order-export-engine.php';
|
|
73 |
include 'classes/core/class-wc-order-export-data-extractor.php';
|
74 |
include 'classes/core/class-wc-order-export-data-extractor-ui.php';
|
75 |
|
76 |
-
define( 'WOE_VERSION', '1.5.
|
77 |
define( 'WOE_PLUGIN_BASENAME', plugin_basename(__FILE__) );
|
78 |
define( 'WOE_PLUGIN_BASEPATH', dirname(__FILE__) );
|
79 |
$wc_order_export = new WC_Order_Export_Admin();
|
5 |
* Description: Export orders from WooCommerce with ease (Excel/CSV/XML/JSON supported)
|
6 |
* Author: AlgolPlus
|
7 |
* Author URI: https://algolplus.com/
|
8 |
+
* Version: 1.5.5
|
9 |
* Text Domain: woo-order-export-lite
|
10 |
* Domain Path: /i18n/languages/
|
11 |
* WC requires at least: 2.6.0
|
73 |
include 'classes/core/class-wc-order-export-data-extractor.php';
|
74 |
include 'classes/core/class-wc-order-export-data-extractor-ui.php';
|
75 |
|
76 |
+
define( 'WOE_VERSION', '1.5.5' );
|
77 |
define( 'WOE_PLUGIN_BASENAME', plugin_basename(__FILE__) );
|
78 |
define( 'WOE_PLUGIN_BASEPATH', dirname(__FILE__) );
|
79 |
$wc_order_export = new WC_Order_Export_Admin();
|