$productId, 'quantity' => $quantity ]; if ($product['category'] === 'apparel' && !empty($size)) { $cartItem['size'] = $size; } $_SESSION['cart'][] = $cartItem; } header('Location: cart.php'); exit; } } include __DIR__ . '/includes/header.php'; ?>