• Resolved sidneyquitorio8

    (@sidneyquitorio8)


    Hi,

    Is there anyway to have the tracking number added to the order confirmation email? I want to print a USPS label w/ signature confirmation, then have the tracking number automatically added to the confirmation email when it goes out.

Viewing 1 replies (of 1 total)
  • Plugin Author WebToffee

    (@webtoffee)

    Hi @sidneyquitorio8,

    Please try below code snippet after modifying the meta key value according to your tracking meta and copy to your active theme’s functions.php to include tracking meta in order confirmation in email.

    add_filter('woocommerce_email_order_meta_fields', 'webtoffee_checkout_field_order_meta_fields', 10, 3 );
    function webtoffee_checkout_field_order_meta_fields( $fields, $sent_to_admin, $order ) {
       $fields['tracking_number'] = array(
                   'label' => __( 'Tracking Number' ),
                   'value' => get_post_meta( $order->id, 'my_tracking_meta_key', true ),
               );
       return $fields;
    }

    Moreover you can use the premium version of this plugin to add tracking number meta to invoices and attach the PDF invoice with order email.

Viewing 1 replies (of 1 total)
  • The topic ‘Tracking number in Order Completion email’ is closed to new replies.