Created
September 29, 2014 09:10
-
-
Save woogist/c3c13c03a1fdc4b9c823 to your computer and use it in GitHub Desktop.
WooCommerce - add extra checkout fields to WooCommerce emails
This file contains hidden or 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 | |
/** | |
* Add the field to order emails | |
**/ | |
add_filter('woocommerce_email_order_meta_keys', 'my_custom_checkout_field_order_meta_keys'); | |
function my_custom_checkout_field_order_meta_keys( $keys ) { | |
$keys[] = 'My Field 1'; | |
$keys[] = 'My Field 2'; | |
return $keys; | |
} |
Hello everybody ! I found this post on Github https://gist.github.com/ChromeOrange/3905785 and it solved my problem: my custom fields are now displaying in the email. I just needed to leave the key empty: $keys[]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It is so good to know I'm not the only one who cannot get this to work. I've been thinking I'm going nuts for the last hour.