From f3dec7344356cbe3b4e32223043b728a84918ef2 Mon Sep 17 00:00:00 2001 From: Neal Wei Date: Thu, 27 Mar 2025 18:40:01 -0700 Subject: [PATCH] [WooCommerce]fix: auto products sync --- includes/API/Plugin/Settings/Handler.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/includes/API/Plugin/Settings/Handler.php b/includes/API/Plugin/Settings/Handler.php index 4e954a315..be6a759e4 100644 --- a/includes/API/Plugin/Settings/Handler.php +++ b/includes/API/Plugin/Settings/Handler.php @@ -81,6 +81,13 @@ public function handle_update( \WP_REST_Request $wp_request ) { // Update connection status flags $this->update_connection_status( $request->get_data() ); + // Allow opt-out of full batch-API sync, for example if store has a large number of products. + if ( facebook_for_woocommerce()->get_integration()->allow_full_batch_api_sync() ) { + facebook_for_woocommerce()->get_products_sync_handler()->create_or_update_all_products(); + } else { + \WC_Facebookcommerce_Utils::logToMeta( 'Initial full product sync disabled by filter hook `facebook_for_woocommerce_allow_full_batch_api_sync`' ); + } + return $this->success_response( [ 'message' => __( 'Facebook settings updated successfully', 'facebook-for-woocommerce' ),