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

Ensure the "Uncaught TypeError" JavaScript console error does not occur for out-of-stock products. #170

Merged
merged 2 commits into from
Aug 2, 2024

Conversation

iamdharmesh
Copy link
Member

@iamdharmesh iamdharmesh commented Jul 8, 2024

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:

This PR makes minor changes to fix the "Uncaught TypeError" reported in issue #136. The error occurred because the JS code was trying to access the amount property of an undefined object.

Note

A customer also reported an issue with the product image, but this issue is not reproducible by me or the reporter. It seems to be related to a specific theme only. Therefore, this PR fixes the "Uncaught TypeError" as the root issue to resolve.

Closes #136

Steps to test the changes in this Pull Request:

  1. Enable digital wallets in your Square settings.
  2. Set a product to be out of stock.
  3. Visit the shop or product page.
  4. Verify there is no console error as reported in Out of stock products Uncaught reading 'amount' error. #136

Changelog entry

Fix - Ensure the "Uncaught TypeError" JavaScript console error does not occur for out-of-stock products.

@iamdharmesh iamdharmesh added this to the Future Release milestone Jul 8, 2024
@iamdharmesh iamdharmesh self-assigned this Jul 8, 2024
@iamdharmesh iamdharmesh requested a review from dkotter July 8, 2024 12:54
@dkotter
Copy link
Contributor

dkotter commented Jul 8, 2024

This can go to UAT once QA passes

@qasumitbagthariya
Copy link
Contributor

qasumitbagthariya commented Jul 11, 2024

QA Update ✅


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

Testing Environment

  • WordPress: 6.5.5
  • Theme: Storefront 4.6.0
  • Theme: Twenty Twenty-Four 1.1
  • WooCommerce - 9.0.2
  • PHP: 8.0.30
  • Web Server: Nginx 1.20.2
  • Browser: Chrome
  • OS: macOS Ventura 13.3

image

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

  • Yes
  • Not Required/Applicable for this PR

@qasumitbagthariya
Copy link
Contributor

Regression / Smoke Test Report ✅

Tested with Archive File created via "php woorelease.phar build repo_URL" (Composer version 2.5.5, npm version 8.19.4, node version 16.20.0)

Status- Working expected with Plugin Archive/Zip file same as fix specific branch.

Testing Environment

  • WordPress: 6.6.1
  • Theme: Storefront 4.6.0
  • Theme: Twenty Twenty-Four 1.2
  • WooCommerce - 9.1.2
  • PHP: 8.0.30
  • Web Server: Nginx 1.20.2
  • Browser: Chrome
  • OS: macOS Ventura 13.3

Next Step- Ready to Merge 🚀

@vikrampm1 vikrampm1 modified the milestones: Future Release, 4.7.3 Aug 2, 2024
@vikrampm1 vikrampm1 marked this pull request as ready for review August 2, 2024 14:48
@vikrampm1 vikrampm1 merged commit cac442a into trunk Aug 2, 2024
5 of 6 checks passed
@vikrampm1 vikrampm1 deleted the fix/136 branch August 2, 2024 14:48
@vikrampm1 vikrampm1 mentioned this pull request Aug 2, 2024
18 tasks
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.

Out of stock products Uncaught reading 'amount' error.
4 participants