|
1 | 1 | <template> |
2 | | - <div v-if="allCategoryProducts?.productCategory?.products?.nodes"> |
| 2 | + <template v-if="allCategoryProducts?.productCategory?.products?.nodes"> |
3 | 3 | <section> |
4 | 4 | <div id="product-container" class="flex flex-wrap items-center"> |
5 | | - <template |
6 | | - v-for="product in allCategoryProducts.productCategory.products.nodes" |
7 | | - > |
8 | | - <div |
9 | | - v-if="product.slug" |
10 | | - :key="product.id" |
11 | | - class="flex flex-col mt-6 sm:w1/2 md:w-1/3 lg:w-1/4 lg:mr-4" |
12 | | - > |
13 | | - <NuxtLink |
14 | | - class="text-black cursor-pointer hover:underline" |
15 | | - :to="{ |
16 | | - path: '/product/' + product.slug, |
17 | | - query: { id: product.databaseId }, |
18 | | - }" |
19 | | - > |
| 5 | + <template v-for="product in allCategoryProducts.productCategory.products.nodes"> |
| 6 | + <div v-if="product.slug" :key="product.id" class="flex flex-col mt-6 sm:w1/2 md:w-1/3 lg:w-1/4 lg:mr-4"> |
| 7 | + <NuxtLink class="text-black cursor-pointer hover:underline" :to="{ |
| 8 | + path: '/product/' + product.slug, |
| 9 | + query: { id: product.databaseId }, |
| 10 | + }"> |
20 | 11 | <ProductImage :alt="product.name" :src="productImage(product)" /> |
21 | 12 |
|
22 | 13 | <div class="flex justify-center pt-3"> |
|
28 | 19 | <div v-if="product.onSale" class="flex justify-center mt-2"> |
29 | 20 | <div class="text-lg text-gray-900 line-through"> |
30 | 21 | <span v-if="product.variations"> |
31 | | - {{ filteredVariantPrice(product.price, "right") }}</span |
32 | | - > |
| 22 | + {{ filteredVariantPrice(product.price, "right") }}</span> |
33 | 23 | <span v-else>{{ product.regularPrice }}</span> |
34 | 24 | </div> |
35 | 25 | <div class="ml-4 text-xl text-gray-900"> |
36 | 26 | <span v-if="product.variations"> |
37 | | - {{ filteredVariantPrice(product.price) }}</span |
38 | | - > |
| 27 | + {{ filteredVariantPrice(product.price) }}</span> |
39 | 28 | <span v-else>{{ product.salePrice }}</span> |
40 | 29 | </div> |
41 | 30 | </div> |
|
48 | 37 | </template> |
49 | 38 | </div> |
50 | 39 | </section> |
51 | | - </div> |
| 40 | + </template> |
52 | 41 | <div v-else> |
53 | 42 | <section> |
54 | 43 | <div id="product-container" class="flex flex-wrap items-center"> |
55 | 44 | <template v-for="product in allProducts.products.nodes"> |
56 | | - <div |
57 | | - v-if="product.slug" |
58 | | - :key="product.id" |
59 | | - class="flex flex-col mt-6 sm:w1/2 md:w-1/3 lg:w-1/4 lg:mr-4" |
60 | | - > |
61 | | - <NuxtLink |
62 | | - class="text-black cursor-pointer hover:underline" |
63 | | - :to="{ |
64 | | - path: '/product/' + product.slug, |
65 | | - query: { id: product.databaseId }, |
66 | | - }" |
67 | | - > |
| 45 | + <div v-if="product.slug" :key="product.id" class="flex flex-col mt-6 sm:w1/2 md:w-1/3 lg:w-1/4 lg:mr-4"> |
| 46 | + <NuxtLink class="text-black cursor-pointer hover:underline" :to="{ |
| 47 | + path: '/product/' + product.slug, |
| 48 | + query: { id: product.databaseId }, |
| 49 | + }"> |
68 | 50 | <ProductImage :alt="product.name" :src="productImage(product)" /> |
69 | 51 | <div class="flex justify-center pt-3"> |
70 | 52 | <p class="text-2xl font-bold text-center cursor-pointer"> |
71 | 53 | {{ product.name }} |
72 | 54 | </p> |
73 | 55 | </div> |
74 | 56 | </NuxtLink> |
75 | | - <ProductPrice |
76 | | - :product="product" |
77 | | - priceFontSize="normal" |
78 | | - :shouldCenterPrice="true" |
79 | | - /> |
| 57 | + <ProductPrice :product="product" priceFontSize="normal" :shouldCenterPrice="true" /> |
80 | 58 | </div> |
81 | 59 | </template> |
82 | 60 | </div> |
|
0 commit comments