From dab66a2dce0d73d44fabf22de47498915b715d52 Mon Sep 17 00:00:00 2001 From: devops Date: Sun, 18 Oct 2026 16:16:15 +0000 Subject: [PATCH] fix(checkout): guard against empty cart order submission and disable checkout CTA [FE-008] --- frontend/application/components/CheckoutPage.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/application/components/CheckoutPage.tsx b/frontend/application/components/CheckoutPage.tsx index 0ab25df5..e30132fc 100644 --- a/frontend/application/components/CheckoutPage.tsx +++ b/frontend/application/components/CheckoutPage.tsx @@ -126,6 +126,12 @@ export default function CheckoutPage() { }; const handleFinalize = async () => { + if (!items.length || getSubtotal() <= 0) { + toast.error("سبد خرید شما خالی است."); + router.push('/shop'); + return; + } + const totalAmount = getTotal() + shippingFee; const activePet = getActivePet();