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/

This topic contains 1 voice and has 0 replies.

>
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