Skip to content

Commit a23800c

Browse files
committed
Update AddToCart.component.tsx
1 parent 3c20893 commit a23800c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/components/Product/AddToCart.component.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ export interface IProductRootObject {
9090
* @param {number} variationId // Variation ID
9191
* @param {boolean} fullWidth // Whether the button should be full-width
9292
*/
93-
9493
const AddToCart = ({
9594
product,
9695
variationId,
@@ -141,7 +140,6 @@ const AddToCart = ({
141140
// Refetch cart immediately after adding to cart
142141
await refetch();
143142
} catch (error) {
144-
console.error('Error adding to cart:', error);
145143
setRequestError(true);
146144
}
147145
};
@@ -155,6 +153,12 @@ const AddToCart = ({
155153
>
156154
KJØP
157155
</Button>
156+
{requestError && (
157+
<p>
158+
Det oppstod en feil ved tillegging i handlekurven. Vennligst prøv
159+
igjen.
160+
</p>
161+
)}
158162
</>
159163
);
160164
};

0 commit comments

Comments
 (0)