mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 19:04:52 +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>
|
||||
|
||||
<?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)) {
|
||||
$category_id = intval($row['category_id']);
|
||||
$category_name = nullable_htmlentities($row['category_name']);
|
||||
|
||||
Reference in New Issue
Block a user