Skip to content

Instantly share code, notes, and snippets.

@woogist
Created September 29, 2014 09:10
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save woogist/c3c13c03a1fdc4b9c823 to your computer and use it in GitHub Desktop.
Save woogist/c3c13c03a1fdc4b9c823 to your computer and use it in GitHub Desktop.
WooCommerce - add extra checkout fields to WooCommerce emails
<?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;
}
@elkano91
Copy link

elkano91 commented Jun 20, 2016

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