mirror of
https://github.com/itflow-org/itflow
synced 2026-03-05 05:14:51 +00:00
Product Category Dropdown Filter only show categories thats are assigned to the products not all the categories
This commit is contained in:
@@ -91,7 +91,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
<option value="">- All Categories -</option>
|
<option value="">- All Categories -</option>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$sql_categories_filter = mysqli_query($mysqli, "SELECT * FROM categories WHERE category_type = 'Income' ORDER BY category_name ASC");
|
$sql_categories_filter = mysqli_query($mysqli, "SELECT DISTINCT category_id, category_name FROM categories INNER JOIN products ON product_category_id = category_id WHERE 1 = 1 AND product_$archive_query $type_query ORDER BY category_name ASC");
|
||||||
while ($row = mysqli_fetch_array($sql_categories_filter)) {
|
while ($row = mysqli_fetch_array($sql_categories_filter)) {
|
||||||
$category_id = intval($row['category_id']);
|
$category_id = intval($row['category_id']);
|
||||||
$category_name = nullable_htmlentities($row['category_name']);
|
$category_name = nullable_htmlentities($row['category_name']);
|
||||||
|
|||||||
Reference in New Issue
Block a user