Filter settings

Phoca Cart - complex e-commerce extension
User avatar
keerillcom
Phoca Member
Phoca Member
Posts: 26
Joined: 09 Oct 2019, 18:10

Filter settings

Post by keerillcom »

How to configure filters so that the size of wedding rings in another category does not go out in the category of _ _?

Tags:
christine
Phoca Hero
Phoca Hero
Posts: 2723
Joined: 28 Nov 2010, 17:20

Re: Filter settings

Post by christine »

Hi,

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

Kind regards
Christine
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47810
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Filter settings

Post 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
If you find Phoca extensions useful, please support the project
User avatar
keerillcom
Phoca Member
Phoca Member
Posts: 26
Joined: 09 Oct 2019, 18:10

Re: Filter settings

Post 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?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47810
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Filter settings

Post 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
If you find Phoca extensions useful, please support the project
User avatar
keerillcom
Phoca Member
Phoca Member
Posts: 26
Joined: 09 Oct 2019, 18:10

Re: Filter settings

Post 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.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47810
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Filter settings

Post 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: )
If you find Phoca extensions useful, please support the project
User avatar
keerillcom
Phoca Member
Phoca Member
Posts: 26
Joined: 09 Oct 2019, 18:10

Re: Filter settings

Post 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.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47810
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Filter settings

Post 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
If you find Phoca extensions useful, please support the project
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47810
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Filter settings

Post 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
If you find Phoca extensions useful, please support the project
Post Reply