@php $checkoutItems = collect($cart)->map(fn ($item) => [ 'id' => (string) ($item['product_id'] ?? ''), 'name' => $item['name'] ?? 'Product', 'price' => round((float) ($item['price'] ?? 0), 2), 'qty' => (int) ($item['qty'] ?? 1), ])->values(); $checkoutValue = round((float) collect($cart)->sum(fn ($item) => ($item['price'] ?? 0) * ($item['qty'] ?? 1)), 2); $checkoutTracking = [ 'currency' => 'BDT', 'value' => $checkoutValue, 'items' => $checkoutItems, ]; @endphp @push('scripts') @endpush