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 – 14:00 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 -
- 19:00 – 22:00 19:00 – 22:00 19:00 – 22:00 19:00 – 22:00 19:00 – 22:00 -

Supporter timezone: Europe/Paris (GMT+01:00)

This topic contains 36 replies, has 4 voices.

Last updated by alejandraM 4 years, 3 months ago.

Assisted by: Yvette.

Author Posts
August 3, 2020 at 8:37 am #6724369

patrickT-26

Is there any update on this?

If i disable the previous mentioned line; it results in people paying wrong currency in wrong amounts.

(Like paying 59 EUR instead of DKK etc.)

So currently noone is able to change their payment method - which is a fairly large issue ^^

August 3, 2020 at 2:21 pm #6727013

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Paris (GMT+01:00)

Hello

I´ve checked the notes on the work ticket and I can see that the issue has been confirmed and escalated to our development team.

There were some attempts at improving the performance/code but they are only "proof of concept" and not anything that I could share. However, they did reduce the load times from 2 mins to 16 sec with these tests.

Unfortunately, I do not have anything to share directly with you.

August 27, 2020 at 9:42 am #6884417

patrickT-26

Anything that can be shared now?

We've had to re-do the woocommerce multilingual into session-based for finding current-currency, since WPML is doing 700+ calls to the database to find it if now. (Now its doing 800 session-calls; but its at least making it usable and loading in 20 seconds most of the time - rest is stalling..)

August 27, 2020 at 9:55 am #6884693

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Paris (GMT+01:00)

I don´t have any more news. I see that developmenet is refactoring the whole get_client_currency method and they have also caching for pay_for_order page. The currently targetd fix version is 4.11.0 but this can change and there is not "release date" that I can share.

I can see some code that one of the 3rd tier supporters implemented that significantly reduced the load times - was 2.8mins, now is 16.8secs

But the code is not-tested and I would only share with you "as is" with no further support and with your acknowledgement that you impelment it knowing fully that it was only as "proof of concept".

That´s the most I can do for you right now.

August 27, 2020 at 10:53 am #6885367

patrickT-26

We accept the current changed as "proof of concept" and wont require any support for this snippet.

I'll combine it my current edits and see if it allows for a "real fix".

Thanks for the help in regards to fixing this.

August 27, 2020 at 12:55 pm #6886565

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Paris (GMT+01:00)

Changing the method get_client_currency to have cache like this:

		if ( isset( $_GET['pay_for_order'] ) && $_GET['pay_for_order'] == true && isset( $_GET['key'] ) ) {
		    $order_id = wp_cache_get( $_GET['key'], "orderid". $_GET['key'] , false, $found );
		    if (!$found) {
			    $order_id = $wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_order_key' AND meta_value = %s",
				    sanitize_text_field( $_GET['key'] ) ) );
			    wp_cache_set( $_GET['key'], $order_id, "orderid".$_GET['key']);
		    }
			$this->client_currency = wp_cache_get( $order_id, "orders", false, $found );
			if ( !$found && $order_id ) {
				$this->client_currency = get_post_meta( $order_id, '_order_currency', true );
				wp_cache_set( $order_id, $this->client_currency, "orders" );
			}
		}

significantly reduced the load times - was 2.8mins, now is 16.8secs.

You can see if this works for you.

December 1, 2020 at 10:11 pm #7574233

alejandraM

Hi Yvette, I do the change in the file and now works fine, tell me when this have a solution from wpml team.

Thanks