A php script that exports Woocommerce order data into a CSV file
This php code extracts with a query to the wordpress database all the information of the Woocommerce orders, exporting them into a CSV file. You can refer to this code as an example or template and edit as you like it, adding your own fields of intrest. The code outputs all the orders when loaded in .../WOOSQLtoCSV.php and makes the file.csv into the home directory of the server.
In the first line of the CSV file you can see a reference of all the fields, change it if needed.