Merge pull request #22376 from woocommerce/fix/22296

Properly align order item meta in RTL emails
This commit is contained in:
Claudiu Lodromanean 2019-01-08 12:15:59 -08:00 committed by GitHub
commit 15d1940c4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 4 deletions

View File

@ -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();
@ -56,9 +57,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' => '<strong class="wc-item-meta-label" style="float: left; margin-right: .25em; clear: both">',
) );
wc_display_item_meta(
$item,
array(
'label_before' => '<strong class="wc-item-meta-label" style="float: ' . esc_attr( $text_align ) . '; margin-' . esc_attr( $margin_side ) . ': .25em; clear: both">',
)
);
// allow other plugins to add additional product information here.
do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, $plain_text );