Skip to content

Commit fd9056d

Browse files
authored
Merge pull request #1373 from w3bdesign/dev
Fix navigation bug
2 parents db1d07e + 1129e10 commit fd9056d

File tree

1 file changed

+60
-58
lines changed

1 file changed

+60
-58
lines changed

components/Products/ProductsSingleProduct.vue

Lines changed: 60 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,70 @@
11
<template>
2-
<template v-if="data?.product">
3-
<section>
4-
<div class="container flex flex-wrap items-center pt-4 pb-12 mx-auto">
5-
<div
6-
class="grid grid-cols-1 gap-4 mt-8 lg:grid-cols-2 xl:grid-cols-2 md:grid-cols-2 sm:grid-cols-2"
7-
>
8-
<ProductImage
9-
:alt="data.product.name"
10-
:src="data.product.image.sourceUrl"
11-
/>
12-
<div class="ml-8">
13-
<p class="text-3xl font-bold text-left">
14-
{{ data.product.name }}
15-
</p>
16-
<ProductPrice
17-
:product="data.product"
18-
:shouldCenterPrice="false"
19-
priceFontSize="big"
2+
<div class="product-single-container">
3+
<template v-if="data?.product">
4+
<section>
5+
<div class="container flex flex-wrap items-center pt-4 pb-12 mx-auto">
6+
<div
7+
class="grid grid-cols-1 gap-4 mt-8 lg:grid-cols-2 xl:grid-cols-2 md:grid-cols-2 sm:grid-cols-2"
8+
>
9+
<ProductImage
10+
:alt="data.product.name"
11+
:src="data.product.image.sourceUrl"
2012
/>
21-
<p class="pt-1 mt-6 text-2xl text-gray-900">
22-
{{ stripHTML(data.product.description) }}
23-
</p>
24-
<p
25-
v-if="data.product.stockQuantity"
26-
class="pt-1 mt-4 text-2xl text-gray-900"
27-
>
28-
{{ data.product.stockQuantity }} in stock
29-
</p>
30-
<p
31-
v-if="data.product.variations"
32-
class="pt-1 mt-4 text-xl text-gray-900"
33-
>
34-
<span class="py-2">Varianter</span>
35-
<select
36-
id="variant"
37-
name="variant"
38-
class="block w-64 px-6 py-2 bg-white border border-gray-500 rounded-lg focus:outline-none focus:shadow-outline"
39-
v-model="selectedVariation"
13+
<div class="ml-8">
14+
<p class="text-3xl font-bold text-left">
15+
{{ data.product.name }}
16+
</p>
17+
<ProductPrice
18+
:product="data.product"
19+
:shouldCenterPrice="false"
20+
priceFontSize="big"
21+
/>
22+
<p class="pt-1 mt-6 text-2xl text-gray-900">
23+
{{ stripHTML(data.product.description) }}
24+
</p>
25+
<p
26+
v-if="data.product.stockQuantity"
27+
class="pt-1 mt-4 text-2xl text-gray-900"
4028
>
41-
<option
42-
v-for="(variation, index) in data.product.variations.nodes"
43-
:key="variation.databaseId"
44-
:value="variation.databaseId"
45-
:selected="index === 0"
46-
>
47-
{{ filteredVariantName(data.product.name, variation.name) }}
48-
({{ variation.stockQuantity }} in stock)
49-
</option>
50-
</select>
51-
</p>
52-
<div class="pt-1 mt-2">
53-
<CommonButton
54-
@common-button-click="addProductToCart(data.product)"
55-
:is-loading="isLoading"
29+
{{ data.product.stockQuantity }} in stock
30+
</p>
31+
<p
32+
v-if="data.product.variations"
33+
class="pt-1 mt-4 text-xl text-gray-900"
5634
>
57-
ADD TO CART
58-
</CommonButton>
35+
<span class="py-2">Varianter</span>
36+
<select
37+
id="variant"
38+
name="variant"
39+
class="block w-64 px-6 py-2 bg-white border border-gray-500 rounded-lg focus:outline-none focus:shadow-outline"
40+
v-model="selectedVariation"
41+
>
42+
<option
43+
v-for="(variation, index) in data.product.variations.nodes"
44+
:key="variation.databaseId"
45+
:value="variation.databaseId"
46+
:selected="index === 0"
47+
>
48+
{{ filteredVariantName(data.product.name, variation.name) }}
49+
({{ variation.stockQuantity }} in stock)
50+
</option>
51+
</select>
52+
</p>
53+
<div class="pt-1 mt-2">
54+
<CommonButton
55+
@common-button-click="addProductToCart(data.product)"
56+
:is-loading="isLoading"
57+
>
58+
ADD TO CART
59+
</CommonButton>
60+
</div>
5961
</div>
6062
</div>
6163
</div>
62-
</div>
63-
</section>
64-
<Toast ref="toast" />
65-
</template>
64+
</section>
65+
<Toast ref="toast" />
66+
</template>
67+
</div>
6668
</template>
6769

6870
<script setup>

0 commit comments

Comments
 (0)