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 selectors for quantity element in variable products #36871
Merged
Konamiman
merged 3 commits into
woocommerce:trunk
from
clustercis:issues/36855-fix-selector-for-variable-qty
Feb 22, 2023
Merged
Fix selectors for quantity element in variable products #36871
Konamiman
merged 3 commits into
woocommerce:trunk
from
clustercis:issues/36855-fix-selector-for-variable-qty
Feb 22, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
plugin: woocommerce
Issues related to the WooCommerce Core plugin.
type: community contribution
labels
Feb 17, 2023
woocommercebot
requested review from
a team and
jorgeatorres
and removed request for
a team
February 17, 2023 12:48
clustercis
changed the title
Issues/36855 fix selector for variable qty
Fix selectors for quantity element in variable products
Feb 17, 2023
5 tasks
…antity selector of variable products Fixes bug introduced in PR woocommerce#36087 that changes jQuery selectors for quantity input in variable products. The previous logic is reinstated so that $qty points to the div wrapper, and $qty_input points to the input element inside. Otherwise, as is in the current version, $qty_input is undefined and the min/max attributes are not updated. This PR also addresses the original issue woocommerce#36086 by restricting the selector of the div wrapper to only be the one containing input[name=quantity] (the .qty class filter is also kept to avoid any potential malfunctions of existing code).
clustercis
force-pushed
the
issues/36855-fix-selector-for-variable-qty
branch
from
February 17, 2023 12:56
ec2a60c
to
e0aa482
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## trunk #36871 +/- ##
========================================
Coverage 46.7% 46.7%
Complexity 17171 17171
========================================
Files 429 429
Lines 64762 64762
========================================
+ Hits 30220 30222 +2
+ Misses 34542 34540 -2
|
Konamiman
approved these changes
Feb 22, 2023
5 tasks
5 tasks
github-actions bot
pushed a commit
that referenced
this pull request
Mar 17, 2023
Fixes bug introduced in PR #36087 that changes jQuery selectors for quantity input in variable products. The previous logic is reinstated so that $qty points to the div wrapper, and $qty_input points to the input element inside. Otherwise, as is in the current version, $qty_input is undefined and the min/max attributes are not updated. This PR also addresses the original issue #36086 by restricting the selector of the div wrapper to only be the one containing input[name=quantity] (the .qty class filter is also kept to avoid any potential malfunctions of existing code).
jonathansadowski
pushed a commit
that referenced
this pull request
Mar 17, 2023
* Fix selectors for quantity element in variable products (#36871) Fixes bug introduced in PR #36087 that changes jQuery selectors for quantity input in variable products. The previous logic is reinstated so that $qty points to the div wrapper, and $qty_input points to the input element inside. Otherwise, as is in the current version, $qty_input is undefined and the min/max attributes are not updated. This PR also addresses the original issue #36086 by restricting the selector of the div wrapper to only be the one containing input[name=quantity] (the .qty class filter is also kept to avoid any potential malfunctions of existing code). * Prep for cherry pick 36871 --------- Co-authored-by: Cluster CIS <37690192+clustercis@users.noreply.github.com> Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
All Submissions:
Changes proposed in this Pull Request:
Closes #36855 to fix bug introduced by PR #36087.
Also addresses original issue #36086.
Edit 2023-02-20 (added details from commit message):
WooCommerce 7.4.0 changed the jQuery selectors for the quantity input in variable products.
This PR reinstates the previous logic so that
$qty
points to the div wrapper, and$qty_input
points to the input element inside.Otherwise, as is in the affected version,
$qty_input
is undefined and the min/max attributes are not updated.It also addresses the original issue #36086 by restricting the selector of the div wrapper to only be the one containing
input[name=quantity]
(the.qty
class filter is also kept to avoid any potential malfunctions of existing code).How to test the changes in this Pull Request:
Quantity selector works properly (adapted from steps to reproduce in #36855):
Quantity selector does not affect other inputs (adapted from testing instructions in #36087):
Add the following snippet, which adds a new quantity input to the single variation:
Other information:
pnpm --filter=<project> changelog add
?FOR PR REVIEWER ONLY:
cc @barryhughes