diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-06-29 10:08:16 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-06-29 10:08:16 +0700 |
| commit | b992edcc7f1b7395dea0c8562ddf272df9fc6b7f (patch) | |
| tree | 94475d6d7f27a342b3df6d35a7b529346b96d5c5 /src/lib/checkout | |
| parent | 6df1a73f3ccfc6c222bc797b48db774125833040 (diff) | |
<iman> add parameter flag flash sale
Diffstat (limited to 'src/lib/checkout')
| -rw-r--r-- | src/lib/checkout/components/Checkout.jsx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx index 5ca3611f..df1768fb 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,6 +225,7 @@ const Checkout = () => { setProducts(cartCheckout?.products); setCheckWeight(cartCheckout?.hasProductWithoutWeight); setTotalWeight(cartCheckout?.totalWeight.g); + setHasFlashSale(cartCheckout?.products[0]?.hasFlashsale ? cartCheckout.products[0].hasFlashsale : false); }, [cartCheckout]); useEffect(() => { @@ -343,6 +345,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 +361,7 @@ const Checkout = () => { toast.error('Gagal melakukan transaksi, terjadi kesalahan internal'); return; } - + console.log("isCheckouted",isCheckouted) gtagPurchase(products, biayaKirim, isCheckouted.name); const midtrans = async () => { |
