Skip to Content
Menú
This question has been flagged
3 Respostes
6683 Vistes

Hi,

could somebody please tell how to change the default search functionality to use AND instead of OR when doing a search. For example, if I have some products like this:

t-shirt - red - L

t-shirt - red - XL

t-shirt - black - L

t-shirt - black -XXL

skirt - black - S

and I would like to search for black t-shirts. I would like to enter search terms like: t-shirt, black. With the default behavior, OE7 returns all t-shirts and products with string black in their name.

BR Juha

Avatar
Descartar
Best Answer

To achieve this:

  • Click the search bar drop down arrow
  • Click Advanced Search
  • Set up a condition on any suitable field.
  • Hit Apply.
  • For your example, you can achieve the desired result by setting up 2 separate filters, the first has a condition on the field Name and its value is t-shirt, the other one has the value black
  • This way you can achieve the AND behavior.

Note: To achieve the OR behavior using this same method, all you have to do is create a filter with several conditions.

To sum it up:

  • Multiple filters with one condition each = AND
  • One filter with several conditions = OR
Avatar
Descartar
Autor

Hi, thank you for your answer. However this is not what I want to achieve. Using advanced filters is way too slow. My goal is to change the default behaviour to AND because that is the filtering type we need the most. I would also like to do the same when adding products to the sale or purchase order. Because variants are so poorly supported, this would help the variant selection a lot. BR Juha

Did anyone found another way to archieve? I am crawling the orm.py and expressions.py already to find a way but I am not successful so far.

Best Answer

I am also wondering this because I have over 3000 products and can't remember how they are exactly worded, so try to find product based off words out of order and only partial, the % works to an extent if I can remember what order the words show up in, but would like to find a solution that shows all results regardless of search order

Avatar
Descartar
Autor Best Answer

Hi, there is kind of a way to achieve this functionality by using "%"-sign in searches. It is not perfect in any means but works somehow.

br juha

Avatar
Descartar
Related Posts Respostes Vistes Activitat
0
de des. 23
5320
8
de jul. 24
16595
4
de nov. 23
3632
1
de des. 22
6274
16
de set. 24
77863