'; require_once __DIR__ . '/includes/header.php'; $cart = getCart(); $cartItems = []; $subtotal = 0; // Get product details for cart items foreach ($cart as $productId => $quantity) { $product = db()->fetch( "SELECT product_id, name, price, sale_price, stock, images FROM products WHERE product_id = :id AND is_active = 1", ['id' => $productId] ); if ($product) { $images = json_decode($product['images'] ?? '[]', true); $product['image'] = !empty($images) ? $images[0] : '/assets/images/placeholder-product.svg'; $product['quantity'] = min($quantity, $product['stock']); $product['unit_price'] = $product['sale_price'] ?? $product['price']; $product['total'] = $product['unit_price'] * $product['quantity']; $subtotal += $product['total']; $cartItems[] = $product; } } // Get shipping settings $shippingSettings = getSetting('shipping', [ 'flat_rate_enabled' => true, 'flat_rate_amount' => 5.99, 'free_shipping_threshold' => 50 ]); $shippingCost = 0; if ($shippingSettings['flat_rate_enabled'] ?? true) { if ($subtotal >= ($shippingSettings['free_shipping_threshold'] ?? 50)) { $shippingCost = 0; } else { $shippingCost = $shippingSettings['flat_rate_amount'] ?? 5.99; } } $total = $subtotal + $shippingCost; ?>

Shopping Cart

Your cart is empty

Looks like you haven't added any items yet.

Start Shopping
<?= htmlspecialchars($item['name']) ?>

each

Order Summary

Subtotal
Shipping FREE
0 && isset($shippingSettings['free_shipping_threshold'])): $remaining = $shippingSettings['free_shipping_threshold'] - $subtotal; ?>

Add more for FREE shipping!


Total
Proceed to Checkout Continue Shopping