@extends('layouts.app') @section('content')
@csrf
Checkout
Contact Information
Log in
In your cart
    @forelse($cartItems as $item) @php $product = $item->product; $price = $item->custom_price ?? $product->price; $total = $price * $item->quantity; $custom = $item->custom_attributes; @endphp
  • img-product {{ $item->quantity }}

    {{ $product->name }}

    ${{ number_format($total, 2) }}
  • @empty

    Your cart is empty.

    @endforelse
@php $subtotal = $cartItems->sum(function ($item) { return ($item->custom_price ?? $item->product->price) * $item->quantity; }); $discount = 0; // apply if required $shipping = 0; // or dynamic $tax = 0; // example $grandTotal = $subtotal - $discount + $shipping + $tax; @endphp
  • Subtotal: ${{ number_format($subtotal, 2) }}
  • Discount: -${{ number_format($discount, 2) }}
  • Shipping: ${{ number_format($shipping, 2) }}
  • Tax: ${{ number_format($tax, 2) }}
Total: ${{ number_format($grandTotal, 2) }}
@endsection