We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c8511a9 commit f0c0cceCopy full SHA for f0c0cce
src/components/ProductForm/index.js
@@ -30,9 +30,9 @@ const ProductForm = ({ product }) => {
30
const result = fetchedProduct.variants.filter(
31
variant => variant.id === productVariant.shopifyId
32
)
33
- if (result.length > 0) {
34
- setAvailable(result[0].available)
35
- }
+ setAvailable(
+ result[0]?.available ?? fetchedProduct.variants[0].available
+ )
36
})
37
},
38
[client.product, productVariant.shopifyId]
0 commit comments