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

Update updateQuantityRules function #3515

Merged
merged 1 commit into from
Jun 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions assets/product-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ if (!customElements.get('product-info')) {
}

updateQuantityRules(sectionId, html) {
if (!this.quantityInput) return;
Copy link
Contributor

Choose a reason for hiding this comment

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

Connected it to the store and it looks good 👍 https://admin.shopify.com/store/os2-demo/themes/163387473942/editor

However I think we should do this check in even before running the updateQuantityRules function 🤔

What do you think? cc @ludoboludo

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's fine as is 🤔 We do the same approach within the initQuantityHandlers() method 👍 return.

And in a few other places in the theme. There is definitely a mix of approaches but I think it's good here since the method is called a couple times. Instead of adding this check twice having it part of the method seem good because it takes care of all the logic itself.

this.setQuantityBoundries();

const quantityFormUpdated = html.getElementById(`Quantity-Form-${sectionId}`);
Expand Down
Loading