Skip to content

Fix navigation bug #1373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 60 additions & 58 deletions components/Products/ProductsSingleProduct.vue
Original file line number Diff line number Diff line change
@@ -1,68 +1,70 @@
<template>
<template v-if="data?.product">
<section>
<div class="container flex flex-wrap items-center pt-4 pb-12 mx-auto">
<div
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"
>
<ProductImage
:alt="data.product.name"
:src="data.product.image.sourceUrl"
/>
<div class="ml-8">
<p class="text-3xl font-bold text-left">
{{ data.product.name }}
</p>
<ProductPrice
:product="data.product"
:shouldCenterPrice="false"
priceFontSize="big"
<div class="product-single-container">
<template v-if="data?.product">
<section>
<div class="container flex flex-wrap items-center pt-4 pb-12 mx-auto">
<div
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"
>
<ProductImage
:alt="data.product.name"
:src="data.product.image.sourceUrl"
/>
<p class="pt-1 mt-6 text-2xl text-gray-900">
{{ stripHTML(data.product.description) }}
</p>
<p
v-if="data.product.stockQuantity"
class="pt-1 mt-4 text-2xl text-gray-900"
>
{{ data.product.stockQuantity }} in stock
</p>
<p
v-if="data.product.variations"
class="pt-1 mt-4 text-xl text-gray-900"
>
<span class="py-2">Varianter</span>
<select
id="variant"
name="variant"
class="block w-64 px-6 py-2 bg-white border border-gray-500 rounded-lg focus:outline-none focus:shadow-outline"
v-model="selectedVariation"
<div class="ml-8">
<p class="text-3xl font-bold text-left">
{{ data.product.name }}
</p>
<ProductPrice
:product="data.product"
:shouldCenterPrice="false"
priceFontSize="big"
/>
<p class="pt-1 mt-6 text-2xl text-gray-900">
{{ stripHTML(data.product.description) }}
</p>
<p
v-if="data.product.stockQuantity"
class="pt-1 mt-4 text-2xl text-gray-900"
>
<option
v-for="(variation, index) in data.product.variations.nodes"
:key="variation.databaseId"
:value="variation.databaseId"
:selected="index === 0"
>
{{ filteredVariantName(data.product.name, variation.name) }}
({{ variation.stockQuantity }} in stock)
</option>
</select>
</p>
<div class="pt-1 mt-2">
<CommonButton
@common-button-click="addProductToCart(data.product)"
:is-loading="isLoading"
{{ data.product.stockQuantity }} in stock
</p>
<p
v-if="data.product.variations"
class="pt-1 mt-4 text-xl text-gray-900"
>
ADD TO CART
</CommonButton>
<span class="py-2">Varianter</span>
<select
id="variant"
name="variant"
class="block w-64 px-6 py-2 bg-white border border-gray-500 rounded-lg focus:outline-none focus:shadow-outline"
v-model="selectedVariation"
>
<option
v-for="(variation, index) in data.product.variations.nodes"
:key="variation.databaseId"
:value="variation.databaseId"
:selected="index === 0"
>
{{ filteredVariantName(data.product.name, variation.name) }}
({{ variation.stockQuantity }} in stock)
</option>
</select>
</p>
<div class="pt-1 mt-2">
<CommonButton
@common-button-click="addProductToCart(data.product)"
:is-loading="isLoading"
>
ADD TO CART
</CommonButton>
</div>
</div>
</div>
</div>
</div>
</section>
<Toast ref="toast" />
</template>
</section>
<Toast ref="toast" />
</template>
</div>
</template>

<script setup>
Expand Down