From 4d603e10c77cb2a795d6b0d8577fa8e0657d6c5a Mon Sep 17 00:00:00 2001 From: Muhammad Muhsin Date: Fri, 19 Dec 2025 08:36:38 +0300 Subject: [PATCH 1/5] Enhance product import and sync messaging in WooCommerce Square integration. Updated descriptions to clarify the distinction between importing new products and syncing existing ones. Added informational notices in the admin settings and sync pages to guide users effectively. --- includes/Admin/Settings_Page.php | 6 ++- includes/Admin/Sync_Page.php | 47 +++++++++++++++++-- includes/Settings.php | 1 + .../modules/configure-sync/index.js | 29 +++++++++++- 4 files changed, 78 insertions(+), 5 deletions(-) diff --git a/includes/Admin/Settings_Page.php b/includes/Admin/Settings_Page.php index 102c92ec..481c2ae8 100644 --- a/includes/Admin/Settings_Page.php +++ b/includes/Admin/Settings_Page.php @@ -169,12 +169,16 @@ private static function output_import_products_modal_template() {
-

+

+

+ + +


diff --git a/includes/Admin/Sync_Page.php b/includes/Admin/Sync_Page.php index 241f7606..03e4b532 100644 --- a/includes/Admin/Sync_Page.php +++ b/includes/Admin/Sync_Page.php @@ -49,6 +49,7 @@ public static function output() {

+

@@ -250,8 +251,11 @@ private static function output_sync_status() { id="wc-square-sync" class="button button-large" - > + >
+

+ +

@@ -260,6 +264,39 @@ class="button button-large" } + /** + * Outputs an informational notice about importing new products from Square. + * + * @since 4.8.0 + */ + private static function output_import_products_notice() { + + if ( ! wc_square()->get_settings_handler()->is_product_sync_enabled() ) { + return; + } + + $settings_url = admin_url( 'admin.php?page=wc-settings&tab=square' ); + + ?> +
+

+ +

+

+ tag, %2$s - closing tag */ + esc_html__( 'The "Sync Now" button only updates products that are already synced with Square. To import new products from Square that don\'t exist in WooCommerce yet, use the %1$sImport all Products from Square%2$s button on the Settings tab.', 'woocommerce-square' ), + '', + '' + ); + ?> +

+
+
-

+

get_settings_handler(); ?> +

+ + +

    is_system_of_record_square() ) : ?> @@ -376,7 +417,7 @@ private static function output_sync_with_square_modal_template() { get_system_of_record_name() ), $additional_info // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- The contents of $additional_info is already escaped above. ); diff --git a/includes/Settings.php b/includes/Settings.php index facd455c..24b408f0 100644 --- a/includes/Settings.php +++ b/includes/Settings.php @@ -424,6 +424,7 @@ public function generate_import_products_html( $id, $field ) { '> +

    diff --git a/src/new-user-experience/modules/configure-sync/index.js b/src/new-user-experience/modules/configure-sync/index.js index 9211abd9..50982f90 100644 --- a/src/new-user-experience/modules/configure-sync/index.js +++ b/src/new-user-experience/modules/configure-sync/index.js @@ -347,6 +347,10 @@ export const ConfigureSync = ( { ) } indent={ indent } className="import-products-wrapper" + description={ __( + 'Use this to bring new products from Square into WooCommerce. This is different from "Sync Now" which only updates products that are already synced.', + 'woocommerce-square' + ) } > From 541d4e47ff38c83f664277f89a88a9dfa38eac26 Mon Sep 17 00:00:00 2001 From: Muhammad Muhsin Date: Sun, 21 Dec 2025 07:44:33 +0300 Subject: [PATCH 3/5] Refactor product import and sync messaging in admin pages. Removed redundant notice about importing new products from Square in the Settings Page. Updated the Sync Page to conditionally display the description for syncing existing products, enhancing clarity for users. --- includes/Admin/Settings_Page.php | 4 ---- includes/Admin/Sync_Page.php | 9 +++++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/includes/Admin/Settings_Page.php b/includes/Admin/Settings_Page.php index af300d05..102c92ec 100644 --- a/includes/Admin/Settings_Page.php +++ b/includes/Admin/Settings_Page.php @@ -175,10 +175,6 @@ private static function output_import_products_modal_template() {
    -

    - - -


    diff --git a/includes/Admin/Sync_Page.php b/includes/Admin/Sync_Page.php index 03e4b532..d20b530a 100644 --- a/includes/Admin/Sync_Page.php +++ b/includes/Admin/Sync_Page.php @@ -49,7 +49,6 @@ public static function output() {

    -

    @@ -253,9 +252,11 @@ class="button button-large" >
    -

    - -

    + get_settings_handler()->is_system_of_record_square() ) : ?> +

    + +

    + From 523da750e69e04ee651d18ea439690780385aa07 Mon Sep 17 00:00:00 2001 From: Muhammad Muhsin Date: Tue, 23 Dec 2025 19:41:00 +0300 Subject: [PATCH 4/5] Refactor sync page messaging for clarity and remove outdated import notice. Updated header and conditional display of sync information to enhance user understanding of product syncing with Square. --- includes/Admin/Sync_Page.php | 40 ++++-------------------------------- 1 file changed, 4 insertions(+), 36 deletions(-) diff --git a/includes/Admin/Sync_Page.php b/includes/Admin/Sync_Page.php index d20b530a..3a208a84 100644 --- a/includes/Admin/Sync_Page.php +++ b/includes/Admin/Sync_Page.php @@ -264,40 +264,6 @@ class="button button-large" get_settings_handler()->is_product_sync_enabled() ) { - return; - } - - $settings_url = admin_url( 'admin.php?page=wc-settings&tab=square' ); - - ?> -
    -

    - -

    -

    - tag, %2$s - closing tag */ - esc_html__( 'The "Sync Now" button only updates products that are already synced with Square. To import new products from Square that don\'t exist in WooCommerce yet, use the %1$sImport all Products from Square%2$s button on the Settings tab.', 'woocommerce-square' ), - '', - '' - ); - ?> -

    -
    -
    -

    +

    get_settings_handler(); ?> + is_product_sync_enabled() ) : ?>

    +
      is_system_of_record_square() ) : ?> @@ -418,7 +386,7 @@ private static function output_sync_with_square_modal_template() { get_system_of_record_name() ), $additional_info // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- The contents of $additional_info is already escaped above. ); From b00cc7de29184328f5427946f11c06682cb9690c Mon Sep 17 00:00:00 2001 From: Muhammad Muhsin Date: Sat, 27 Dec 2025 08:10:47 +0300 Subject: [PATCH 5/5] Implement PR review feedback. Update product import and sync messaging for clarity in WooCommerce Square integration. Enhanced descriptions in the Settings and Sync pages to differentiate between importing new products and syncing existing ones based on the system of record. Improved user guidance for product management. --- includes/Admin/Sync_Page.php | 4 +- includes/Settings.php | 6 ++- .../modules/configure-sync/index.js | 37 ++++++------------- 3 files changed, 19 insertions(+), 28 deletions(-) diff --git a/includes/Admin/Sync_Page.php b/includes/Admin/Sync_Page.php index 3a208a84..beee554c 100644 --- a/includes/Admin/Sync_Page.php +++ b/includes/Admin/Sync_Page.php @@ -359,7 +359,7 @@ private static function output_sync_with_square_modal_template() {
      get_settings_handler(); ?> - is_product_sync_enabled() ) : ?> + is_system_of_record_square() ) : ?>

      @@ -386,7 +386,7 @@ private static function output_sync_with_square_modal_template() { get_system_of_record_name() ), $additional_info // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- The contents of $additional_info is already escaped above. ); diff --git a/includes/Settings.php b/includes/Settings.php index 24b408f0..d22bf896 100644 --- a/includes/Settings.php +++ b/includes/Settings.php @@ -424,7 +424,11 @@ public function generate_import_products_html( $id, $field ) { '> -

      + is_system_of_record_square() ) : ?> +

      + +

      + diff --git a/src/new-user-experience/modules/configure-sync/index.js b/src/new-user-experience/modules/configure-sync/index.js index 50982f90..0be6e4a8 100644 --- a/src/new-user-experience/modules/configure-sync/index.js +++ b/src/new-user-experience/modules/configure-sync/index.js @@ -347,10 +347,17 @@ export const ConfigureSync = ( { ) } indent={ indent } className="import-products-wrapper" - description={ __( - 'Use this to bring new products from Square into WooCommerce. This is different from "Sync Now" which only updates products that are already synced.', - 'woocommerce-square' - ) } + description={ + system_of_record === 'square' + ? __( + 'Use this to bring new products from Square into WooCommerce. This is different from "Sync Now" which only updates products that are already synced.', + 'woocommerce-square' + ) + : __( + 'Use this to bring products from Square into WooCommerce.', + 'woocommerce-square' + ) + } >