Search the backend catalog by product keywords

LiteCart Fan
Tól től Netherlands
Tagság márc. 2021 óta

I want to be able to search the backend catalog for product keywords. However, this is not possible now and I don't know where to change this. Anyone have an idea or tips?

I had thought to find this in catalog.app/catalog myself but I made adjustments with a vmod but no effect.

tim
Founder
Tól től Sweden
Tagság máj. 2013 óta
tim

Are you using the left or right search field? (see atatched image)

What does your vmod look like?

For the right search field. Before line 301 in:
https://github.com/litecart/litecart/blob/2.5.2/public_html/admin/catalog.app/catalog.inc.php#L301

Try adding:

            + if(find_in_set('". database::input($_GET['query']) ."', p.keywords), 5, 0)

Find in set is pretty clumpsy though and does not take into consideration your commas may have space character after them. So you might want to try this:

            + if(find_in_set('". database::input($_GET['query']) ."', p.keywords) or find_in_set(' ". database::input($_GET['query']) ."', p.keywords), 5, 0)

You can also do partial match by like

+ if(p.keywords like '%". database::input($_GET['query']) ."%', 3, 0)

LiteCart Fan
Tól től Netherlands
Tagság márc. 2021 óta

Thanks, I did indeed mean the right search function. I think I'm best off with the line for a partial match.

Only thing I want to know is whether it is possible to refine a search result by searching with two keywords?

tim
Founder
Tól től Sweden
Tagság máj. 2013 óta
tim

You will have to break up the words into two separate matching clauses.

LiteCart Fan
Tól től Netherlands
Tagság márc. 2021 óta

Can you give me an example of how to do that? I don't quite understand it.

For example:
(product 1) red, duck
(product 2) blue, duck
(product 3) blue, dog

and I search
Duck Blue

then he finds nothing. I do find products on separate keywords, blue or duck but not together

tim
Founder
Tól től Sweden
Tagság máj. 2013 óta
tim

An example using regexp


+ if(p.keywords regexp '(^|, ?)Blue(,|$)', 5, 0)```
Ezt a témát a hosszú inaktivitás miatt bezártuk. A hozzászólás nem lehetséges.
Ez a weboldal nem használ cookie-kat és nem használ harmadik féltől származó nyomkövetési technológiát. Úgy gondoljuk, hogy jobban tudjuk csinálni, mint mások, és tényleg gondolunk az Ön magánéletére.