What I am basically trying to do is run this SQL query for each attribute option ... passing in the
category id (of the page we are on, example = 13)
Attribute_option_id (of the option in question, example = 99)
Code:
SELECT count(xc_category_products.product_id) as productCount
FROM xc_category_products LEFT JOIN xc_attribute_values_select
ON xc_category_products.product_id = xc_attribute_values_select.product_id
WHERE xc_category_products.category_id = '13' AND
xc_attribute_values_select.attribute_option_id= '99'
This query would return the number of products in this category for this attribute option (quite a handy thing to have anyway).
I am guessing the best place of the code is as part of the getOptions() function in \XLite\Module\XC\ProductFilter\View\FormField\Sele ct\Attribute.php, but I'm not sure how this will get access to the category id, and also how to build that query in the new x-cart architecture ...
Would really appreciate some help on this Tony if you can spare a few moments ....
Jan