Created
August 19, 2013 11:06
-
-
Save woogist/6267983 to your computer and use it in GitHub Desktop.
WooCommerce - Display checkout custom field on the order edition page
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
/** | |
* Display field value on the order edition page | |
**/ | |
add_action( 'woocommerce_admin_order_data_after_billing_address', 'my_custom_checkout_field_display_admin_order_meta', 10, 1 ); | |
function my_custom_checkout_field_display_admin_order_meta($order){ | |
echo '<p><strong>'.__('My Field').':</strong> ' . $order->order_custom_fields['My Field'][0] . '</p>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For WooCommerce 2.1, correct code for
now becomes
Cheers,
Gabriel