Implementazione carrello

This commit is contained in:
2026-04-01 13:38:49 +02:00
parent a953769a1b
commit f9bff1f235
5 changed files with 204 additions and 2 deletions
+2 -1
View File
@@ -29,6 +29,7 @@ if ($stmt = $conn->prepare($sql)) {
<title>Prodotto non trovato - TechStore</title>
<?php endif; ?>
<link rel="stylesheet" href="style.css">
<script src="assets/js/cart.js"></script>
</head>
<body>
<header style="display: flex; justify-content: space-between; align-items: center; padding: 10px; background-color: #f2f2f2; border-bottom: 1px solid #ddd;">
@@ -53,7 +54,7 @@ if ($stmt = $conn->prepare($sql)) {
<p><strong>Descrizione:</strong> <?php echo htmlspecialchars($product['Description']); ?></p>
<p><strong>Prezzo:</strong> €<?php echo htmlspecialchars($product['Price']); ?></p>
<p><strong>Quantità disponibile:</strong> <?php echo htmlspecialchars($product['StockQuantity']); ?></p>
<button style="padding: 10px 20px; background-color: #28a745; color: white; border: none; border-radius: 4px; cursor: pointer;">Aggiungi al carrello</button>
<button onclick="addToCart(<?php echo $product['ProductID']; ?>, '<?php echo htmlspecialchars($product['ProductName']); ?>', <?php echo $product['Price']; ?>)" style="padding: 10px 20px; background-color: #28a745; color: white; border: none; border-radius: 4px; cursor: pointer;">Aggiungi al carrello</button>
</div>
</div>
<?php else: ?>