From a516b3a536bcc2fc83f4aea7f684c42b34e0eef8 Mon Sep 17 00:00:00 2001 From: Unchained Date: Sun, 29 Mar 2026 20:49:52 +0200 Subject: [PATCH] fix: Remove auto-order confirmation code The order confirmation requires MANAGE_ORDERS permission which the storefront API token doesn't have. Removing the auto-confirmation attempt to prevent console errors. Orders will remain UNCONFIRMED until manually confirmed in Saleor Dashboard. --- src/app/[locale]/checkout/page.tsx | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/app/[locale]/checkout/page.tsx b/src/app/[locale]/checkout/page.tsx index d517325..67ffd86 100644 --- a/src/app/[locale]/checkout/page.tsx +++ b/src/app/[locale]/checkout/page.tsx @@ -13,7 +13,6 @@ import { saleorClient } from "@/lib/saleor/client"; import { useAnalytics } from "@/lib/analytics"; import { CHECKOUT_SHIPPING_ADDRESS_UPDATE, - ORDER_CONFIRM, } from "@/lib/saleor/mutations/Checkout"; import { PaymentSection } from "./components/PaymentSection"; import { DEFAULT_PAYMENT_METHOD } from "@/lib/config/paymentMethods"; @@ -308,21 +307,6 @@ export default function CheckoutPage() { setOrderNumber(result.order.number); setOrderComplete(true); - // Auto-confirm the order - try { - console.log("Auto-confirming order:", result.order.id); - await saleorClient.mutate({ - mutation: ORDER_CONFIRM, - variables: { - orderId: result.order.id, - }, - }); - console.log("Order confirmed successfully"); - } catch (confirmError) { - console.error("Failed to auto-confirm order:", confirmError); - // Don't fail the checkout if confirmation fails - } - // Clear the checkout/cart from the store clearCheckout();