Skip to content

Commit

Permalink
Stock status in variations
Browse files Browse the repository at this point in the history
  • Loading branch information
w3bdesign committed Feb 10, 2023
1 parent 248d3c8 commit a7721ed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/Product/SingleProduct.component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,18 +105,18 @@ const SingleProduct = ({ product }) => {
<select
id="variant"
name="variant"
className="block w-64 px-6 py-2 bg-white border border-gray-500 rounded-lg focus:outline-none focus:shadow-outline"
className="block w-80 px-6 py-2 bg-white border border-gray-500 rounded-lg focus:outline-none focus:shadow-outline"
onChange={(e) => {
setselectedVariation(e.target.value);
}}
>
{product.variations.nodes.map(
({ id, name, databaseId }) => {
({ id, name, databaseId, stockQuantity }) => {
// Remove product name from variation name
const filteredName = name.split('- ').pop();
return (
<option key={id} value={databaseId}>
{filteredName}
{filteredName} - ({stockQuantity} på lager)
</option>
);
}
Expand Down

0 comments on commit a7721ed

Please sign in to comment.