Waiting for author
Overview of the issue
When using WCFM – Multivendor Marketplace for WooCommerce and its add-on WooCommerce Multivendor Membership, verification code emails sent in secondary languages inherit RTL alignment if the default language is RTL (Right to Left). This occurs even if the secondary language is LTR (Left to Right).
Workaround
Please, make sure of having a full site backup of your site before proceeding.
- Open …/wp-content/plugins/wc-multivendor-membership/views/emails/email-verification.php
- Look for line 16
- Replace:
12
do_action(
'woocommerce_email_header'
,
$email_heading
,
$email
);
?>
- With:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
// Workaround for compsupp-7719
// Switch language context
if
( apply_filters(
'wcfm_allow_wpml_email_translation'
, true ) ) {
do_action(
'wpml_switch_language_for_email'
,
$user_email
);
}
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=<?php bloginfo( 'charset' ); ?>"
/>
<meta content=
"width=device-width, initial-scale=1.0"
name=
"viewport"
>
<title><?php
echo
get_bloginfo(
'name'
,
'display'
); ?></title>
</head>
<body <?php
echo
is_rtl() ?
'rightmargin'
:
'leftmargin'
; ?>=
"0"
marginwidth=
"0"
topmargin=
"0"
marginheight=
"0"
offset=
"0"
>
<table width=
"100%"
id=
"outer_wrapper"
>
<tr>
<td><!-- Deliberately
empty
to support consistent sizing
and
layout across multiple email clients. --></td>
<td width=
"600"
>
<div id=
"wrapper"
dir=
"<?php echo is_rtl() ? 'rtl' : 'ltr'; ?>"
>
<table border=
"0"
cellpadding=
"0"
cellspacing=
"0"
height=
"100%"
width=
"100%"
>
<tr>
<td align=
"center"
valign=
"top"
>
<div id=
"template_header_image"
>
<?php
$img
= get_option(
'woocommerce_email_header_image'
);
if
(
$img
) {
echo
'<p style="margin-top:0;"><img src="'
. esc_url(
$img
) .
'" alt="'
. esc_attr( get_bloginfo(
'name'
,
'display'
) ) .
'" /></p>'
;
}
?>
</div>
<table border=
"0"
cellpadding=
"0"
cellspacing=
"0"
width=
"100%"
id=
"template_container"
>
<tr>
<td align=
"center"
valign=
"top"
>
<!-- Header -->
<table border=
"0"
cellpadding=
"0"
cellspacing=
"0"
width=
"100%"
id=
"template_header"
>
<tr>
<td id=
"header_wrapper"
>
<h1 style=
"text-align: <?php echo is_rtl() ? 'right' : 'left'; ?>"
><?php
echo
esc_html(
$email_heading
); ?></h1>
</td>
</tr>
</table>
<!--
End
Header -->
</td>
</tr>
<tr>
<td align=
"center"
valign=
"top"
>
<!-- Body -->
<table border=
"0"
cellpadding=
"0"
cellspacing=
"0"
width=
"100%"
id=
"template_body"
>
<tr>
<td valign=
"top"
id=
"body_content"
>
<!-- Content -->
<table border=
"0"
cellpadding=
"20"
cellspacing=
"0"
width=
"100%"
>
<tr>
<td valign=
"top"
>
<div id=
"body_content_inner"
style=
"text-align: <?php echo is_rtl() ? 'right' : 'left'; ?>"
>
- And add the following code at the end of the file (around line 88)
123456
<?php
// switch language back
if
( apply_filters(
'wcfm_allow_wpml_email_translation'
, true ) ) {
do_action(
'wpml_restore_language_from_email'
);
}
?>
Hello, I would like to be updated please once the fix to this bug is implemented in the source code of the plugin.
Hello,
Sure, we will keep this page updated.
Please, keep in mind that this issue may be solved from the author part as well. For that reason, we also recommend you to get in contact with them.
Regards