From 15896f8b6c836731b668de271b9eb9feb3f0907b Mon Sep 17 00:00:00 2001 From: w3bdesign <45217974+w3bdesign@users.noreply.github.com> Date: Fri, 10 Feb 2023 04:58:17 +0100 Subject: [PATCH 1/4] Stock display on single product --- components/Product/SingleProduct.component.jsx | 8 ++++++++ utils/gql/GQL_QUERIES.js | 1 + 2 files changed, 9 insertions(+) diff --git a/components/Product/SingleProduct.component.jsx b/components/Product/SingleProduct.component.jsx index aa842fa0f..6f214de4a 100644 --- a/components/Product/SingleProduct.component.jsx +++ b/components/Product/SingleProduct.component.jsx @@ -91,6 +91,14 @@ const SingleProduct = ({ product }) => {
{DESCRIPTION_WITHOUT_HTML}
+ {product.stockQuantity && ( ++ {product.stockQuantity} in stock +
+ )} {product.variations && (Varianter diff --git a/utils/gql/GQL_QUERIES.js b/utils/gql/GQL_QUERIES.js index f06cb1e4c..3a4e36c66 100644 --- a/utils/gql/GQL_QUERIES.js +++ b/utils/gql/GQL_QUERIES.js @@ -22,6 +22,7 @@ export const GET_SINGLE_PRODUCT = gql` regularPrice price id + stockQuantity } ... on VariableProduct { salePrice From 248d3c8130078307420647b0db5129e12e118fd4 Mon Sep 17 00:00:00 2001 From: w3bdesign <45217974+w3bdesign@users.noreply.github.com> Date: Fri, 10 Feb 2023 04:58:48 +0100 Subject: [PATCH 2/4] Fix translation --- components/Product/SingleProduct.component.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Product/SingleProduct.component.jsx b/components/Product/SingleProduct.component.jsx index 6f214de4a..25d6454be 100644 --- a/components/Product/SingleProduct.component.jsx +++ b/components/Product/SingleProduct.component.jsx @@ -96,7 +96,7 @@ const SingleProduct = ({ product }) => { v-if="data.product.stockQuantity" class="pt-1 mt-4 mb-4 text-2xl text-gray-900" > - {product.stockQuantity} in stock + {product.stockQuantity} på lager
)} {product.variations && ( From a7721edecd420e4c2acd770f55391a3b91ae46f7 Mon Sep 17 00:00:00 2001 From: w3bdesign <45217974+w3bdesign@users.noreply.github.com> Date: Fri, 10 Feb 2023 05:00:47 +0100 Subject: [PATCH 3/4] Stock status in variations --- components/Product/SingleProduct.component.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/Product/SingleProduct.component.jsx b/components/Product/SingleProduct.component.jsx index 25d6454be..bf8cae813 100644 --- a/components/Product/SingleProduct.component.jsx +++ b/components/Product/SingleProduct.component.jsx @@ -105,18 +105,18 @@ const SingleProduct = ({ product }) => {