-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure the product category syncs properly between the Square and WooCommerce store #172
Conversation
const response = await createCatalogObject( 'Cap', 'cap', 1350, 'This is a very good cap, no cap.' ); | ||
const categoryResponse = await createCategory('Hats'); | ||
const categoryId = categoryResponse.catalog_object?.id || ''; | ||
const response = await createCatalogObject( 'Cap', 'cap', 1350, 'This is a very good cap, no cap.', categoryId ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to tag @Sidsector9, the author of this creativity. 🤣
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧢
Co-authored-by: Darin Kotter <[email protected]>
QA Update ✅I have checked this issue in the I tested the following on this branch:
Testing Environment
Screen.Recording.2024-07-11.at.3.06.25.PM.movScreen.Recording.2024-07-11.at.2.18.37.PM.movScreen.Recording.2024-07-11.at.1.54.07.PM.movSteps to Test- As mentioned in the PR description.
|
@diegocurbelo this PR is ready for your review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good an tested well 🚢
Regression / Smoke Test Report ✅Tested with Archive File created via "php woorelease.phar build repo_URL" (Composer version 2.5.5, npm version 10.7.0, node version 20.15.1) Status- Working expected with Plugin Archive/Zip file same as fix specific branch. Testing Environment
Next Step- Ready to Merge 🚀 |
All Submissions:
Changes proposed in this Pull Request:
The PR fixes the category reverting issue reported in #156. This issue was introduced due to the Square SDK upgrade, which updated the Square API version. The update added support for multiple categories and deprecated the category_id field. As a result, retrieving the category ID failed, causing categories to revert to the default WooCommerce category during sync. The PR makes the necessary changes to get the category from the Square catalog item and sync it with the Woo store.
Since Square now supports multiple categories, the plugin first looks for the reporting category to import. If the reporting category is not set, it uses the first category from the categories array of the catalog item.
Note
categories
andreporting_category
are still in BETA, but the previouscategory_id
field has been removed from the API. Therefore, I have used the newly added fields as suggested in the documentation.Closes #156
Steps to test the changes in this Pull Request:
Changelog entry