mirror of https://github.com/itflow-org/itflow
Product Category Dropdown Filter only show categories thats are assigned to the products not all the categories
This commit is contained in:
parent
37bef2d824
commit
2333fa2d9b
|
|
@ -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']);
|
||||
|
|
|
|||
Loading…
Reference in New Issue