diff options
| author | trisusilo <tri.susilo@altama.co.id> | 2023-08-30 08:27:26 +0000 |
|---|---|---|
| committer | trisusilo <tri.susilo@altama.co.id> | 2023-08-30 08:27:26 +0000 |
| commit | f256bb0fef9fe7ecd477a7d5235ef152a8370eff (patch) | |
| tree | 67ebb10ebe52ec180319163231c30c0a45c56a4c /src/lib/checkout/components/Checkout.jsx | |
| parent | 8c726c1669289eab7e6a6989084d7de036063f29 (diff) | |
| parent | a08c6f9a773732c959e440dbcc653a6e80045e81 (diff) | |
Merged in Feature/page_tracking_awb (pull request #51)
Feature/page tracking awb
Diffstat (limited to 'src/lib/checkout/components/Checkout.jsx')
| -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) |
