[Skip to main content](#vessel-content)

#   Setting up filters

##

- **[jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")**
- [![jameswadsworth's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/556-jameswadsworth "View jameswadsworth's Profile") Topic Author
- [ Offline](/forum/user/556-jameswadsworth)

Less More

- Posts: 274
- Thank you received: 5
-
-
-
- [](http://www.deanimaconsulting.com)
-

15 years 4 weeks ago [\#26695](#26695) by [jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")  *[Setting up filters](/forum/4-how-to/26695-setting-up-filters#26695 "Hi there,  just been experimenting with the new filters. I am however have some difficulty in getting the filters to work properly. Could you give some points. I want to set up a manufacturer filter for all product displays. What steps do I need to do to get this working?  Thanks,James")* was created by *[jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")*

Hi there,

just been experimenting with the new filters. I am however have some difficulty in getting the filters to work properly. Could you give some points. I want to set up a manufacturer filter for all product displays. What steps do I need to do to get this working?

Thanks,James

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI2Njk1LXNldHRpbmctdXAtZmlsdGVycz90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

15 years 4 weeks ago [\#26705](#26705) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Re: Setting up filters](/forum/4-how-to/26695-setting-up-filters#26705 "Hi there,  just been experimenting with the new filters. I am however have some difficulty in getting the filters to work properly. Could you give some points. I want to set up a manufacturer filter for all product displays. What steps do I need to do to get this working?  Thanks,James")*

Hi James,

To set up a manufacturer filter for all product display you have to follow these steps:
Go to Display -&gt; Filters, then New.
In this page, you have to set the name of your filter.
Select the type, for example "Single Dropdown".

Choose the category, for all products, you have to click on "Root" and select "product category".
Check Yes for "Including sub categories", this step will activate the filter for all product displays.

On the right, in "Apply on" select "Manufacturers", and then you can define all the other parameters.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI2Njk1LXNldHRpbmctdXAtZmlsdGVycz90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")**
- [![jameswadsworth's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/556-jameswadsworth "View jameswadsworth's Profile") Topic Author
- [ Offline](/forum/user/556-jameswadsworth)

Less More

- Posts: 274
- Thank you received: 5
-
-
-
- [](http://www.deanimaconsulting.com)
-

15 years 2 weeks ago [\#27313](#27313) by [jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")  Replied by *[jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")* on topic *[Re: Setting up filters](/forum/4-how-to/26695-setting-up-filters#27313 "Hi there,  just been experimenting with the new filters. I am however have some difficulty in getting the filters to work properly. Could you give some points. I want to set up a manufacturer filter for all product displays. What steps do I need to do to get this working?  Thanks,James")*

Hi Xavier, thanks for the pointer. I now have it working. I have the following suggestions to improve it. Take for example the manufacturer filter.

1) it shows all manufacturers, even though there may be only 6 manufacturers on the product category display page. It would make much more sense to show only the relevant manufactures. We have been testing a dummy site with 300 manufactures. This means 294 times out of 300 the filter displays nothing.
2) the list should be alphabetical, or at least add on option so the user can choose the ordering type

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI2Njk1LXNldHRpbmctdXAtZmlsdGVycz90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86321
- Thank you received: 14279
-
-

15 years 2 weeks ago [\#27315](#27315) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Setting up filters](/forum/4-how-to/26695-setting-up-filters#27315 "Hi there,  just been experimenting with the new filters. I am however have some difficulty in getting the filters to work properly. Could you give some points. I want to set up a manufacturer filter for all product displays. What steps do I need to do to get this working?  Thanks,James")*

1. In your filter, you can activate the dynamic display option so that it only show the relevant manufacturers.

2. That's indeed something we didn't think of. We'll make based on the ordering of your manufacturers.

You can do that by changing the line:
$query='SELECT * FROM '.hikashop_table('category').' AS a '.$left.' WHERE category_type="manufacturer" AND category_parent_id!![=&#92;](/irritated.gif "=&#92;")'1\' '.$optionElement;
to:
$query='SELECT a.* FROM '.hikashop_table('category').' AS a '.$left.' WHERE a.category_type="manufacturer" AND a.category_parent_id!![=&#92;](/irritated.gif "=&#92;")'1\' '.$optionElement.' ORDER BY a.category_ordering';
in the file administrator/components/com_hikashop/classes/filter.php

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI2Njk1LXNldHRpbmctdXAtZmlsdGVycz90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")**
- [![jameswadsworth's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/556-jameswadsworth "View jameswadsworth's Profile") Topic Author
- [ Offline](/forum/user/556-jameswadsworth)

Less More

- Posts: 274
- Thank you received: 5
-
-
-
- [](http://www.deanimaconsulting.com)
-

15 years 2 weeks ago [\#27338](#27338) by [jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")  Replied by *[jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")* on topic *[Re: Setting up filters](/forum/4-how-to/26695-setting-up-filters#27338 "Hi there,  just been experimenting with the new filters. I am however have some difficulty in getting the filters to work properly. Could you give some points. I want to set up a manufacturer filter for all product displays. What steps do I need to do to get this working?  Thanks,James")*

Hello Nicolas,

changing the to dynamic display did not change anything. Still displaying all the manufacturers.

We set up as follows.
Type : Single Dropdown
Category: product category
Including sub categories: Yes
Apply on . Manufacturers
Size: 1
Title position: Inside
Number of columns :1
Published: yes
Display limited to: All (there is no other option)
Submit on click: No
Height: 0px
Deletable filter: No
Dynamic display: Yes

Just had a quick look at the hikashopSingledropdownClass::display function. Everything is getting pass correctly but the only thing I found for filter_dynamic was in line 894

if(!($filter-&gt;filter_dynamic)){
$datas='';
}

Where is the filtering of the filter taking place if you know what I mean?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI2Njk1LXNldHRpbmctdXAtZmlsdGVycz90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86321
- Thank you received: 14279
-
-

15 years 2 weeks ago [\#27385](#27385) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Setting up filters](/forum/4-how-to/26695-setting-up-filters#27385 "Hi there,  just been experimenting with the new filters. I am however have some difficulty in getting the filters to work properly. Could you give some points. I want to set up a manufacturer filter for all product displays. What steps do I need to do to get this working?  Thanks,James")*

The filtering of the filter is done in the function display of the class hikashopSingledropdownClass where you found that piece of code. However, it's a bit after:

//DISPLAY MANUFACTURERS
if($filter-&gt;filter_data=='manufacturers'){
$manufacturers=parent::getManufacturers($filter, $datas);
foreach($manufacturers as $manufacturer){
$selectedItem='';
if(!empty($selected) &amp;&amp; in_array($manufacturer-&gt;category_id, $selected)){
$selectedItem='selected="selected"';
}
$html.='&lt;OPTION '.$onClick.' '.$selectedItem.' name="'.$filter-&gt;filter_data.'" value="'.$manufacturer-&gt;category_id.'"&gt;'.$manufacturer-&gt;category_name.'&lt;/OPTION&gt;';
}
}

It's that line which filter out the manufacturers not available for the current products:
$manufacturers=parent::getManufacturers($filter, $datas);

I didn't had the time to look at the problem. Let me know of you move forward on your end.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI2Njk1LXNldHRpbmctdXAtZmlsdGVycz90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")**
- [![jameswadsworth's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/556-jameswadsworth "View jameswadsworth's Profile") Topic Author
- [ Offline](/forum/user/556-jameswadsworth)

Less More

- Posts: 274
- Thank you received: 5
-
-
-
- [](http://www.deanimaconsulting.com)
-

15 years 2 weeks ago -  15 years 2 weeks ago [\#27399](#27399) by [jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")  Replied by *[jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")* on topic *[Re: Setting up filters](/forum/4-how-to/26695-setting-up-filters#27399 "Hi there,  just been experimenting with the new filters. I am however have some difficulty in getting the filters to work properly. Could you give some points. I want to set up a manufacturer filter for all product displays. What steps do I need to do to get this working?  Thanks,James")*

Something is not right with the query the fucntion getManufacturers. When the dynamic filter is off it returns 276 rows, which is all the manufacturers in the table. This works as expected. When the dynamic filter is on it returns 840 rows. I was expecting it return less not more!!

Just a quick look and it appears this was an error in the first release of 1.5.4. I see the $option value in the query has been changed to $optionElement in the final release of 1.5.4. For some reason this file was not updated. All working correctly now. Thanks

Last edit: 15 years 2 weeks ago by [jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI2Njk1LXNldHRpbmctdXAtZmlsdGVycz90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86321
- Thank you received: 14279
-
-

15 years 2 weeks ago [\#27462](#27462) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Setting up filters](/forum/4-how-to/26695-setting-up-filters#27462 "Hi there,  just been experimenting with the new filters. I am however have some difficulty in getting the filters to work properly. Could you give some points. I want to set up a manufacturer filter for all product displays. What steps do I need to do to get this working?  Thanks,James")*

That's great then !

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI2Njk1LXNldHRpbmctdXAtZmlsdGVycz90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.118 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
