-
join two filter
Hello, I am trying to combine two filters (checkboxes out of 2 taxonomie lists). I describe my goal:
List 1: shirt, hat, shoe
List 2: green, blue, red
When I check e.g. shirt, hat and green, blue I get a weard list. But what I want ist to get all shirts and hats that are green or blue. I cant figure out, how to join the two filters logicaly. Can anyone give me a hint.
-
Re: join two filter
I presume you're talking about the Catalog Filter module and that you've used a TAGS checkbox for the "color" and the "type". The TAGS is by default in AND mode, but you can change that to OR mode in the Catalog List module (on the same page).
-
Re: join two filter
Thanks, Thyon, for your reply.
I already have changed the list module to OR mode – but I dont get the desired result. With OR I get e.g. all green products with green color. But what I want is to only get those green products that are marked in the type Tag checkbox. Somehow its a pre-condition - dont know how to explain it correctly. Hope you get my point.
-
Re: join two filter
I didn't get that at all. This is how the filter works.
1. Displays all items
2. Click on a filter item, its added to the list of filtered items, e.g. WHERE color='green'
3. List updates and only shows items which have a green color
4. Click on another filter and its also added to the filter criteria (look at the URL), e.g. WHERE type='t-shirt'
5. List updates and only shows items which are t-shirts with a green color
you can program the URL to filter any value, you are not tied to the catalog filter module. The list will filter and respond to URL variables as you set them, even manually typing them in will work (so you can test), e.g.
mylist/type/t-shirt/color/green.html
-
Re: join two filter
PS. If you want to ONLY list items on that page with a pre-filter (not shown in catalog filter), then you enter that in the Catalog List module, under Condition. Here you have to use ID values, as the value pairs are NOT translated like in the URL, e.g.
Condition
color=4
And you've set-up your taxonomy with green and its ID=4. This is usually the problem, because the DB stores the ID, not the actual reference value.
-
Re: join two filter
Ok, your example works right as long as I check only one box of each list, similar to radiobuttons. But when I aditionaly to green check also red, I dont get only red and green t-shirts, I also get red and green shoes. But I want to restict it to shirts, as long as only shirts is selected.
-
Re: join two filter
You can only select multiples if a field is a TAGS field. You have most likely used a SELECT field for your item's type (shoes, t-shirts). You cannot have a checkbox selection for a SELECT field in the filter, as an item cannot be in multiple categories.
-
Re: join two filter
The TAGS AND/OR selector is global, which means you can't use it PER field. The best option is to completely rewrite the method that the filtering and listing works.
-
Re: join two filter
Hmm, dont know how to continue…
Maybe it helps to show you my structure. With Taxonomy I manage two main items, type and color. Each main item is set as a seperate tags field in the catalogs database entries. The filter provides with “radiobuttons“ two seperate filter fields (typ and color) and shows them as two filter_fields in the frontend with checkboxes.
I wonder, if my structure is worse or if I cant hit my target at all? Thanks for your patience.
-
Re: join two filter
I suggest that you change the type to a SELECT, since its highly unlikely that you'd have an item that is BOTH shoes and t-shirts. Then if you select t-shirts in the Radio buttons/Select Menu (no longer a checkbox in the front-end), then you'll ONLY see items of that Type, e.g. t-shirts.
Unfortunately, if you change datatype in the current repository version, you will lose all data in that field type. The Alpha 2 version on Google code (see sticky forum message), contains a working version with this new code that won't mess up the database when you change field type.
-
Re: join two filter
Ok, youre right. An item cannot be both. But a listing could show both: shirts and shoes that are red or green. But as I understand it now, this is not possible at the current state.
I have now to consider how to organise my catalogs frontend filtering. Thanks for your support to my questions.
-
Re: join two filter
The default listing will contain all items. Then if you choose a color, all colors will be shown regardless of their type. If you then choose a specific type, then it will show ONLY that type (like DVDs, Books, etc.).
-
Re: join two filter
well, my output is different.
As I see it the global TAGS AND/OR restriction forces all tags options as eqal. In my case this means:
(taglist1-modus or)-modus OR-(taglist2-modus or)
what I mean is:
(taglist1-modus or)-modus AND-(taglist2-modus or)
Hope I expressed it right - I am no programmer and my explanation skill in this field is poor.