- Posts: 431
- Thank you received: 19
Categories listing - search and sort
1 year 11 months ago #364600
by neo191987
Categories listing - search and sort was created by neo191987
Hello, is it possible to add a search and sorting function to the category list like in the product list (filters)? If there are multiple categories, it can be very difficult to find a given category.
Please Log in or Create an account to join the conversation.
1 year 11 months ago - 1 year 11 months ago #364602
by Philip
Replied by Philip on topic Categories listing - search and sort
Hello,
You have to create a Module Filter specific for your Category listing, with only filter entries (HikaShop Configuration, Display dropdown => Filters) restricted on your required Category (if needed).
And in your required Item Menu, your category listing settings and activate in Product features display part, the Filters options.
Follow my configuration, especially red bordered part, but maybe you have to adapt to your relative needs.
Regards
You have to create a Module Filter specific for your Category listing, with only filter entries (HikaShop Configuration, Display dropdown => Filters) restricted on your required Category (if needed).
And in your required Item Menu, your category listing settings and activate in Product features display part, the Filters options.
Follow my configuration, especially red bordered part, but maybe you have to adapt to your relative needs.
Regards
Last edit: 1 year 11 months ago by Philip.
The following user(s) said Thank You: neo191987
Please Log in or Create an account to join the conversation.
1 year 11 months ago #364610
by neo191987
Replied by neo191987 on topic Categories listing - search and sort
Please Log in or Create an account to join the conversation.
1 year 11 months ago #364612
by nicolas
Replied by nicolas on topic Categories listing - search and sort
Hi,
Unfortunately, there is no already available mechanism for categories listings.
Now, if you want to build your own filter system for categories, that's totally possible. You need two things:
1. create a module, which would allow the user to apply some filtering with dropdown, or input field, or other interfaces.
2. a plugin of the type "hikashop" implementing the onBeforeCategoryListingLoad event:
www.hikashop.com/support/documentation/6...eCategoryListingLoad
This event will be called each time HikaShop loads a listing of categories. First, you want to check that you're on a categories listing menu by checking the parameters. Then, you can read parameters relative to your module interface (for example, if you have a link to the same page with an extra parameter ?categorysearch=xxx added to it for a search on the category name with the text "xxx"), and then you can add custom conditions to the $filters parameter of the event to actually apply the filter to the loading of the categories. For example:
Unfortunately, there is no already available mechanism for categories listings.
Now, if you want to build your own filter system for categories, that's totally possible. You need two things:
1. create a module, which would allow the user to apply some filtering with dropdown, or input field, or other interfaces.
2. a plugin of the type "hikashop" implementing the onBeforeCategoryListingLoad event:
www.hikashop.com/support/documentation/6...eCategoryListingLoad
This event will be called each time HikaShop loads a listing of categories. First, you want to check that you're on a categories listing menu by checking the parameters. Then, you can read parameters relative to your module interface (for example, if you have a link to the same page with an extra parameter ?categorysearch=xxx added to it for a search on the category name with the text "xxx"), and then you can add custom conditions to the $filters parameter of the event to actually apply the filter to the loading of the categories. For example:
Code:
public function onBeforeCategoryListingLoad(&$filters) {
// ....
$search = hikaInput::get()->getString('categorysearch');
if(!empty($search)) {
$db = JFactory::getDBO();
$filters[] = 'a.category_name LIKE '.$db->quote($db->escape('%'.$search.'%'));
}
}
The following user(s) said Thank You: neo191987
Please Log in or Create an account to join the conversation.
Time to create page: 0.196 seconds