• Resolved hpalma

    (@hpalma)


    Hi,
    i’m looking for a way to include some information regarding the order in the email header and footer. The problem is that the $order instance doesn’t seem to be available in the email-header.php and email-footer.php templates.

    Any ideas ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • I don’t think $order is in these templates, but you can insert stuff after the heading and before the content with something like this:

    add_action( 'woocommerce_email_header', 'custom_email_header', 20, 2 );
    function custom_email_header( $email_heading, $email ) {
      $order = $email->object;
      print 'Order No. '.$order->get_order_number( ); // example extra info
    }

    ‘woocommerce_email_footer’ passes $email as the only parameter.

    These snippets would go in functions.php, not the templates.

    Thread Starter hpalma

    (@hpalma)

    Awesome. Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Access to order from email header and footer templates’ is closed to new replies.