This commit is contained in:
cond0r 2021-05-28 10:35:36 +03:00
parent 05ee6d2bee
commit bf80e3b4b9
4 changed files with 4 additions and 8 deletions

View File

@ -148,9 +148,8 @@ const ProductView: FC<Props> = ({ product }) => {
loading={loading}
disabled={variant?.availableForSale === false}
>
{variant?.isInStock === false &&
variant?.availableForSale === false
? 'Sold Out'
{variant?.availableForSale === false
? 'Not Available'
: 'Add To Cart'}
</Button>
</div>

View File

@ -62,7 +62,6 @@ const normalizeProductVariants = ({ edges }: ProductVariantConnection) => {
compareAtPriceV2,
requiresShipping,
availableForSale,
quantityAvailable,
},
}) => {
return {
@ -73,7 +72,6 @@ const normalizeProductVariants = ({ edges }: ProductVariantConnection) => {
listPrice: +compareAtPriceV2?.amount,
requiresShipping,
availableForSale,
isInStock: Number(quantityAvailable) > 0,
options: selectedOptions.map(({ name, value }: SelectedOption) => {
const options = normalizeProductOption({
id,

View File

@ -34,7 +34,6 @@ const getProductQuery = /* GraphQL */ `
title
sku
availableForSale
quantityAvailable
requiresShipping
selectedOptions {
name

View File

@ -22,8 +22,8 @@
"@components/*": ["components/*"],
"@commerce": ["framework/commerce"],
"@commerce/*": ["framework/commerce/*"],
"@framework": ["framework/vendure"],
"@framework/*": ["framework/vendure/*"]
"@framework": ["framework/bigcommerce"],
"@framework/*": ["framework/bigcommerce/*"]
}
},
"include": ["next-env.d.ts", "**/*.d.ts", "**/*.ts", "**/*.tsx", "**/*.js"],