For exporting additional metadata for the orders using Order Export Import Plugin for WooCommerce below code snippet can be used in the child theme’s functions.php
Please refer this updated article if you have Order Export Import Plugin version greater than 1.1.0. Below article is only relevant for prior versions.
In this example, we are adding 3 extra fields shown below with export CSV as shown in the code snippet.
‘pdf_invoice_num’ => ‘_invoice_number_display’,
‘Payer PayPal address’ => ‘Payer PayPal address’,
‘PayPal Transaction Fee’ => ‘PayPal Transaction Fee’
Comments (3)
chris
April 16, 2018
Thank you. That really helped.
Is it possible to get one that on Orders it adds the related subscription_id and additional meta?
Had a go but getting stuck
$subscriptions_ids = wcs_get_subscriptions_for_order( $order->id );
if($subscriptions_ids){
// We get the related subscription for this order
foreach( $subscriptions_ids as $subscription_id => $subscription_obj ){
if($subscription_obj){
$subscription = array(
}
}
chris
April 2, 2018
What is the snippet for doing this on subscriptions?
Mark
April 3, 2018
Hi,
Here is the snippet to export custom field/metadata with subscription orders.
https://www.xadapter.com/alter-subscription-export-csv-xadapter-ordercouponsubscription-import-export-plugin-woocommerce/