Open
Reported for: WooCommerce Multilingual & Multicurrency 5.2.1
Overview of the issue
When WooCommerce Multilingual is activated, the response time for bulk product updates via the REST-API is significantly longer.
Workaround
Before using these workaround do remember to consider possible caveats.
It is possible that not all of your data is synchronized between translations and potentially show stale information.
To try to remedy the product updating issues you can try:
add_filter('rest_pre_dispatch', function ($result, $server, $request) { global $woocommerce_wpml; $params = serialize($request->get_params()); if (str_contains($params, 'stock_quantity')){ remove_filter( 'get_post_metadata', [ $woocommerce_wpml->products, 'filter_product_data' ] ); } return $result; }, 10, 3);
If you still have slowness issues and your product is assigned to multiple categories and the product has many translations, you can try and bypass the term recount
add_filter( 'woocommerce_product_recount_terms', 'bypass_term_recount_on_rest' ); function bypass_term_recount_on_rest( $value ){ if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) { $value = false; } return $value; }
Hi,
Can you please do something about this problem. On some sites there are huge problems of slowness that cause lost sales. Problems with API access with WPML. I’m losing my customers and I don’t know what to do.
Thank you and best regards
Hello Odile,
Our development team is working to resolve performance issues in this development cycle.
If you have not yet opened a ticket on our forum, I suggest opening a new ticket so that our developers can analyze your specific case.