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 28, 2024 at 4:07 am #16452227

desireeM

Background of the issue:
is_cart() and is_checkout() cannot be used on "init" hook, the earliest is "wp" - if it's called before that they will always return false
See hidden link
However you call them on "init" hook

Here's a partial stack trace highlighting the issue:

...
#7 /wp-content/plugins/woocommerce-multilingual/compatibility/WcSubscriptions/MulticurrencyHooks.php (107): is_cart()
#8 /wp-content/plugins/woocommerce-multilingual/compatibility/WcSubscriptions/MulticurrencyHooks.php (49): WCMLCompatibilityWcSubscriptionsMulticurrencyHooks->maybe_force_client_currency_for_subscription()
#9 /wp-includes/class-wp-hook.php (...): WCMLCompatibilityWcSubscriptionsMulticurrencyHooks->init()
...
#12 /wp-settings.php (...): do_action( $hook_name = 'init' )
...

Do you have any e2e tests internally? Bc whatever you try to do, never works, since is_cart/is_checkout will always return false on init hook

Btw same issue also "is_front_page()" WP (not WC) conditional, which, if called on "init" has not been initiated usually, since "parse_query" hasn't run on the main query yet

...
#5 /wp-content/plugins/wp-seo-multilingual/classes/Utils.php (52): is_front_page()
#6 /wp-content/plugins/wp-seo-multilingual/classes/Presentation/Hooks.php (33): WPMLWPSEOUtils::isFrontPageWithPosts()
#7 /wp-includes/class-wp-hook.php (...): WPMLWPSEOPresentationHooks->init()
...
#10 /wp-settings.php (...): do_action( $hook_name = 'init' )
...
#13 /wp-blog-header.php (13): require_once( '/wp-load.php' )
#14 /index.php (17): require( '/wp-blog-header.php' )

Symptoms:
The conditional tags is_cart(), is_checkout(), and is_front_page() return false when used on the 'init' hook.

Questions:
Please fix your code