Skip to content

Fix Categories were being stripped from products during manual sync.#451

Draft
iamdharmesh wants to merge 6 commits intotrunkfrom
fix/SQUARE-231
Draft

Fix Categories were being stripped from products during manual sync.#451
iamdharmesh wants to merge 6 commits intotrunkfrom
fix/SQUARE-231

Conversation

@iamdharmesh
Copy link
Collaborator

All Submissions:

  • Does your code follow the WooCommerce Sniffs variant of WordPress coding standards?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully run tests with your changes locally?
  • Will this change require new documentation or changes to existing documentation?

Changes proposed in this Pull Request:

In PR #408, we added support for syncing multiple categories. However, we missed adding this support to manual synchronization. This PR fixes an issue in manual and interval synchronization where categories were being stripped from products synced from Square.

Note

While working on this, I noticed that synced categories do not maintain the parent–child relationship during synchronization. I have reported a separate issue to explore implementation options and potentially address it.

Closes https://linear.app/a8c/issue/SQUARE-231/categories-get-stripped-off-from-products-that-are-synced-from-square

Steps to test the changes in this Pull Request:

  1. Square SOR:

    • Create a product in Square with multiple categories.
    • Sync from Square to WooCommerce (via import).
    • Verify that the WooCommerce product has all categories assigned correctly.
    • Update the product on the Square side (e.g., update the product title).
    • Wait for the interval polling to trigger (or trigger it manually).
    • Verify that the WooCommerce product still has all categories assigned correctly and that none are removed.
    • Trigger a manual sync from the settings and verify that the WooCommerce product still has all categories assigned correctly and that none are removed.
  2. WooCommerce SOR:

    • Create a product in WooCommerce with multiple categories and sync it with Square.
    • Verify that the Square product has all categories assigned correctly.
    • Update the product on the WooCommerce side (e.g., update the product title).
    • Verify that the Square product still has all categories assigned correctly and that none are removed.
    • Trigger a manual sync from the settings and verify that the Square product still has all categories assigned correctly and that none are removed.

Changelog entry

Fix - Categories were being stripped from products during manual sync.

@iamdharmesh iamdharmesh self-assigned this Jan 21, 2026
@vikrampm1 vikrampm1 added this to the Future Release milestone Feb 15, 2026
@github-actions
Copy link

github-actions bot commented Mar 13, 2026

🔍 WordPress Plugin Check Report

❌ Status: Failed

📊 Report

🎯 Total Issues ❌ Errors ⚠️ Warnings
8 8 0

❌ Errors (8)

📁 includes/Admin/Product_Editor_Compatibility.php (1 error)
📍 Line 🔖 Check 💬 Message
0 missing_direct_file_access_protection PHP file should prevent direct access. Add a check like: if ( ! defined( 'ABSPATH' ) ) exit;
📁 includes/WC_Payments_Compatibility.php (1 error)
📍 Line 🔖 Check 💬 Message
0 missing_direct_file_access_protection PHP file should prevent direct access. Add a check like: if ( ! defined( 'ABSPATH' ) ) exit;
📁 includes/Framework/PaymentGateway/Admin/views/html-user-profile-field-customer-id.php (1 error)
📍 Line 🔖 Check 💬 Message
0 missing_direct_file_access_protection PHP file should prevent direct access. Add a check like: if ( ! defined( 'ABSPATH' ) ) exit;
📁 includes/Framework/PaymentGateway/Admin/views/html-order-partial-capture.php (1 error)
📍 Line 🔖 Check 💬 Message
0 missing_direct_file_access_protection PHP file should prevent direct access. Add a check like: if ( ! defined( 'ABSPATH' ) ) exit;
📁 includes/Framework/PaymentGateway/Admin/views/html-admin-gateway-status.php (1 error)
📍 Line 🔖 Check 💬 Message
0 missing_direct_file_access_protection PHP file should prevent direct access. Add a check like: if ( ! defined( 'ABSPATH' ) ) exit;
📁 includes/Framework/PaymentGateway/Admin/views/html-user-payment-token-editor.php (1 error)
📍 Line 🔖 Check 💬 Message
0 missing_direct_file_access_protection PHP file should prevent direct access. Add a check like: if ( ! defined( 'ABSPATH' ) ) exit;
📁 includes/Framework/PaymentGateway/Admin/views/html-user-payment-token-editor-token.php (1 error)
📍 Line 🔖 Check 💬 Message
0 missing_direct_file_access_protection PHP file should prevent direct access. Add a check like: if ( ! defined( 'ABSPATH' ) ) exit;
📁 includes/Framework/PaymentGateway/Admin/views/html-user-profile-section.php (1 error)
📍 Line 🔖 Check 💬 Message
0 missing_direct_file_access_protection PHP file should prevent direct access. Add a check like: if ( ! defined( 'ABSPATH' ) ) exit;

🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants