Make footer Shop links dynamic from products categories

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-14 19:50:51 +00:00
parent 29656bd4d7
commit e6ca96b75c
+7 -2
View File
@@ -19,8 +19,13 @@
<h4>Shop</h4>
<ul class="footer-links">
<li><a href="/shop.php">All Products</a></li>
<li><a href="/shop.php?category=single-origin">Single Origin</a></li>
<li><a href="/shop.php?category=blends">Blends</a></li>
<?php
$footerCategories = db()->fetchAll(
"SELECT DISTINCT category FROM products WHERE category IS NOT NULL AND category != '' AND is_active = 1 ORDER BY category"
);
foreach ($footerCategories as $fc): ?>
<li><a href="/shop.php?category=<?= urlencode($fc['category']) ?>"><?= htmlspecialchars(ucfirst($fc['category'])) ?></a></li>
<?php endforeach; ?>
</ul>
</div>