Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save maxrice/ac2abdfe569b93a17034 to your computer and use it in GitHub Desktop.
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
<?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' );
@clement-menard
Copy link

Hi, thanks for tips !
Just a question : i don't want to change CSV enclosure, but remove it... How to do that ?

@Garconis
Copy link

Garconis commented Aug 9, 2016

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