This thread is resolved. Here is a description of the problem and solution.
Problem:
The client is experiencing an issue where products in secondary languages are being incorrectly synced and displayed in their Facebook catalogue, despite being archived in WooCommerce. This issue arises from the integration between WPML and Facebook for WooCommerce.
Solution:
1. We confirmed that the 'Facebook Visibility' feature in WPML archives secondary language products as intended, but they are still being synced by Facebook for WooCommerce.
2. Our compatibility team has escalated this as a feature request to the developers of Facebook for WooCommerce. However, they have found that the integration is managed by Facebook for WooCommerce, not WPML.
3. We suggested a potential workaround using a custom filter to prevent syncing of secondary language products:
add_filter( 'wc_facebook_is_product_sync_enabled', function( $is_enabled, $integration ) {<br /> $product_id = $integration->get_product()->get_id();<br /> $product_lang = apply_filters( 'wpml_post_language_details', null, $product_id );<br /> if ( is_array( $product_lang ) && isset( $product_lang['language_code'] ) ) {<br /> $default_lang = apply_filters( 'wpml_default_language', null );<br /> if ( $product_lang['language_code'] !== $default_lang ) {<br /> return false; // Block sync<br /> }<br /> }<br /> return $is_enabled;<br />}, 10, 2 );**** Important! Please make a full site backup (files and DB) before you proceed with those steps****
4. We also recommend contacting Automatic, the authors of Facebook for WooCommerce, to address this integration issue.
If this solution does not resolve your issue or seems irrelevant, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem persists, please open a new support ticket at WPML support forum.
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.
This topic contains 21 replies, has 0 voices.
Last updated by 1 year, 2 months ago.
Assisted by: Itamar.

