Skip to content

Commit

Permalink
Stock display on single product
Browse files Browse the repository at this point in the history
  • Loading branch information
w3bdesign committed Feb 10, 2023
1 parent c4e1fad commit 15896f8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions components/Product/SingleProduct.component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ const SingleProduct = ({ product }) => {
<p className="pt-1 mt-4 text-2xl text-gray-900">
{DESCRIPTION_WITHOUT_HTML}
</p>
{product.stockQuantity && (
<p
v-if="data.product.stockQuantity"
class="pt-1 mt-4 mb-4 text-2xl text-gray-900"
>
{product.stockQuantity} in stock
</p>
)}
{product.variations && (
<p className="pt-1 mt-4 text-xl text-gray-900">
<span className="py-2">Varianter</span>
Expand Down
1 change: 1 addition & 0 deletions utils/gql/GQL_QUERIES.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const GET_SINGLE_PRODUCT = gql`
regularPrice
price
id
stockQuantity
}
... on VariableProduct {
salePrice
Expand Down

0 comments on commit 15896f8

Please sign in to comment.