From 2642b04d05535015eaed4060b19e2b3272db53eb Mon Sep 17 00:00:00 2001 From: hamid zarghami Date: Sat, 27 Dec 2025 16:31:21 +0330 Subject: [PATCH] summary section fix --- .../[id]/components/SummarySection.tsx | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/app/[name]/(Dialogs)/order/checkout/[id]/components/SummarySection.tsx b/src/app/[name]/(Dialogs)/order/checkout/[id]/components/SummarySection.tsx index 7e57f6b..cec63d0 100644 --- a/src/app/[name]/(Dialogs)/order/checkout/[id]/components/SummarySection.tsx +++ b/src/app/[name]/(Dialogs)/order/checkout/[id]/components/SummarySection.tsx @@ -25,7 +25,7 @@ type SummarySectionProps = { export const SummarySection = ({ cartModal, onToggleCartModal, deliveryType }: SummarySectionProps) => { const { t } = useTranslation('parallels', { keyPrefix: 'OrderDetail' }); - const { isSelectedAddress, isSelectedShipment, isSelectedPayment, deliveryType: storeDeliveryType, paymentType, selectedAddressId, tableNumber, carAddress, clear } = useCheckoutStore(); + const { isSelectedShipment, isSelectedPayment, deliveryType: storeDeliveryType, paymentType, selectedAddressId, tableNumber, carAddress, clear } = useCheckoutStore(); const { description, reset: resetCart } = useCartStore(); const { mutate: createOrder, isPending: isCreateOrderPending } = useCreateOrder(); const { mutate: saveAllMethod, isPending: isSaveAllMethodPending } = useSaveAllMethod() @@ -64,10 +64,12 @@ export const SummarySection = ({ cartModal, onToggleCartModal, deliveryType }: S const total = cartData?.data?.total ?? 0; const handleSubmit = () => { - if (!isSelectedAddress && isSelectedShipment && isCourierDelivery) { - toast('لطفا آدرس را انتخاب کنید', 'error'); - return; - } + console.log('sele', storeDeliveryType); + + // if (!isSelectedAddress && isSelectedShipment && isCourierDelivery) { + // toast('لطفا آدرس را انتخاب کنید', 'error'); + // return; + // } if (!isSelectedShipment) { toast('لطفا روش تحویل را انتخاب کنید', 'error'); return; @@ -89,10 +91,10 @@ export const SummarySection = ({ cartModal, onToggleCartModal, deliveryType }: S return; } - if (!isDeliveryCar && !isDineIn && !selectedAddressId) { - toast('لطفا آدرس را انتخاب کنید', 'error'); - return; - } + // if (!isDeliveryCar && !isDineIn && !selectedAddressId) { + // toast('لطفا آدرس را انتخاب کنید', 'error'); + // return; + // } const saveAllMethodData = { description: description || '',