From a23800c87819267f84c0974694be838d1aa21596 Mon Sep 17 00:00:00 2001 From: w3bdesign <45217974+w3bdesign@users.noreply.github.com> Date: Wed, 23 Oct 2024 05:42:40 +0200 Subject: [PATCH] Update AddToCart.component.tsx --- src/components/Product/AddToCart.component.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/Product/AddToCart.component.tsx b/src/components/Product/AddToCart.component.tsx index 6875e2022..e95ac6543 100644 --- a/src/components/Product/AddToCart.component.tsx +++ b/src/components/Product/AddToCart.component.tsx @@ -90,7 +90,6 @@ export interface IProductRootObject { * @param {number} variationId // Variation ID * @param {boolean} fullWidth // Whether the button should be full-width */ - const AddToCart = ({ product, variationId, @@ -141,7 +140,6 @@ const AddToCart = ({ // Refetch cart immediately after adding to cart await refetch(); } catch (error) { - console.error('Error adding to cart:', error); setRequestError(true); } }; @@ -155,6 +153,12 @@ const AddToCart = ({ > KJØP + {requestError && ( +

+ Det oppstod en feil ved tillegging i handlekurven. Vennligst prøv + igjen. +

+ )} ); };