Getting custom fields from WooCommerce Custom Checkout Options plugin on invoice
-
HI guys, I’m trying to get all of the customer order details onto your fantastic plugin’s order notes and invoices.
I have a few custom fields on the checkout setup using Terry Tsang’s Woocommerce Custom Checkout Options plugin and have tried using the follwing method to call the fields without success (I’m still learning how to use functions!)
1) Opened this file
wp-content/plugins/woocommerce-delivery-notes/woocommerce-delivery-notes.php2) updated this section:
/**
* Get order custom field
*/
if ( !function_exists( ‘wcdn_get_order_custom_field’ ) ) {
function wcdn_get_order_custom_field( $field ) {
global $wcdn;
return $wcdn->print->get_order()->order_custom_fields[‘Leave Safe Spot’][0];
}
}3) to:
/**
* Get order custom field
*/
if ( !function_exists( ‘wcdn_get_order_custom_field’ ) ) {
function wcdn_get_order_custom_field( $field ) {
global $wcdn;
echo wcdn_get_order_custom_field(‘custom_save_order_fields’);
echo wcdn_get_order_custom_field(‘newfield2’);
echo wcdn_get_order_custom_field(‘newfield3’);
}
}4) as these seem to be the fields I want to call into the invoice/delivery note. However it’s not working!
custom_save_order_fields
newfield2
newfield3Any ideas how I can get this working?
https://www.ads-software.com/plugins/woocommerce-delivery-notes/
- The topic ‘Getting custom fields from WooCommerce Custom Checkout Options plugin on invoice’ is closed to new replies.