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

Add availableForSale to variant #808

Closed
wants to merge 1 commit into from
Closed

Conversation

powerwlsl
Copy link

Add to cart button should be disabled when there's no stock for each variant.

          <Button
            aria-label="Add to Cart"
            type="button"
            className={s.button}
            onClick={addToCart}
            loading={loading}
            disabled={variant?.availableForSale === false}
          >
            {variant?.availableForSale === false
              ? 'Not Available'
              : 'Add To Cart'}
          </Button>

image
image
image

@vercel
Copy link

vercel bot commented Aug 9, 2022

@powerwlsl is attempting to deploy a commit to the Vercel Solutions Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Aug 9, 2022

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

Name Status Preview Updated
commerce-bigcommerce ❌ Failed (Inspect) Aug 16, 2022 at 5:53AM (UTC)
commerce-commerce ❌ Failed (Inspect) Aug 16, 2022 at 5:53AM (UTC)
commerce-commercejs ❌ Failed (Inspect) Aug 16, 2022 at 5:53AM (UTC)
commerce-kibocommerce ❌ Failed (Inspect) Aug 16, 2022 at 5:53AM (UTC)
commerce-local ❌ Failed (Inspect) Aug 16, 2022 at 5:53AM (UTC)
commerce-ordercloud ❌ Failed (Inspect) Aug 16, 2022 at 5:53AM (UTC)
commerce-pbt01 ❌ Failed (Inspect) Aug 16, 2022 at 5:53AM (UTC)
commerce-saleor ❌ Failed (Inspect) Aug 16, 2022 at 5:53AM (UTC)
commerce-sfcc ❌ Failed (Inspect) Aug 16, 2022 at 5:53AM (UTC)
commerce-shopify ❌ Failed (Inspect) Aug 16, 2022 at 5:53AM (UTC)
commerce-site ❌ Failed (Inspect) Aug 16, 2022 at 5:53AM (UTC)
commerce-spree ❌ Failed (Inspect) Aug 16, 2022 at 5:53AM (UTC)
commerce-swell ✅ Ready (Inspect) Visit Preview Aug 16, 2022 at 5:53AM (UTC)
commerce-vendure ❌ Failed (Inspect) Aug 16, 2022 at 5:53AM (UTC)

@manovotny
Copy link
Collaborator

We appreciate the time you took to make this PR. We have decided to take Next.js Commerce in a new direction, but I am happy to say that this feature will be present in the upcoming release. Please see this PR for more details: #966

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