From 55c5579d1400af37dcf97790fb46f0e67b005534 Mon Sep 17 00:00:00 2001 From: Sayan Pandey Date: Thu, 8 May 2025 05:47:03 -0700 Subject: [PATCH 01/13] Removing Variant Level Sync (#2931) Summary: 1. The Variant level sync is removed in this PR for Variable products. 2. The Sync option now exist in Facebook tab. 3. Selecting your choice of sync will be effective on the product and all its variants. _In general we are moving forward with Syncing at Product level than Variant level._ | Before | After| |----------|----------| | 1. At Variant level sync controls | 1. At variant level sync controls removed | | ![image](https://github.com/user-attachments/assets/e045e46e-9db6-4f47-b2d3-305982d8fbfb) | ![image](https://github.com/user-attachments/assets/9d92d68b-9018-4692-989f-bc773229c201) | | 2. At facebook tab sync controls missing | 2. At facebook tab Sync controls added | | ![image](https://github.com/user-attachments/assets/7128288e-43bc-4ab4-8ce8-ff2166106e27) | ![image](https://github.com/user-attachments/assets/c75cf62a-f777-4505-91ef-7048fb6a816c) | 1. Make a variant product 2. Add some variant attributes 3. Now make variants 4. Try to use the sync - do not sync options in facebook tabs 5. Observe the changes in Catalog in commerce manager Pull Request resolved: https://github.com/facebook/facebook-for-woocommerce/pull/2931 Reviewed By: devbodaghe Differential Revision: D70891355 Pulled By: SayanPandey fbshipit-source-id: c7ff23076ccce86efc5a02c7ff0ab7250b52a1e7 --- facebook-commerce.php | 4 +- includes/Admin.php | 41 +++++-------------- includes/ProductSync/ProductValidator.php | 2 +- includes/Products.php | 20 ++++++++-- includes/fbproduct.php | 48 +++++++++++++++++++++++ 5 files changed, 78 insertions(+), 37 deletions(-) diff --git a/facebook-commerce.php b/facebook-commerce.php index 633112ffa..aebecc61a 100644 --- a/facebook-commerce.php +++ b/facebook-commerce.php @@ -806,7 +806,9 @@ public function on_product_save( int $wp_id ) { } $this->delete_fb_product( $delete_product ); } - } elseif ( $sync_enabled ) { + } + + if( $sync_enabled ) { Products::enable_sync_for_products( [ $product ] ); Products::set_product_visibility( $product, Admin::SYNC_MODE_SYNC_AND_HIDE !== $sync_mode ); $this->save_product_settings( $product ); diff --git a/includes/Admin.php b/includes/Admin.php index 62c13f5a6..371693415 100644 --- a/includes/Admin.php +++ b/includes/Admin.php @@ -1177,7 +1177,7 @@ public function add_product_settings_tab_content() { // 'id' attribute needs to match the 'target' parameter set above ?>
-
+
__( 'Choose whether to sync this product to Facebook and, if synced, whether it should be visible in the catalog.', 'facebook-for-woocommerce' ), ) ); - + ?> +
+ + +
+ '; echo '