diff options
| author | HATEC\SPVDEV001 <tri.susilo@altama.co.id> | 2023-08-29 14:11:23 +0700 |
|---|---|---|
| committer | HATEC\SPVDEV001 <tri.susilo@altama.co.id> | 2023-08-29 14:11:23 +0700 |
| commit | 0dab223d410e1c6011bfb4e1e850dfe566c8d044 (patch) | |
| tree | 5c938bc5944deaa192f0ab4215d96f311b37dd4f /src/lib/checkout | |
| parent | 60f0b9d33335719b15f60f4b99bd80a48b7da346 (diff) | |
add params etd di checkout
Diffstat (limited to 'src/lib/checkout')
| -rw-r--r-- | src/lib/checkout/components/Checkout.jsx | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx index afb94c10..0eb05345 100644 --- a/src/lib/checkout/components/Checkout.jsx +++ b/src/lib/checkout/components/Checkout.jsx @@ -297,10 +297,12 @@ const Checkout = () => { order_line: JSON.stringify(productOrder), delivery_amount: biayaKirim, carrier_id: selectedCarrierId, + estimated_arrival_days: splitDuration(etd), delivery_service_type: selectedExpedisiService, voucher: activeVoucher, type: 'sale_order' } + if (query) { data.source = 'buy' } @@ -1444,6 +1446,22 @@ function calculateEstimatedArrival(duration) { return '' } +function splitDuration(duration){ + if (duration) { + let estimationDate = null + if (duration.includes('-')){ + estimationDate = duration.split('-') + estimationDate = parseInt(estimationDate[1]) + }else{ + estimationDate = parseInt(duration) + } + + return estimationDate + } + + return '' +} + const extractDuration = (text) => { const matches = text.match(/\d+(?:-\d+)?/g) |
