WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Adding Multiple Custom Fields to email Template (2 posts)

  1. blieben
    Member
    Posted 1 year ago #

    I've added custom fields to the checkout by I cant seem to get the fields to carry over. I can get one to send, but how do i get three to send with emails. I tried to repeat the function, but not luck. Thanks for the help!

    Code for Email:

    /**
    * 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';
    return $keys;
    }

    http://wordpress.org/extend/plugins/woocommerce/

  2. Remi Corson
    Member
    Posted 1 year ago #

    hi,

    simply use
    /**
    * 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 1st Field';
    $keys[] = 'My 2nd Field';
    $keys[] = 'My last Field';
    return $keys;
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.