daniel1983 LiteCart Fan Fra Netherlands Medlem siden mar. 2021 daniel1983 mar. 8 2023 01:46 p.m. 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 Fra Sweden Medlem siden mai 2013 tim mar. 8 2023 04:26 p.m. 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)
daniel1983 LiteCart Fan Fra Netherlands Medlem siden mar. 2021 daniel1983 mar. 8 2023 05:12 p.m. 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 Fra Sweden Medlem siden mai 2013 tim mar. 8 2023 05:49 p.m. You will have to break up the words into two separate matching clauses.
daniel1983 LiteCart Fan Fra Netherlands Medlem siden mar. 2021 daniel1983 mar. 8 2023 07:02 p.m. 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 Fra Sweden Medlem siden mai 2013 tim mar. 9 2023 08:58 a.m. An example using regexp + if(p.keywords regexp '(^|, ?)Blue(,|$)', 5, 0)```