Filter settings
- keerillcom
- Phoca Member
- Posts: 26
- Joined: 09 Oct 2019, 18:10
Filter settings
How to configure filters so that the size of wedding rings in another category does not go out in the category of _ _?
Tags:
-
- Phoca Hero
- Posts: 2818
- Joined: 28 Nov 2010, 17:20
Re: Filter settings
Hi,
we need more information please. Which Joomla Version / template / PHP version etc.
Better: To see it live.
Kind regards
Christine
we need more information please. Which Joomla Version / template / PHP version etc.
Better: To see it live.
Kind regards
Christine
- Jan
- Phoca Hero
- Posts: 48386
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Filter settings
Hi, for now there is no setting to limit filter items based on categories, so this needs to be customized in the filter module (or new filter module must be written.
Jan
Jan
If you find Phoca extensions useful, please support the project
- keerillcom
- Phoca Member
- Posts: 26
- Joined: 09 Oct 2019, 18:10
Re: Filter settings
Thanks for the answer. That is, if I understood correctly, is it necessary to clone a filter module for each category and language?
- Jan
- Phoca Hero
- Posts: 48386
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Filter settings
Hi, no the code needs to be directly modified. To implement some feature which will check if the filter items are assigned to some category, etc.
Mostly the filter works the way that is display all possible items so users can filter and find exactly what they want to find
Jan
Mostly the filter works the way that is display all possible items so users can filter and find exactly what they want to find
Jan
If you find Phoca extensions useful, please support the project
- keerillcom
- Phoca Member
- Posts: 26
- Joined: 09 Oct 2019, 18:10
Re: Filter settings
You can not make a checkbox in the module to select options? For a site with one type of product, there are no questions, and if there are several, the filter grows proportionally.Jan wrote: ↑13 Oct 2019, 11:16 Hi, no the code needs to be directly modified. To implement some feature which will check if the filter items are assigned to some category, etc.
Mostly the filter works the way that is display all possible items so users can filter and find exactly what they want to find :idea:
Jan
- Jan
- Phoca Hero
- Posts: 48386
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Filter settings
Hi, for now there is no such option in current module. There can be unlimited count of options so mostly another filter module or specific customization should be done (e.g. based on category or any other filter option)
- so e.g. there needs to be new parameter - assign options to category (and it can be attributes, specifications, etc.) But this maybe must be done directly for the server as it can take a lot of time to make an output. Each option needs to be checked for in which products it is listed and for in which categories the products are listed. As you can have products in different categories and options in different products it can take a lot of time resources )
- so e.g. there needs to be new parameter - assign options to category (and it can be attributes, specifications, etc.) But this maybe must be done directly for the server as it can take a lot of time to make an output. Each option needs to be checked for in which products it is listed and for in which categories the products are listed. As you can have products in different categories and options in different products it can take a lot of time resources )
If you find Phoca extensions useful, please support the project
- keerillcom
- Phoca Member
- Posts: 26
- Joined: 09 Oct 2019, 18:10
Re: Filter settings
The creation of additional filter modules with reference to the category of nothing. Have to have a huge list of Sizes from different categories. In principle this on many sites so. We have to think how to solve it.
- Jan
- Phoca Hero
- Posts: 48386
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Filter settings
Hi,
yes, the huge list will be always here when the user will not select the category.
but yes, in case user will select the category, it makes sense to limit this list to size only of products withing this category so in such case the query must ask only options which are assigned to products which are assigned to only selected categories.
I have written this idea to feature request list so I can take a look a it.
Anyway it is not easy to solve, because even if you will display filter based on category and then you click on some filter, you are redirected to items view (which displays all filtered items where no category is defined and the filter items for selected category will be then ignored)
So this only will work with included category filter where user first must filter the category.
Jan
yes, the huge list will be always here when the user will not select the category.
but yes, in case user will select the category, it makes sense to limit this list to size only of products withing this category so in such case the query must ask only options which are assigned to products which are assigned to only selected categories.
I have written this idea to feature request list so I can take a look a it.
Anyway it is not easy to solve, because even if you will display filter based on category and then you click on some filter, you are redirected to items view (which displays all filtered items where no category is defined and the filter items for selected category will be then ignored)
So this only will work with included category filter where user first must filter the category.
Jan
If you find Phoca extensions useful, please support the project
- Jan
- Phoca Hero
- Posts: 48386
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Filter settings
BTW - I have tested it now and it works:
It means:
1) it gets the information about active category or active categories (as in items view, more categories can be active
(items?c=4-music,3-watches)
2) it gets all products inside such categories
3) and then it limits attributes by these products
Limitation:
- it takes more resources (because to find all products inside the categories)
- and if you are in category view and you filter the items and you will see the fitlered items inside items view, then all attributes are displayed as category in items is not active
I will prepare new parameter for this and will release next Beta (this can be tested then)
Jan
Code: Select all
$activeProducts = array();
$activeCategory = array();
if ((int)$category['id'] > 0) {
$activeCategory[] = (int)$category['id'];
}
if (!empty($data['getparams'])) {
foreach ($data['getparams'] as $k => $v) {
$activeCategory[] = (int)$v;
}
}
$activeCategory = array_unique($activeCategory);
$activeProducts = PhocacartProduct::getProducts(0, 0, 1, 0, true, false, false, 0, $activeCategory, 0, array(0,1), 'a.id', 'column');
1) it gets the information about active category or active categories (as in items view, more categories can be active
(items?c=4-music,3-watches)
2) it gets all products inside such categories
3) and then it limits attributes by these products
Limitation:
- it takes more resources (because to find all products inside the categories)
- and if you are in category view and you filter the items and you will see the fitlered items inside items view, then all attributes are displayed as category in items is not active
I will prepare new parameter for this and will release next Beta (this can be tested then)
Jan
If you find Phoca extensions useful, please support the project