SouljaGoD:
Perfect. You are right, I grabbed the dropdown from classic and it works amazing - I dumped in the tpl_index_product_list.
However, I also modified tpl_index_categories recently, to show products instead of subcategories [if any]
I was unable to bring the dropdownlist there. Would you know why?
Where can I look to investigate this manner.
The only difference, unless I'm wrong, between my tpl_index_product_list and tpl_index_categories is that for the latter, I check for the querystring "cPath" and modified the listing_sql to display products from all the subcategories of that parent category.
D
To clarify, $do_filter_list is not set within tpl_index_categories, but fine within tpl_index_product_list
if ($do_filter_list) {
echo zen_draw_pull_down_menu('filter_id', $options, (isset($_GET['filter_id']) ? $_GET['filter_id'] : ''), 'onchange="this.form.submit()"');
}
I just found out in the default_filter,
$filterlist_sql= "select distinct m.manufacturers_id as id, m.manufacturers_name as name
from " . TABLE_PRODUCTS . " p, " .
TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " .
TABLE_MANUFACTURERS . " m
where p.products_status = 1
and p.manufacturers_id = m.manufacturers_id
and p.products_id = p2c.products_id
** and p2c.categories_id = '" . (int)$current_category_id . "'**
order by m.manufacturers_name";
The reason I don't see a dropdown for manufacturers is because the above query results to 0 records.
It is because of and p2c.categories_id = '" . (int)$current_category_id . "'
$current_category_id is not associated to any products, it has a subcategory, and that subcategory is the one with products that have a manufacturer_id
How could I modify this query? Do I need to check if that $current_category_id contains subcategories, and find the list of category IDs and then execute the query for all those category IDs?
Ouch..