/**

* 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 );

1 Comment. 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

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.

Menu