Get the order object in Woocommerce email-header template
To access the $order object in your WooCommerce email-header template, follow these steps: 1. Add the following code to your theme’s ‘functions.php’ file: add_action(‘woocommerce_email_header’, ’email_header_before’, 1, 2); function email_header_before($email_heading, $email) { $GLOBALS[’email’] = $email; } This action hook ensures that the global $email variable is available in your template. 2. In your ’emails/email-header.php’ …
Get the order object in Woocommerce email-header template Read More »