Implementazione pulsante aggiunta al carrello prodotti in homepage

This commit is contained in:
2026-04-02 12:36:55 +02:00
parent 717a212c84
commit 76473862e6
+1 -1
View File
@@ -41,7 +41,7 @@ if ($result === false) {
<a href="product.php?id=<?php echo $row['ProductID']; ?>"><div class="img-square"><img src="img/<?php echo htmlspecialchars($row['ImagePath']); ?>" alt="Immagine prodotto"></div></a> <a href="product.php?id=<?php echo $row['ProductID']; ?>"><div class="img-square"><img src="img/<?php echo htmlspecialchars($row['ImagePath']); ?>" alt="Immagine prodotto"></div></a>
<h3><?php echo "<a href='product.php?id=" . $row['ProductID'] . "'>" . htmlspecialchars($row['ProductName']) . "</a>"; ?></h3> <h3><?php echo "<a href='product.php?id=" . $row['ProductID'] . "'>" . htmlspecialchars($row['ProductName']) . "</a>"; ?></h3>
<p><?php echo htmlspecialchars($row['Price']); ?>€</p> <p><?php echo htmlspecialchars($row['Price']); ?>€</p>
<button>Aggiungi al carrello</button> <button onclick="addToCart(<?php echo $row['ProductID']; ?>, '<?php echo htmlspecialchars($row['ProductName']); ?>', <?php echo $row['Price']; ?>)">Aggiungi al carrello</button>
</div> </div>
<?php endwhile; ?> <?php endwhile; ?>
</div> </div>