Skip to content

Commit cea5e71

Browse files
committed
dont show 0 stock when its in stock
1 parent e806b87 commit cea5e71

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/routes/(info)/lttstore/products/[handle]/VariantDisplay.svelte

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,11 @@
9393
{#if stock}
9494
{@const variantTitles = variants.map(v => v.title)}
9595
{@const total = Object.entries(stock).reduce((acc, [k, v]) => variantTitles.includes(k) ? acc + (v ?? 0) : acc, 0)}
96-
{commas(total)} in stock
96+
{#if total !== 0}
97+
{commas(total)} in stock
98+
{:else}
99+
In Stock
100+
{/if}
97101
{:else}
98102
In stock
99103
{/if}

0 commit comments

Comments
 (0)