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

check for variant stock levels before disabling 'add to cart' button #1708

Merged
merged 3 commits into from
Dec 9, 2024

Conversation

EoinConway
Copy link
Contributor

What/Why?

This PR fixes an issue where the add to cart button only checks parent stock inventory. If the product has variants that are in stock, the button will incorrectly be disabled and show the outOfStock button text.

Testing

Tested on a product with variant stock levels. The add to cart button isn't disabled and user can add to cart as expected. Also tested on product with two variants- one with stock, and one out of stock. User can add the stocked variant to cart, but still won't be able to add unstocked variant, as expected.

@EoinConway EoinConway requested a review from a team as a code owner December 5, 2024 13:44
Copy link

vercel bot commented Dec 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
catalyst-latest ✅ Ready (Inspect) Visit Preview Dec 9, 2024 10:09am
catalyst-soul ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 9, 2024 10:09am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
catalyst-au ⬜️ Ignored (Inspect) Visit Preview Dec 9, 2024 10:09am
catalyst-uk ⬜️ Ignored (Inspect) Visit Preview Dec 9, 2024 10:09am

Copy link

vercel bot commented Dec 5, 2024

@EoinConway is attempting to deploy a commit to the BigCommerce Platform Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@jorgemoya jorgemoya 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 looking into this! This looks great, could we just add a changeset for this fix? Or I can do it, let me know.

Copy link

changeset-bot bot commented Dec 9, 2024

🦋 Changeset detected

Latest commit: 7fb2ac7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@bigcommerce/catalyst-core Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants