diff options
Diffstat (limited to 'src/lib/checkout/components/SectionExpedition.jsx')
| -rw-r--r-- | src/lib/checkout/components/SectionExpedition.jsx | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/lib/checkout/components/SectionExpedition.jsx b/src/lib/checkout/components/SectionExpedition.jsx index 8b59d210..5b4f6bfc 100644 --- a/src/lib/checkout/components/SectionExpedition.jsx +++ b/src/lib/checkout/components/SectionExpedition.jsx @@ -228,13 +228,10 @@ export default function SectionExpedition({ products }) { } ); - console.log('ini response', data); - useEffect(() => { if (data) { const couriers = reverseMappingCourier(listExpedisi, data?.data?.pricing); setCouriers(couriers); - console.log('ini scourier', couriers); } }, [data]); @@ -249,7 +246,15 @@ export default function SectionExpedition({ products }) { setSelectedCourier(courier.courier.courier_code); setServiceOptions(Object.values(courier.courier.service_type)); } else { - toast.error('Maaf, layanan tidak tersedia. Mohon pilih expedisi lain.'); + if ((courier.label === 'GRAB' || courier.label === 'GOJEK') && !addressMaps) { + toast.error( + 'Maaf, layanan kurir ' + courier.label + ' tidak tersedia. Karena Anda Belum Melakukan Pengaturan PinPoint Alamat Pegiriman.' + ) + } else { + toast.error( + 'Maaf, layanan tidak tersedia. Mohon pilih expedisi lain.' + ); + } } } else { setSelectedCourier(courier === 32 ? 'SELF PICKUP' : null); @@ -376,7 +381,8 @@ export default function SectionExpedition({ products }) { )} </div> - {serviceOptions.length > 0 && selectedCourier && + {serviceOptions.length > 0 && + selectedCourier && selectedCourier !== 32 && selectedCourier !== 0 && ( <div className='px-4 py-2'> |
