WooCommerce ( Newer Versions) :
1 2 3 4 5 |
function lxt_send_purchase_note_to_everyone( $args ) { $args['show_purchase_note'] = true; return $args; } add_filter ('woocommerce_email_order_items_args', 'lxt_send_purchase_note_to_everyone'); |
Older Version WooCommerce
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
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 ); |
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 ) :
?>