As far as I know, it still works. The method used is independent of changes to WooCommerce, since the query needed to get this info doesn’t really use standard WP_Query.
The CSV export uses the “DataTables” plugin for jQuery https://datatables.net/
I’ll check to see if specifying the export type as UTF-8 has any negative repercussions. In the meantime, if you’re comfortable making this change yourself (to see if it resolves for you) – then you could go into /list-backorders-for-woocommerce/js/wc-list-backorders.js on line 26 update to this:
{
extend: 'csv',
title: dd_backorders.report_title,
charset: 'UTF-8',
},
Just checked with updated code but not work, some char still not showing correct and same as on exported Excel file.
Many thanks
I’ll take a look over the next few days and see if I can figure out something else.
Hi @chris-yau – to be honest, I forgot about this.
I’ve updated the plugin and added a filterable Charset for the report.
You can use the following code in your theme or child theme’s functions.php to alter it.
add_filter(
'dd_list_backorders_report_charset',
function() {
return 'your-charset-here';
}
);
Hi @thehowarde,
I have updated to latest ver 2.3 and added above code snippets but still cannot fix my problem.
I have products with ® (Copyright sign in html) in product title, however when export to PDF and Excel have no problem, the Copyright sign show in the files correctly but only the cvs export cannot show the “Copyright” sign correctly.
When I open the cvs in notepad the “Copyright” sign shows correctly but when the csv open in Excel application, the Copygith sign becomes “簧”. I think this is the Excel issue may be caused by your plugin.
Thanks
Hi @chris-yau – As stated before, the CSV Export from the datatables is using the jQuery Datatables and I’ve not only updated the default content type to UTF-8, but I’ve also made the content type filterable. It seems to me that since what you’re trying to do works with XLS or PDF, then you could use the XLS export, since you’re opening in Excel anyway?
I open the csv files using Excel directly by double click.
I found that if I use text editor to open the downloaded csv report, the copyright sign show correctly but only has issue when open it directly in Excel.
I am now solve by using import data from text files feature in Excel to solve.
Thanks