diff --git a/src/app/[locale]/checkout/page.tsx b/src/app/[locale]/checkout/page.tsx index 67ffd86..c85e866 100644 --- a/src/app/[locale]/checkout/page.tsx +++ b/src/app/[locale]/checkout/page.tsx @@ -307,12 +307,10 @@ export default function CheckoutPage() { setOrderNumber(result.order.number); setOrderComplete(true); - // Clear the checkout/cart from the store - clearCheckout(); - - // Track order completion + // Track order completion BEFORE clearing checkout const lines = getLines(); const total = getTotal(); + console.log("[Checkout] Order total before tracking:", total, "RSD"); trackOrderCompleted({ order_id: checkout.id, order_number: result.order.number, @@ -323,6 +321,9 @@ export default function CheckoutPage() { customer_email: shippingAddress.email, }); + // Clear the checkout/cart from the store + clearCheckout(); + // Identify the user identifyUser({ profileId: shippingAddress.email,