fetch( "SELECT * FROM orders WHERE order_id = :id AND customer_id = :cid", ['id' => $orderId, 'cid' => $customer['customer_id']] ); if (!$order) { redirect('/account/orders.php'); } $items = json_decode($order['items'], true); $shippingAddress = json_decode($order['shipping_address'] ?? '{}', true); require_once __DIR__ . '/../includes/header.php'; require_once __DIR__ . '/includes/sidebar.php'; $statusClass = match($order['order_status']) { 'pending' => 'warning', 'confirmed', 'processing' => 'primary', 'shipped' => 'primary', 'delivered' => 'success', 'cancelled', 'refunded' => 'error', default => 'primary' }; ?>
| Product | Qty | Price | Total |
|---|---|---|---|
|
= htmlspecialchars($item['name']) ?>
= htmlspecialchars($item['options']) ?> |
= $item['quantity'] ?> | = formatCurrency($item['price']) ?> | = formatCurrency($item['total']) ?> |
= htmlspecialchars($shippingAddress['name'] ?? $order['customer_name']) ?>
= htmlspecialchars($shippingAddress['address'] ?? '') ?>
= htmlspecialchars($shippingAddress['city'] ?? '') ?>, = htmlspecialchars($shippingAddress['state'] ?? '') ?> = htmlspecialchars($shippingAddress['zip'] ?? '') ?>
= htmlspecialchars($shippingAddress['country'] ?? '') ?>
Need help with this order?
Contact Support