WPML

Overview of the Issue

When using Facebook for WooCommerce, clicking a translated product in Facebook redirects you to the product in the default language or to an error page.

Workaround

This issue is fixed in WPML Multilingual & Multicurrency for WooCommerce 5.5.4. Updating solves it on your site, so you only need this workaround if you can’t update yet.

In your child theme functions.php file, add the following:

add_filter ('facebook_for_woocommerce_integration_prepare_product', 'fix_product_url', 11, 2);

 function fix_product_url($product_data, $id) {
	 $product_lang = apply_filters( 'wpml_post_language_details', null, $id );
	 $product_data['url'] = apply_filters( 'wpml_permalink', $product_data['url'], $product_lang['language_code'] );
	 return $product_data;
 }

Next Steps

We’ve contacted WooCommerce for a permanent fix, but have yet to hear back. Since the issue needs to be resolved with changes to the plugin code, we cannot assist any further other than by providing the workaround detailed above.

If you are experiencing issues and would like to push this fix forward to WooCommerce, feel free to leave a support ticket with the author here: https://woocommerce.com/my-account/create-a-ticket/ (opens in a new tab) (you will need to be logged into WordPress.com).

Still Seeing This Issue?

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

Ask a support question

All known issues