From a48639b7bc0bdf1ba545d3703bdc649cdcb9f285 Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Tue, 8 Jan 2019 13:57:25 -0200 Subject: [PATCH 1/2] Fix PHPCS violations automatilly with PHPCBF --- templates/emails/email-order-items.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/templates/emails/email-order-items.php b/templates/emails/email-order-items.php index 66f64fdb673..5c168bbbd0a 100644 --- a/templates/emails/email-order-items.php +++ b/templates/emails/email-order-items.php @@ -56,9 +56,12 @@ foreach ( $items as $item_id => $item ) : // allow other plugins to add additional product information here. do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, $plain_text ); - wc_display_item_meta( $item, array( - 'label_before' => '', - ) ); + wc_display_item_meta( + $item, + array( + 'label_before' => '', + ) + ); // allow other plugins to add additional product information here. do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, $plain_text ); From d71cb562aa58e3e7ed292983fff02aae9719a7fa Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Tue, 8 Jan 2019 14:17:55 -0200 Subject: [PATCH 2/2] Properly align order item meta in RTL emails Since commit https://github.com/woocommerce/woocommerce/commit/4082222f7a88ecd6879f7732cee510575ec89849#diff-30dd34631dd7461f75c05ded270e9ee4R60, order item meta is not aligned properly in order e-mails when using a RTL language. This commit fixes this problem by using the is_rtl() function to determine the float side for the element that contains the order item meta information. --- templates/emails/email-order-items.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/templates/emails/email-order-items.php b/templates/emails/email-order-items.php index 5c168bbbd0a..0ae64791c5e 100644 --- a/templates/emails/email-order-items.php +++ b/templates/emails/email-order-items.php @@ -17,7 +17,8 @@ defined( 'ABSPATH' ) || exit; -$text_align = is_rtl() ? 'right' : 'left'; +$text_align = is_rtl() ? 'right' : 'left'; +$margin_side = is_rtl() ? 'left' : 'right'; foreach ( $items as $item_id => $item ) : $product = $item->get_product(); @@ -59,7 +60,7 @@ foreach ( $items as $item_id => $item ) : wc_display_item_meta( $item, array( - 'label_before' => '', + 'label_before' => '', ) );