// Cart.jsx — shopping cart + checkout step const { useState: useCartState } = React; const Cart = ({ cart, onChangeQty, onRemove, onNav, onCheckout }) => { const { isMobile } = useViewport(); const subtotal = cart.reduce((s, it) => s + it.p.price * it.qty, 0); const savings = cart.reduce((s, it) => s + ((it.p.was || it.p.price) - it.p.price) * it.qty, 0); const shipping = subtotal >= 599 ? 0 : 89; const total = subtotal + shipping; const [coupon, setCoupon] = useCartState(""); return (
{cart.length} {cart.length === 1 ? "producto" : "productos"} listos para tu compra
{cart.length === 0 ? (Cuando agregues productos los verás aquí.
Pedido #{orderNum}. Te enviamos los detalles a tu correo.