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, 43 minutes ago.

Assisted by: Waqas Bin Hasan.

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

December 2, 2024 at 10:45 am #16465468

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:53 pm #16466168

Waqas Bin Hasan
Supporter

Languages: English (English )

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

Thank you for your patience and cooperation.

May I request little more details on the said issue, like what problem exactly it is causing in your site?

Also I request some steps about how I can reproduce this issue in a clean environment? I'm trying to understand the side-effects of these early calls.