Skip to content

Conversation

@triple0t
Copy link
Contributor

Changes proposed in this Pull Request:

Closes #451

This PR skips the rest of the checks and consoles the error message instead of throwing the error, which might interfere with other scripts or processing.

The main aim of this PR is not to change the functionality, but rather to ensure that errors thrown here do not interfere with other scripts that might depend on the same event listener.

Checks:

  • Does your code follow the WordPress coding standards?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully run tests with your changes locally?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Screenshots:

Detailed test instructions:

Additional details:

Changelog entry

Tweak - Don't throw errors when the product ID is not found for legacy Ajax add-to-cart

Copy link
Member

@eason9487 eason9487 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the work! LGTM.

Left two questions regarding the need for using optional chaining operators, but they are not blockers.

@eason9487 eason9487 assigned triple0t and unassigned eason9487 Sep 29, 2025
@triple0t triple0t merged commit d00f0a0 into trunk Sep 29, 2025
1 check passed
@triple0t triple0t deleted the skip-instead-of-throwing-error-when-product-id-is-not-found-for-legacy-ajax-add-to-cart branch September 29, 2025 08:39
@eason9487 eason9487 added the changelog: tweak Small change, that isn't actually very important. label Oct 1, 2025
@eason9487 eason9487 mentioned this pull request Oct 1, 2025
20 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: tweak Small change, that isn't actually very important.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Product id reading issue for variable product add-to-cart(AJAX)

3 participants