Merge pull request #13047 from thenbrent/backward_compat_for_email_order_items
Reinstate old show/hide logic for download links and purchase notes in email order item table
This commit is contained in:
commit
497b4d986c
|
@ -2367,17 +2367,17 @@ if ( ! function_exists( 'wc_get_email_order_items' ) ) {
|
||||||
$args = wp_parse_args( $args, $defaults );
|
$args = wp_parse_args( $args, $defaults );
|
||||||
$template = $args['plain_text'] ? 'emails/plain/email-order-items.php' : 'emails/email-order-items.php';
|
$template = $args['plain_text'] ? 'emails/plain/email-order-items.php' : 'emails/email-order-items.php';
|
||||||
|
|
||||||
wc_get_template( $template, array(
|
wc_get_template( $template, apply_filters( 'woocommerce_email_order_items_args', array(
|
||||||
'order' => $order,
|
'order' => $order,
|
||||||
'items' => $order->get_items(),
|
'items' => $order->get_items(),
|
||||||
'show_download_links' => $order->is_download_permitted(),
|
'show_download_links' => $order->is_download_permitted() && ! $args['sent_to_admin'],
|
||||||
'show_sku' => $args['show_sku'],
|
'show_sku' => $args['show_sku'],
|
||||||
'show_purchase_note' => $order->is_paid(),
|
'show_purchase_note' => $order->is_paid() && ! $args['sent_to_admin'],
|
||||||
'show_image' => $args['show_image'],
|
'show_image' => $args['show_image'],
|
||||||
'image_size' => $args['image_size'],
|
'image_size' => $args['image_size'],
|
||||||
'plain_text' => $args['plain_text'],
|
'plain_text' => $args['plain_text'],
|
||||||
'sent_to_admin' => $args['sent_to_admin'],
|
'sent_to_admin' => $args['sent_to_admin'],
|
||||||
) );
|
) ) );
|
||||||
|
|
||||||
return apply_filters( 'woocommerce_email_order_items_table', ob_get_clean(), $order );
|
return apply_filters( 'woocommerce_email_order_items_table', ob_get_clean(), $order );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue