Skip to content

feat(cart): check stock and disable checkout if items unavailable #2443

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

Open
wants to merge 1 commit into
base: canary
Choose a base branch
from

Conversation

manumokalab
Copy link

What/Why?

This pull request introduces stock availability validation to the cart page. Previously, products that were out of stock (or no longer saleable) could still appear in the cart and be processed at checkout, leading to confusion or errors during purchase.

Changes include:

  • Checking stock availability (isInStock) for each line item using getStreamableProduct.
  • Displaying a visual message below the product title when an item is out of stock.
  • Preventing the user from proceeding to checkout if any item in the cart is unavailable.

This improvement ensures a more accurate and trustworthy checkout flow for users.

Related to the discussion here: #2442

Testing

  • Manually tested with both simple and variant products.
  • Confirmed that out-of-stock items correctly show the message and block the checkout button.
  • Verified that products in stock behave normally and allow checkout.

Steps to test:

  1. Add a product with known out-of-stock status to the cart.
  2. Go to the cart page.
  3. Observe the "out of stock" message and disabled checkout.
  4. Try again with only available products to confirm normal behavior.

Migration

No breaking changes or file movements were introduced. No migration steps required.

…tock messaging

- Added stock availability checks for line items in the cart.
- Introduced an out-of-stock message in the cart UI.
- Updated the checkout button to be disabled if any items are out of stock.
- Enhanced the cart item display to show stock status.
@manumokalab manumokalab requested a review from a team as a code owner June 20, 2025 07:51
Copy link

changeset-bot bot commented Jun 20, 2025

⚠️ No Changeset found

Latest commit: 956a52e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link

vercel bot commented Jun 20, 2025

@manumokalab 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

vercel bot commented Jun 20, 2025

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

Name Status Preview Comments Updated (UTC)
catalyst-canary ✅ Ready (Inspect) Visit Preview Jun 20, 2025 3:17pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
catalyst-au ⬜️ Ignored (Inspect) Visit Preview Jun 20, 2025 3:17pm
catalyst-uk ⬜️ Ignored (Inspect) Visit Preview Jun 20, 2025 3:17pm

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.

1 participant