Last active
December 23, 2015 00:29
-
-
Save maxrice/6553930 to your computer and use it in GitHub Desktop.
Add custom fields to XML for the WooCommerce Customer/Order XML Export Suite
This file contains 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 | |
function add_custom_fields_to_xml( $order_data, $order ) { | |
$order_data['BillingCompanyID'] = ( isset( $order->order_custom_fields['billing_company_id'][0] ) ) ? $order->order_custom_fields['billing_company_id'][0] : ''; | |
$order_data['BillingCompanyVAT'] = ( isset( $order->order_custom_fields['billing_company_vat'][0] ) ) ? $order->order_custom_fields['billing_company_vat'][0] : ''; | |
return $order_data; | |
} | |
add_filter( 'wc_customer_order_xml_export_suite_order_export_order_list_format', 'add_custom_fields_to_xml', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment