Skip to content

Commit a7721ed

Browse files
committed
Stock status in variations
1 parent 248d3c8 commit a7721ed

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

components/Product/SingleProduct.component.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,18 @@ const SingleProduct = ({ product }) => {
105105
<select
106106
id="variant"
107107
name="variant"
108-
className="block w-64 px-6 py-2 bg-white border border-gray-500 rounded-lg focus:outline-none focus:shadow-outline"
108+
className="block w-80 px-6 py-2 bg-white border border-gray-500 rounded-lg focus:outline-none focus:shadow-outline"
109109
onChange={(e) => {
110110
setselectedVariation(e.target.value);
111111
}}
112112
>
113113
{product.variations.nodes.map(
114-
({ id, name, databaseId }) => {
114+
({ id, name, databaseId, stockQuantity }) => {
115115
// Remove product name from variation name
116116
const filteredName = name.split('- ').pop();
117117
return (
118118
<option key={id} value={databaseId}>
119-
{filteredName}
119+
{filteredName} - ({stockQuantity} på lager)
120120
</option>
121121
);
122122
}

0 commit comments

Comments
 (0)