Last active
August 9, 2016 20:59
-
-
Save maxrice/ac2abdfe569b93a17034 to your computer and use it in GitHub Desktop.
WooCommerce Customer/Order CSV Export - Modify the CSV delimiter, enclosure and BOM character
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// change CSV delimiter to a semi-colon (;) | |
function wc_csv_export_modify_delimiter() { | |
return ';'; | |
} | |
add_filter( 'wc_customer_order_csv_export_delimiter', 'wc_csv_export_modify_delimiter' ); | |
// change CSV enclosure to a pipe (|) | |
function wc_csv_export_modify_enclosure() { | |
return '|'; | |
} | |
add_filter( 'wc_customer_order_csv_export_enclosure', 'wc_csv_export_modify_enclosure' ); | |
// enable the BOM (byte-order mark) for all CSVs | |
add_filter( 'wc_customer_order_csv_export_enable_bom', '__return_true' ); |
Any ideas on how to make it a tab delimited TXT file?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, thanks for tips !
Just a question : i don't want to change CSV enclosure, but remove it... How to do that ?