Search the backend catalog by product keywords

LiteCart Fan
Lähettäjä Netherlands
Jäsen alkaen maalisk. 2021

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
Lähettäjä Sweden
Jäsen alkaen toukok. 2013
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
Lähettäjä Netherlands
Jäsen alkaen maalisk. 2021

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
Lähettäjä Sweden
Jäsen alkaen toukok. 2013
tim

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

LiteCart Fan
Lähettäjä Netherlands
Jäsen alkaen maalisk. 2021

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
Lähettäjä Sweden
Jäsen alkaen toukok. 2013
tim

An example using regexp


+ if(p.keywords regexp '(^|, ?)Blue(,|$)', 5, 0)```
This thread has been closed due to long inactivity. Posting to it is not possible.
This website uses no cookies and no third party tracking technology. We think we can do better than others and really think about your privacy.