summary section fix
This commit is contained in:
@@ -25,7 +25,7 @@ type SummarySectionProps = {
|
|||||||
export const SummarySection = ({ cartModal, onToggleCartModal, deliveryType }: SummarySectionProps) => {
|
export const SummarySection = ({ cartModal, onToggleCartModal, deliveryType }: SummarySectionProps) => {
|
||||||
|
|
||||||
const { t } = useTranslation('parallels', { keyPrefix: 'OrderDetail' });
|
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 { description, reset: resetCart } = useCartStore();
|
||||||
const { mutate: createOrder, isPending: isCreateOrderPending } = useCreateOrder();
|
const { mutate: createOrder, isPending: isCreateOrderPending } = useCreateOrder();
|
||||||
const { mutate: saveAllMethod, isPending: isSaveAllMethodPending } = useSaveAllMethod()
|
const { mutate: saveAllMethod, isPending: isSaveAllMethodPending } = useSaveAllMethod()
|
||||||
@@ -64,10 +64,12 @@ export const SummarySection = ({ cartModal, onToggleCartModal, deliveryType }: S
|
|||||||
const total = cartData?.data?.total ?? 0;
|
const total = cartData?.data?.total ?? 0;
|
||||||
|
|
||||||
const handleSubmit = () => {
|
const handleSubmit = () => {
|
||||||
if (!isSelectedAddress && isSelectedShipment && isCourierDelivery) {
|
console.log('sele', storeDeliveryType);
|
||||||
toast('لطفا آدرس را انتخاب کنید', 'error');
|
|
||||||
return;
|
// if (!isSelectedAddress && isSelectedShipment && isCourierDelivery) {
|
||||||
}
|
// toast('لطفا آدرس را انتخاب کنید', 'error');
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
if (!isSelectedShipment) {
|
if (!isSelectedShipment) {
|
||||||
toast('لطفا روش تحویل را انتخاب کنید', 'error');
|
toast('لطفا روش تحویل را انتخاب کنید', 'error');
|
||||||
return;
|
return;
|
||||||
@@ -89,10 +91,10 @@ export const SummarySection = ({ cartModal, onToggleCartModal, deliveryType }: S
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isDeliveryCar && !isDineIn && !selectedAddressId) {
|
// if (!isDeliveryCar && !isDineIn && !selectedAddressId) {
|
||||||
toast('لطفا آدرس را انتخاب کنید', 'error');
|
// toast('لطفا آدرس را انتخاب کنید', 'error');
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
const saveAllMethodData = {
|
const saveAllMethodData = {
|
||||||
description: description || '',
|
description: description || '',
|
||||||
|
|||||||
Reference in New Issue
Block a user