-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Allow filtering option values by variant for the Option Value promotion rule #5200
Allow filtering option values by variant for the Option Value promotion rule #5200
Conversation
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.
Nice work.
75f0748
to
98510ec
Compare
This fixes filtering option values by variants_product_id, making the option value select in the option value promotion rule do the expected thing.
By passing an element instead of a selector, we can tell the optionValueAutocomplete instance about the related productSelect.
98510ec
to
f72106b
Compare
@mamhoff Thanks a lot! I think I am missing some context here: it's not immediate to get looking at the files changed or reading the description, in which admin page can we see this in action? |
This is a promotion rule, so you'd have to add the "Option Value(s)" rule to an existing promotion on |
Codecov Report
@@ Coverage Diff @@
## main #5200 +/- ##
=======================================
Coverage 88.67% 88.67%
=======================================
Files 564 564
Lines 13893 13894 +1
=======================================
+ Hits 12319 12320 +1
Misses 1574 1574
📣 We’re building smart automated test selection to slash your CI/CD build times. 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.
🐛 🔍
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 consider this to be a bugfix, added the appropriate label. Thanks @mamhoff!
Summary
This fixes some long-standing issues with the interaction between option Value Select and product Select on the Option Value Promotion Rule form.
Without this PR, the option values would not be scoped to the selected product, because option values didn't allow searching by variant product ID, and because the selector passed into the option value select would select elements anywhere on the page.
Luckily, jQuery accepts elements just as well as query strings.
You can test this with the sandbox: The Solidus hoodie does not have "blue" and "black" as option types, while the Solidus T-Shirt does.
Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: