Overview of the Issue
WPML Multilingual & Multicurrency for WooCommerce allows you to set a different BACS account per currency. However, WCML currently lists all your different shop BACS accounts on the confirmation order page and emails instead of the valid one for the selected language.
Workaround
This issue is fixed in WCML 5.1.0. Updating solves it on your site, so you only need this workaround if you can’t update yet.
Please make a full backup of your site before proceeding.
- Open /wp-content/plugins/woocommerce-multilingual/classes/multi-currency/payment-gateways/class-wcml-payment-gateway-bacs.php.
- Look for line 35.
- Replace:
if ( $gateway_setting && 'all' !== $gateway_setting['value'] ) { if ( 'all_in' === $gateway_setting['value'] ) { $bacs_accounts_currencies = get_option( WCML_WC_Gateways::WCML_BACS_ACCOUNTS_CURRENCIES_OPTION, [] ); foreach ( $bacs_accounts_currencies as $account_key => $currency ) { if ( $gateway_setting['currency'] === $currency ) { $allowed_accounts[] = $accounts[ $account_key ]; } } } else { $allowed_accounts[] = $accounts[ $gateway_setting['value'] ]; } } return $allowed_accounts ? $allowed_accounts : $accounts; - With:
if ( $gateway_setting && 'all' !== $gateway_setting['value'] ) { $woocurrency = get_woocommerce_currency(); // to get default currency if ( 'all_in' === $gateway_setting['value'] ) { $bacs_accounts_currencies = get_option( WCML_WC_Gateways::WCML_BACS_ACCOUNTS_CURRENCIES_OPTION, [] ); foreach ( $bacs_accounts_currencies as $account_key => $currency ) { if ( $gateway_setting['currency'] === $currency ) { $allowed_accounts[] = $accounts[ $account_key ]; } if ( $gateway_setting['currency'] === NULL && $woocurrency && $woocurrency === $currency ) { //new condition for default currency $allowed_accounts[] = $accounts[ $account_key ]; } } } else { $allowed_accounts[] = $accounts[ $gateway_setting['value'] ]; } } return $allowed_accounts ? $allowed_accounts : $accounts; - Go to WooCommerceWooCommerce Multilingual & MulticurrencyMulticurrency
- Edit the different currencies added under “Currencies” section
- Enable “Payment Gateways” option for each currency
- Save the changes
Still Seeing This Issue?
If updating doesn’t fix it, ask a support question and we’ll look into it with you.
Ask a support question