daniel1983 LiteCart Fan از کشور Netherlands عضو از مارس 2021 daniel1983 8 مارس 2023 13:46 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 از کشور Sweden عضو از مهٔ 2013 tim 8 مارس 2023 16:26 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 از کشور Netherlands عضو از مارس 2021 daniel1983 8 مارس 2023 17:12 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 از کشور Sweden عضو از مهٔ 2013 tim 8 مارس 2023 17:49 You will have to break up the words into two separate matching clauses.
daniel1983 LiteCart Fan از کشور Netherlands عضو از مارس 2021 daniel1983 8 مارس 2023 19:02 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 از کشور Sweden عضو از مهٔ 2013 tim 9 مارس 2023 08:58 An example using regexp + if(p.keywords regexp '(^|, ?)Blue(,|$)', 5, 0)```