Skip to content

Commit 15896f8

Browse files
committed
Stock display on single product
1 parent c4e1fad commit 15896f8

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

components/Product/SingleProduct.component.jsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ const SingleProduct = ({ product }) => {
9191
<p className="pt-1 mt-4 text-2xl text-gray-900">
9292
{DESCRIPTION_WITHOUT_HTML}
9393
</p>
94+
{product.stockQuantity && (
95+
<p
96+
v-if="data.product.stockQuantity"
97+
class="pt-1 mt-4 mb-4 text-2xl text-gray-900"
98+
>
99+
{product.stockQuantity} in stock
100+
</p>
101+
)}
94102
{product.variations && (
95103
<p className="pt-1 mt-4 text-xl text-gray-900">
96104
<span className="py-2">Varianter</span>

utils/gql/GQL_QUERIES.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export const GET_SINGLE_PRODUCT = gql`
2222
regularPrice
2323
price
2424
id
25+
stockQuantity
2526
}
2627
... on VariableProduct {
2728
salePrice

0 commit comments

Comments
 (0)