Fix add-to-cart on home page: wrong class and data attribute

Button used add-to-cart/data-id instead of add-to-cart-btn/data-product-id.
Added inline onclick to match shop and product pages.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-14 20:26:47 +00:00
parent 7dfec466a1
commit ca2f612421
+1 -1
View File
@@ -117,7 +117,7 @@ require_once __DIR__ . '/includes/header.php';
<span class="original"><?= formatCurrency($product['price']) ?></span>
<?php endif; ?>
</div>
<button class="btn btn-primary btn-block add-to-cart" data-id="<?= $product['product_id'] ?>">
<button class="btn btn-primary btn-block add-to-cart-btn" data-product-id="<?= $product['product_id'] ?>" onclick="addToCart('<?= $product['product_id'] ?>', 1)">
<i class="fas fa-shopping-bag"></i> Add to Cart
</button>
</div>