This thread is resolved. Here is a description of the problem and solution.
Problem:
If you're experiencing an issue where bank details are showing twice in the order confirmation email when the multicurrency option is enabled in the WooCommerce Multilingual extension.
Solution:
We recommend editing the file
woocommerce-multilingual/classes/multi-currency/payment-gateways/class-wcml-currencies-payment-gateways.php
. On line number 38, replace the existing code:
add_filter( 'woocommerce_payment_gateways', Fns::tap( Fns::withoutRecursion( Fns::identity(), [ $this, 'init_gateways' ] ) ), PHP_INT_MAX );
with the following code:
add_action( 'wp_loaded', [ $this, 'init_gateways' ] );
This should serve as a temporary workaround until our developers provide a permanent fix. If this solution doesn't seem relevant to your issue, please open a new support ticket so we can assist you further.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Tagged: Bug
This topic contains 12 replies, has 4 voices.
Last updated by Dražen Duvnjak 11 months, 2 weeks ago.
Assisted by: Dražen Duvnjak.
Author | Posts |
---|---|
December 7, 2023 at 1:25 pm #15017011 | |
aleksandraD-3 |
In the order confirmation email, the bank details show twice if the multicurrency option is enabled in the Woocommerce Multilingual extension. The bank transfer option has been removed from the English version in functions.php add_filter('woocommerce_available_payment_gateways', 'hide_bank_transfer_for_english'); function hide_bank_transfer_for_english($gateways) { if (ICL_LANGUAGE_CODE == 'en') { unset($gateways['bacs']); } return $gateways; } But still in the email bank info appears twice. Please help |
December 9, 2023 at 1:08 pm #15029223 | |
Christopher Amirian Supporter
Languages: English (English ) Timezone: Asia/Yerevan (GMT+04:00) |
Hi there, I will add the first reply before this ticket is assigned to one of my colleagues. First thing first, please read the documentation below to know if you follow the correct steps when it comes to sending a custom email: https://wpml.org/documentation/support/sending-emails-with-wpml/ The other point is that you used an older constant which is deprecated in the code. Would you please use the code below for the detection of the language? https://wpml.org/faq/how-to-get-current-language-with-wpml/ Thanks. |
December 14, 2023 at 8:00 am #15060907 | |
aleksandraD-3 |
It doesn't matter if I overwrite the email theme or not, the transfer information still appears twice. Changing the theme to wordpress default doesn't help either, so it's not a problem of our changes in child theme. I can provide access to staging. |
December 14, 2023 at 8:10 am #15061079 | |
Dražen Duvnjak Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+01:00) |
Hello, thanks for getting back. Before we continue I need you to check and confirm a few things. 1) Does the issue still happens when you are using the WP default theme and only WPML plugins and WooCommerce enabled, all other disabled? 2) Does the issue still happen if you disable WPML plugins? 3) Does the issue till happen if you remove any custom code? Please let me know. Thanks, |
December 14, 2023 at 1:21 pm #15063567 | |
aleksandraD-3 |
1) yes, clean storefront theme & only Woocommerce, WPML, WPML String Translations and Woocommerce Multilingual & Multicurrency activated, issue still occurs since reporting this problem we have migrated the site to a different server so submitted logs are no longer valid |
December 14, 2023 at 1:32 pm #15063653 | |
Dražen Duvnjak Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+01:00) |
Hello, thanks for checking and getting back. Please make a full backup of your site (files and database) and confirm it in your next reply. Please note, that I might need to do some debugging procedures like enable/disable plugins, switch themes, change the default language of the user account, and/or access your website database to debug the issue furtherly. I will share with you any changes or steps done in this process. Please let me know if you do not agree with the above or if I do not have your permission for any. I would need to access both your site's wp-admin and FTP account, if possible. I have enabled the private username and password fields in your next reply. I suggest you create a new user, set it as an administrator and then add those credentials in the private fields mentioned. You can safely add your information into these fields. Regards, |
December 15, 2023 at 12:43 pm #15072409 | |
Dražen Duvnjak Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+01:00) |
Hello, thanks. I checked and it seems to be the same issue that was fixed before, but I see now it again happens. - https://wpml.org/errata/all-bacs-accounts-are-shown-on-order-confirmation-page-and-emails/ If it is okay, can we please keep the staging site like this (plugins disabled) and I will share this with our 2nd tiers to check and advise further. I will update you soon. Thanks, |
December 18, 2023 at 7:38 am #15080705 | |
aleksandraD-3 |
Okey, thanks |
December 18, 2023 at 12:14 pm #15084121 | |
Dražen Duvnjak Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+01:00) |
Hello, I was able to reproduce nad confirm the bug on the sandbox test site. I have escalated this issue further to our 2nd tier. I will update you soon on the status. Regards, |
December 20, 2023 at 6:56 am #15098039 | |
aleksandraD-3 |
hello, any news? unfortunately we need the staging back 🙁 |
December 20, 2023 at 8:06 am #15098521 | |
Dražen Duvnjak Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+01:00) |
Hello, please note it may take a while. Also, sure you are free to use the staging, we do not need it for now. I will update you when I have some news. Regards, |
December 21, 2023 at 11:39 am #15109461 | |
Konstantinos |
Hello. same problem on my project also. All payment methods show twice in thank you page and in order email. New threads created by Dražen Duvnjak and linked to this one are listed below: https://wpml.org/forums/topic/split-duplicated-bank-information-in-order-confirmation-email/ |
December 22, 2023 at 12:55 pm #15117401 | |
Dražen Duvnjak Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+01:00) |
Hello, the issue has been escalated to our devs for a permanent fix, in the meantime you can use the next workaround. Edit the file \woocommerce-multilingual\classes\multi-currency\payment-gateways\class-wcml-currencies-payment-gateways.php on line number 38 replace add_filter( 'woocommerce_payment_gateways', Fns::tap( Fns::withoutRecursion( Fns::identity(), [ $this, 'init_gateways' ] ) ), PHP_INT_MAX ); with add_action( 'wp_loaded', [ $this, 'init_gateways' ] ); Regards, |
December 27, 2023 at 7:46 am #15131196 | |
aleksandraD-3 |
thank you, that works 🙂 |