Skip to content
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

Fix the 'Sync stock from Square' and 'Sync inventory' links on the edit product screen. #107

Draft
wants to merge 6 commits into
base: trunk
Choose a base branch
from

Conversation

iamdharmesh
Copy link
Member

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:

As reported in issue #104, the 'Sync stock from Square' and 'Sync inventory' links on the edit product screen are not working when Square is the SOR. After investigating, I discovered that this issue occurred because the event handler JavaScript code was accidentally removed by pull request https://github.com/woocommerce/woocommerce-square-private/pull/1086. This pull request restores the JavaScript code to ensure that the links work on the edit product screen.

Closes #104

Steps to test the changes in this Pull Request:

  1. Set up the Square plugin and enable sync with inventory sync enabled.
  2. Set "Square" as the SOR.
  3. Navigate to edit a Square-synced product.
  4. Go to the "Inventory" tab of product data and click the "Sync stock from Square" or "Sync inventory" link. (The "Sync stock from Square" link should be there for the products with inventory tracking enabled and "Sync inventory" link will be available for the product that has inventory tracking disabled)
  5. Verify that both links are working as expected now

Changelog entry

Fix - Ensure that the 'Sync stock from Square' and 'Sync inventory' links work properly on the edit product screen.

@iamdharmesh iamdharmesh self-assigned this Apr 19, 2024
@iamdharmesh iamdharmesh added this to the Future Release milestone Apr 19, 2024
@iamdharmesh iamdharmesh requested a review from dkotter May 9, 2024 09:00
@iamdharmesh
Copy link
Member Author

Note:

E2E tests are failing, but they are not related to this PR. Upon investigation, it was found that they are also failing on the trunk. On quick check didn't figured out the exact reason, but it is due to some errors on the block checkout. As we already have an open PR for the E2E tests, not making any changes here.

@dkotter
Copy link
Contributor

dkotter commented May 9, 2024

This can go to UAT once QA passes

@qasumitbagthariya
Copy link
Contributor

qasumitbagthariya commented May 14, 2024

QA Update ✅


I have checked this issue in the enhancement/104 branch and the related issue is resolved and working as expected.

Testing Environment

  • WordPress: 6.5.3
  • Theme: Twenty Twenty-Four 1.1
  • WooCommerce - 8.8.3
  • PHP: 8.0.30
  • Web Server: Nginx 1.20.2
  • Browser: Chrome
  • OS: macOS Ventura 13.3
sync.mp4

Steps to Test- As mentioned in the PR description.
Test Results - It is working as expected.
Functional Demo / Screencast -
Special Notes - Ready for UAT
Testing Document status:
Cases related to this Issue/PR are added to the Critical Flow Wiki pages:

  • Yes
  • Not Required/Applicable for this PR

@jeffpaul
Copy link
Contributor

Updated e2e tests pass, so I'm moving this along to UAT Approved.

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

Successfully merging this pull request may close these issues.

"Sync stock from Square" on the edit product screen is not working when Square is the SOR.
4 participants