@extends('layouts.app') @section('title', 'Checkout - Tech eCommerce') @section('content')

Checkout

@csrf

Billing Information

@error('customer_name')

{{ $message }}

@enderror
@error('customer_email')

{{ $message }}

@enderror
@error('customer_phone')

{{ $message }}

@enderror
@error('address')

{{ $message }}

@enderror
@error('city')

{{ $message }}

@enderror
@error('postal_code')

{{ $message }}

@enderror
@error('country')

{{ $message }}

@enderror

Payment Method

@php $cartItems = \App\Models\CartItem::with('product') ->where('user_id', auth()->id()) ->get(); $subtotal = $cartItems->sum(function ($item) { return $item->product->price * $item->quantity; }); $taxRate = tax_rate() / 100; $tax = $subtotal * $taxRate; $total = $subtotal + $tax; @endphp

Order Summary

@forelse ($cartItems as $item)
{{ $item->product->name }} x {{ $item->quantity }} {{ format_price($item->product->price * $item->quantity) }}
@empty

No items in cart

@endforelse
@if ($cartItems->count() > 0)
Subtotal {{ format_price($subtotal) }}
Tax ({{ tax_name() }} {{ tax_rate() }}%) {{ format_price($tax) }}
Total {{ format_price($total) }}
@endif ← Back to Cart
@endsection