-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
🐛 Quick order list and combined listings #3373
🐛 Quick order list and combined listings #3373
Conversation
…ing product-info class and migrating product-update specific logic out of the VariantSelects class. A product wrapper enables children to more trivially perform global updates by providing a heirarchical "namespace"--i.e. child publishes event, parent captures and declaratively updates other children VS child updates siblings. By extracting the VariantSelects onChange logic to use this pattern, VariantSelects is able to be a single-purpose class, it is easier to understand why siblings are updated, and we were able to eliminate some really gross logic that handled variant change updates differently depending on the wrapping context.
…election is changed to a sibling
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 highly recommend hiding whitespace to make this diff easier to understand
confirm: 'confirm', | ||
remove: 'remove', | ||
cancel: 'cancel' | ||
if (!customElements.get('quick-order-list-remove-button')) { |
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.
We actually already have these changes on main
. It was from the quick add bulk PR
https://github.com/Shopify/dawn/blob/main/assets/quick-order-list.js#L1
I recommend rebasing off of main
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.
oh amazing 🙏 🙏 🙏 🙏
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.
Ill review again when it's updated :)
I also see this PR https://screenshot.click/28-40-bgg2h-6n5o1.png
has conflicts that need to be fixed #3289
2a22f8a
to
7e35aa4
Compare
Closing, this has been fixed by a few other PRs |
PR Summary:
Fixes JS error when reloading the quick order list section and titles for combined listings products
What approach did you take?
JS error
Variant titles
has_only_default_variant
to determine whether a variant is default or not, becausehas_only_default_variant
still returnsfalse
if a combined listing is made up of child products that each only have a single variant. For example, if we have a combined listing "Pants" that has children "Pants - blue", "Pants - green" where both blue and green have no additional options, the product has 2 total variants where each is a default variant.is_default_variant
value. This also enabled us to simplify quick order list row input to just take a variant instead of a product or a variant.Default title
instead of the product title.Visual impact on existing themes
Combined listing parent
Before
After
Combined listing child
Before
After
Product with options
Before
After
Product with only default variant
Before
After
Demo links
Links
Steps
with PR changes
, theme before the changes is calledwithout PR changes
Uncaught SyntaxError: Identifier 'QuickOrderListRemoveButton' has already been declared (at quick-order-list.js:1:1)
when switching optionsChecklist