@extends('layouts.app') @section('content')

Carrito de Compras

@if(empty($cart))

Tu carrito está vacío

Navega por nuestra tienda y agrega tus productos favoritos.

Volver al Catálogo
@else
@foreach($cart as $id => $item)
{{ $item['name'] }}

{{ $item['name'] }}

${{ number_format($item['price'], 2) }}
@csrf
Total: ${{ number_format($item['price'] * $item['quantity'], 2) }}
@csrf
@endforeach

Resumen de Compra

Productos ({{ count($cart) }}) @php $subtotal = collect($cart)->sum(fn($i) => $i['price'] * $item['quantity']); // Let's compute actual total correctly $total = 0; foreach($cart as $item) { $total += $item['price'] * $item['quantity']; } @endphp ${{ number_format($total, 2) }}
Envío Gratis
Total ${{ number_format($total, 2) }}
@auth
@csrf
@else Ingresa para Comprar @endauth Seguir Comprando
@endif @endsection