I have just installed fields via Numix mod. However the fields are not searchable. Is there a file to change for what fields to search?
Thanks for any insight
I have just installed fields via Numix mod. However the fields are not searchable. Is there a file to change for what fields to search?
Thanks for any insight
Figured out one part to edit header.php but this only works for the website search. I would like it to work in the admin categories search so I can search for the product easy. What file would this need to edit and any ideas where to start. Thanks
Here is what I added for others if needed for SKU product only. I no nothing about coding but now search at least works on the website for SKU. I only guess at what I seen in the file.
In file includes/modules/pages/advanced_search_result/header.php
Line 162 added
case 'PRODUCT_LIST_SKU':
$select_column_list .= 'p.products_sku';
Line 169 added
case 'PRODUCT_LIST_SKU':
$select_column_list .= 'p.products_sku';
break;
Line 320 added
LIKE '%:keywords%'
OR p.products_sku
It is so pleasing to see someone using clear logic and common sense to solving a problem. Even when they do not fully understand the methods they are using - but by looking for patterns in the code, they come up with potential solutions.
Well, done... your efforts are a lesson to all of us...
And thank you for coming back to this thread to show us the solution you discovered.
20 years a Zencart User
I might be technically inclined, but I'm code stupid. Try things enough times and eventually you will find a solution. Heck I even learned a little bit in the process.
Still can't get the search in the admin interface under catalog items to search the sku. Also am trying to do the same in super orders for Purchase orders with no luck. Not sure how to reference a second table, which I think is what I do not understand yet.
Any ideas?
Thanks
If you still need the answer...
admin/includes/modules/category_product_listing.php
Add your_sku_db_field name to the $products_query_raw list
Then add a filter at the bottom that reads:
or p.products_YOUR_SKU_FIELD_HERE like '%" . zen_db_input($_GET['search']) . "%'
Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
Twitch Base8 - Obsidian - This, is what's new.
Hi Twitch Too,
Thanks for posting this even though it was really old! I still need to get this working. I will try it out this weekend.
Twitchtoo you are the man. I got this working with what you posted and did some other stuff with it that was pretty cool (at least I think) here is the page I posted on zencart to try and help someone else out with this topic if they need it Link to Zencart post.
Oh FYI I am sending you a donation for helping me out on this as well! Thank you!
Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
Twitch Base8 - Obsidian - This, is what's new.
Bookmarks