diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2024-07-01 07:52:12 +0000 |
|---|---|---|
| committer | trisusilo <tri.susilo@altama.co.id> | 2024-07-01 07:52:12 +0000 |
| commit | 66d787499d0751365c1cda9d79b31e9f3c3c28bc (patch) | |
| tree | 45870de32feb174c3d97a053762170d353af25cf /src/lib/checkout | |
| parent | 24bf0ef6152ea8a62284280d3b2c966ff01b4e8d (diff) | |
| parent | 703136862dc3d41d0a276c17fa7f4ecebd471527 (diff) | |
Merged in Feature/flash-sale (pull request #147)
Feature/flash sale
Approved-by: trisusilo
Diffstat (limited to 'src/lib/checkout')
| -rw-r--r-- | src/lib/checkout/components/Checkout.jsx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx index 5ca3611f..4aafdece 100644 --- a/src/lib/checkout/components/Checkout.jsx +++ b/src/lib/checkout/components/Checkout.jsx @@ -112,6 +112,7 @@ const Checkout = () => { const [loadingVoucher, setLoadingVoucher] = useState(true); const [loadingRajaOngkir, setLoadingRajaOngkir] = useState(false); const [grandTotal, setGrandTotal] = useState(0); + const [hasFlashSale, setHasFlashSale] = useState(false); const expedisiValidation = useRef(null); @@ -224,7 +225,9 @@ const Checkout = () => { setProducts(cartCheckout?.products); setCheckWeight(cartCheckout?.hasProductWithoutWeight); setTotalWeight(cartCheckout?.totalWeight.g); + setHasFlashSale(cartCheckout?.products[0]?.hasFlashsale ? cartCheckout.products[0].hasFlashsale : false); }, [cartCheckout]); + useEffect(() => { setCheckoutValidation(false); @@ -343,6 +346,7 @@ const Checkout = () => { carrier_id: selectedCarrierId, estimated_arrival_days: splitDuration(etd), delivery_service_type: selectedExpedisiService, + flash_sale : hasFlashSale, // dibuat negasi untuk ngetest kebalikan nilai false voucher: activeVoucher, type: 'sale_order', }; @@ -358,7 +362,7 @@ const Checkout = () => { toast.error('Gagal melakukan transaksi, terjadi kesalahan internal'); return; } - + gtagPurchase(products, biayaKirim, isCheckouted.name); const midtrans = async () => { |
