Skip to content

Instantly share code, notes, and snippets.

@nikola0203
Last active March 6, 2018 11:45
Show Gist options
  • Save nikola0203/7b787465f638721c49d0c74b8eb965d0 to your computer and use it in GitHub Desktop.
Save nikola0203/7b787465f638721c49d0c74b8eb965d0 to your computer and use it in GitHub Desktop.
WooCommerce Customer/Order XML Export Suite - change root element of XML document.
// Change first letter of XML tag <Orders> to lowercase.
function custom_xml_root_element( $export_type ) {
return lcfirst( $export_type );
}
add_filter( 'wc_customer_order_xml_export_suite_xml_root_element', 'custom_xml_root_element', 10, 1 );
// Change <Order> tage name.
function custom_order_format_tag_name( $orders_format, $orders ) {
$orders_format = array(
'order' => $orders,
);
return $orders_format;
}
add_filter( 'wc_customer_order_xml_export_suite_orders_xml_data', 'custom_order_format_tag_name', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment