mirror of
https://github.com/myronblair/tomsjavajive
synced 2026-06-30 17:50:32 -05:00
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:
@@ -117,7 +117,7 @@ require_once __DIR__ . '/includes/header.php';
|
|||||||
<span class="original"><?= formatCurrency($product['price']) ?></span>
|
<span class="original"><?= formatCurrency($product['price']) ?></span>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</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
|
<i class="fas fa-shopping-bag"></i> Add to Cart
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user