WPML

Overview of the Issue

When WPML Multilingual & Multicurrency for WooCommerce is activated, the response time for bulk product updates via the REST-API is significantly longer.

Workaround

This issue is fixed. Updating to the latest version solves it on your site, so you only need this workaround if you can’t update yet.

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;
}

All known issues

Still Seeing This Issue?

If updating doesn’t fix it, ask a support question and we’ll look into it with you.