Page 1 of 2

Filter settings

Posted: 09 Oct 2019, 18:15
by keerillcom
How to configure filters so that the size of wedding rings in another category does not go out in the category of _ _?

Re: Filter settings

Posted: 09 Oct 2019, 22:57
by christine
Hi,

we need more information please. Which Joomla Version / template / PHP version etc.
Better: To see it live.

Kind regards
Christine

Re: Filter settings

Posted: 10 Oct 2019, 13:32
by Jan
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

Re: Filter settings

Posted: 10 Oct 2019, 16:01
by keerillcom
Jan wrote: 10 Oct 2019, 13:32 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
Thanks for the answer. That is, if I understood correctly, is it necessary to clone a filter module for each category and language?

Re: Filter settings

Posted: 13 Oct 2019, 11:16
by Jan
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

Re: Filter settings

Posted: 13 Oct 2019, 16:47
by keerillcom
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
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.

Re: Filter settings

Posted: 13 Oct 2019, 20:27
by Jan
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) :idea:

- 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 :idea: )

Re: Filter settings

Posted: 15 Oct 2019, 18:48
by keerillcom
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.

Re: Filter settings

Posted: 16 Oct 2019, 14:34
by Jan
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.

Image

Jan

Re: Filter settings

Posted: 16 Oct 2019, 15:45
by Jan
BTW - I have tested it now and it works:

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');
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