/**
* Only copy the opening php tag if needed
* Edits the email order items table to enable purchase notes
*/
function sww_add_wc_order_email_purchase_notes( $table, $order ) {
ob_start();
$template = $plain_text ? 'emails/plain/email-order-items.php' : 'emails/email-order-items.php';
wc_get_template( $template, array(
'order' => $order,
'items' => $order->get_items(),
'show_download_links' => $show_download_links,
'show_sku' => $show_sku,
'show_purchase_note' => true,
'show_image' => $show_image,
'image_size' => $image_size
) );
return ob_get_clean();
}
add_filter( 'woocommerce_email_order_items_table', 'sww_add_wc_order_email_purchase_notes', 10, 2 );
Recent Posts
Recent Comments
- Christy on Support Purchase Notes in Order Emails WooCommerce
- LogixTree Networks on Localhost showing “Index/of” instead of displaying the Website
- Sofia on Localhost showing “Index/of” instead of displaying the Website
- Sofia on Localhost showing “Index/of” instead of displaying the Website
- Rozaunuck on WordPress Website for Home in 24 Hours
2 Comments. Leave new
Seems to work thanks but causes some errors in my PHP log. Any ideas?
[Mar 21, 12:25:53] PHP Notice: Undefined variable: image_size in /wp-content/themes/jupiter-child/functions.php on line 106
[Mar 21, 12:25:53] PHP Notice: Undefined variable: show_image in /wp-content/themes/jupiter-child/functions.php on line 105
[Mar 21, 12:25:53] PHP Notice: Undefined variable: show_sku in /wp-content/themes/jupiter-child/functions.php on line 103
[Mar 21, 12:25:53] PHP Notice: Undefined variable: show_download_links in /wp-content/themes/jupiter-child/functions.php on line 102
[Mar 21, 12:25:53] PHP Notice: Undefined variable: plain_text in /wp-content/themes/jupiter-child/functions.php on line 98
I used this method for awhile, but now it doesn’t work (after years of updates, etc.). This does, though, as of 12/30/20. Code should be placed appropriately in customer-booking-reminder.php (where you want it to appear) within your theme.
get_product()->get_id(), ‘_purchase_note’, true);
if ( $purchase_note NULL ) :
?>