Skip to content

Commit 0f5e123

Browse files
committed
fix different options with the same value conflicting (like stainless pencil)
1 parent dddd939 commit 0f5e123

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<div class="overflow-x-auto pr-64 edge-fade">
2121
<div class="flex w-fit">
2222
{#each option.values as value}
23-
{@const variants = product.variants.filter(v => v.options.includes(value))}
23+
{@const variants = product.variants.filter(v => v.options[option.position-1] === value)}
2424
{@const variant = variants.find(v => v.featured_media) ?? variants[0]}
2525
{@const inStock = !!variants.find(v => v.available)}
2626
{@const tag = `#${option.name.toLowerCase()}_${value.toLowerCase()}`}
@@ -55,7 +55,7 @@
5555
/>
5656
</a>
5757
{:else}
58-
{@const otherOptionVariants = product.variants.filter(v => !v.options.includes(value) && v.featured_media)}
58+
{@const otherOptionVariants = product.variants.filter(v => v.options[option.position-1] !== value && v.featured_media)}
5959
{#if otherOptionVariants.length > 0}
6060
<div class="flex justify-center items-center h-full w-full opacity-40 text-xs">
6161
No Image

0 commit comments

Comments
 (0)