Skip to content

Commit

Permalink
fix: out of stock indication for products with variants (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
olehrakwix authored Oct 9, 2024
1 parent bbb7494 commit 98d3c23
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/utils/product-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ export function isOutOfStock(
): boolean {
if (product.manageVariants) {
const selectedVariant = getSelectedVariant(product, selectedChoices);
if (selectedVariant?.stock?.trackQuantity === true) {
return selectedVariant?.stock?.quantity === 0;
} else {
if (selectedVariant !== undefined) {
return selectedVariant?.stock?.inStock === false;
}
}
Expand Down

0 comments on commit 98d3c23

Please sign in to comment.