wc_get_email_order_items()
Get HTML for the order items to be shown in emails.
Возвращает
Строку.
Использование
wc_get_email_order_items( $order, $args );
- $order(WC_Order) (обязательный)
- Order object.
- $args(массив)
- Arguments.
По умолчанию:array()
Список изменений
| С версии 3.0.0 | Введена. |
Код wc_get_email_order_items() wc get email order items WC 10.5.2
function wc_get_email_order_items( $order, $args = array() ) {
ob_start();
$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );
$image_size = $email_improvements_enabled ? 48 : 32;
$defaults = array(
'show_sku' => false,
'show_image' => $email_improvements_enabled,
'image_size' => array( $image_size, $image_size ),
'plain_text' => false,
'sent_to_admin' => false,
);
$args = wp_parse_args( $args, $defaults );
$template = $args['plain_text'] ? 'emails/plain/email-order-items.php' : 'emails/email-order-items.php';
wc_get_template(
$template,
apply_filters(
'woocommerce_email_order_items_args',
array(
'order' => $order,
'items' => $order->get_items(),
'show_download_links' => $order->is_download_permitted() && ! $args['sent_to_admin'],
'show_sku' => $args['show_sku'],
'show_purchase_note' => $order->is_paid() && ! $args['sent_to_admin'],
'show_image' => $args['show_image'],
'image_size' => $args['image_size'],
'plain_text' => $args['plain_text'],
'sent_to_admin' => $args['sent_to_admin'],
)
)
);
return apply_filters( 'woocommerce_email_order_items_table', ob_get_clean(), $order );
}