 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 ^^
|
 Yvette
Supporter
Languages:
English (English )
Spanish (EspaƱol )
Timezone:
Europe/Paris (GMT+02: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.
|
 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..)
|
 Yvette
Supporter
Languages:
English (English )
Spanish (EspaƱol )
Timezone:
Europe/Paris (GMT+02: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.
|
 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.
|
 Yvette
Supporter
Languages:
English (English )
Spanish (EspaƱol )
Timezone:
Europe/Paris (GMT+02: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.
|
 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
|