Skip Navigation

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.

WordPress 6.7 has introduced a new issue that impact translations, please update WooCommerce and WPML to the latest versions before you report issues. More about this here - https://wpml.org/errata/php-error-wp-6-7-notice-function-_load_textdomain_just_in_time-was-called/
Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 -
- - - - - - -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 2 replies, has 0 voices.

Last updated by Waqas Bin Hasan 16 hours, 57 minutes ago.

Assisted by: Waqas Bin Hasan.

Author Posts
November 27, 2024 at 10:12 pm #16451819

desireeM

Background of the issue:
WCML loads woocommerce "get_available_payment_gateways" too early, before conditional tags are loaded, leading to incorrect list of available gateways.

woocommerce calls "is_add_payment_method_page" internally, which is a conditional tag hidden link that is only available on or after the "wp" action

WCML tries to load it on "wp_loaded" though.
You need to change your code to use a later hook (ideally "wp" or later)

Here's a partial stacktrace showing where it goes wrong:

...
/wp-content/plugins/woocommerce/includes/class-wc-payment-gateways.php (325): is_add_payment_method_page()
/wp-content/plugins/woocommerce-multilingual/classes/multi-currency/payment-gateways/class-wcml-currencies-payment-gateways.php (212): WC_Payment_Gateways->get_available_payment_gateways()
/wp-content/plugins/woocommerce-multilingual/classes/multi-currency/payment-gateways/class-wcml-currencies-payment-gateways.php (97): WCML_Currencies_Payment_Gateways->get_available_payment_gateways()
/wp-includes/class-wp-hook.php (341): WCML_Currencies_Payment_Gateways->init_gateways()
/wp-includes/class-wp-hook.php (365): WP_Hook->apply_filters(...)
/wp-includes/plugin.php (521): WP_Hook->do_action(...)
/wp-settings.php (724): do_action( $hook_name = 'wp_loaded' )
/wp-config.php (378): require_once( '/wp-settings.php' )
/wp-load.php (51): require_once( '/wp-config.php' )
...

Symptoms:
Incorrect gateways loaded depending on the page one's on.

Questions:
Please fix your code

December 2, 2024 at 10:45 am #16465467

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting the support.

I'm checking with my team about the reported issue and 'll get back to you accordingly.

Thank you for your patience and cooperation.

Regards.

December 2, 2024 at 12:51 pm #16466163

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation.

May I request some steps about how I can reproduce this issue in a clean environment? I'm trying to reproduce in a sandbox site but probably missing some key points.