Fix pagination styling, add-to-cart class/data-attr mismatch, shop.php pagination

This commit is contained in:
2026-06-14 16:24:39 +00:00
parent da60888b72
commit 548713971d
2 changed files with 41 additions and 29 deletions
+2 -9
View File
@@ -144,7 +144,7 @@ $productTypesList = db()->fetchAll("SELECT type_id, name, slug FROM product_type
<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'] ?>">
<i class="fas fa-shopping-bag"></i> Add to Cart
</button>
</div>
@@ -154,14 +154,7 @@ $productTypesList = db()->fetchAll("SELECT type_id, name, slug FROM product_type
<!-- Pagination -->
<?php if ($pagination['total_pages'] > 1): ?>
<div style="display: flex; justify-content: center; gap: 0.5rem; margin-top: 3rem;">
<?php for ($i = 1; $i <= $pagination['total_pages']; $i++): ?>
<a href="/shop.php?page=<?= $i ?><?= $category ? '&category=' . urlencode($category) : '' ?><?= $sort ? '&sort=' . $sort : '' ?>"
class="btn <?= $i === $page ? 'btn-primary' : 'btn-secondary' ?>">
<?= $i ?>
</a>
<?php endfor; ?>
</div>
<?= renderPagination($pagination, '/shop.php?' . http_build_query(array_filter(['category' => $category, 'sort' => $sort]))) ?>
<?php endif; ?>
<?php endif; ?>
</div>