summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMiqdad <ahmadmiqdad27@gmail.com>2025-06-01 20:11:57 +0700
committerMiqdad <ahmadmiqdad27@gmail.com>2025-06-01 20:11:57 +0700
commitffc18f479e3eef4c4e2608141238f83ca5fa79f4 (patch)
treed2f8e86a2e43f3454e65a0e832e33c0991ab6c5d /src
parent815ff154cde6da4a0dcf0831ad3521cfd67e0340 (diff)
<miqdad> fix estimated arrival days start NaN
Diffstat (limited to 'src')
-rw-r--r--src/lib/checkout/components/Checkout.jsx11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx
index 8c80640a..77053d1c 100644
--- a/src/lib/checkout/components/Checkout.jsx
+++ b/src/lib/checkout/components/Checkout.jsx
@@ -566,8 +566,15 @@ const Checkout = () => {
order_line: JSON.stringify(productOrder),
delivery_amount: biayaKirim,
carrier_id: selectedCourierId,
- estimated_arrival_days_start : parseInt(eta_courier_start) + parseInt(productSla),
- estimated_arrival_days: parseInt(eta_courier) + parseInt(productSla),
+ // estimated_arrival_days_start : parseInt(eta_courier_start) + parseInt(productSla),
+ // estimated_arrival_days: parseInt(eta_courier) + parseInt(productSla),
+ // If NaN conver to 0 (int)
+ estimated_arrival_days_start: (isNaN(parseInt(eta_courier_start)) ? 0 : parseInt(eta_courier_start)) +
+ (isNaN(parseInt(productSla)) ? 0 : parseInt(productSla)),
+
+ estimated_arrival_days: (isNaN(parseInt(eta_courier)) ? 0 : parseInt(eta_courier)) +
+ (isNaN(parseInt(productSla)) ? 0 : parseInt(productSla)),
+
delivery_service_type: selectedService?.service_type,
// New release
// carrier_id: selectedCarrierId,