Skip to content

Commit 9779577

Browse files
committed
dont show "no image" text if no other options have images
1 parent 710d523 commit 9779577

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,12 @@
5555
/>
5656
</a>
5757
{:else}
58-
<div class="flex justify-center items-center h-full w-full opacity-40 text-xs">
59-
No Image
60-
</div>
58+
{@const otherOptionVariants = product.variants.filter(v => !v.options.includes(value) && v.featured_media)}
59+
{#if otherOptionVariants.length > 0}
60+
<div class="flex justify-center items-center h-full w-full opacity-40 text-xs">
61+
No Image
62+
</div>
63+
{/if}
6164
{/if}
6265
{/if}
6366
<a href="https://www.lttstore.com/products/{product.handle}?variant={variant?.id}" class="hidden-link block w-full mt-auto" class:opacity-80={!inStock}>

0 commit comments

Comments
 (0)