Results 1 to 13 of 13

Thread: join two filter

  1. #1
    New user
    Join Date
    09-15-09.
    Posts
    8

    Default 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.

  2. #2
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default 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).

  3. #3
    New user
    Join Date
    09-15-09.
    Posts
    8

    Default 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.

  4. #4
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default 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

  5. #5
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default 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.

  6. #6
    New user
    Join Date
    09-15-09.
    Posts
    8

    Default 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.

  7. #7
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default 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.

  8. #8
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default 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.

  9. #9
    New user
    Join Date
    09-15-09.
    Posts
    8

    Default 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.

  10. #10
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default 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.

  11. #11
    New user
    Join Date
    09-15-09.
    Posts
    8

    Default 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.

  12. #12
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default 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.).

  13. #13
    New user
    Join Date
    09-15-09.
    Posts
    8

    Default 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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •