thien le Posted May 17, 2011 Share Posted May 17, 2011 Currently I have blocksearch on my site, I wish to search by product ID. Can anyone help? Thanks Link to comment Share on other sites More sharing options...
shokinro Posted May 17, 2011 Share Posted May 17, 2011 I think you need some add one more filed to indicate it is search by product id or not.others wise, you don't know if user input is a product id or name or anything else.you can modify the "Quick Search block" module which is located in YourSiteRoot/modules/blocksearch/ Link to comment Share on other sites More sharing options...
thien le Posted May 17, 2011 Author Share Posted May 17, 2011 I thought any modifications should be made at search.php? Link to comment Share on other sites More sharing options...
shokinro Posted May 18, 2011 Share Posted May 18, 2011 it depends what version of your PrestaShop, slightly different.Because search by product ID usually only hit one record.So you will need write a simple SQL to get the record you want and return it, here is So based on the select of search by on UI, if it is search by ID, then use following SQL to retrieve SELECT * FROM `'._DB_PREFIX_.'product` where id_product = X where X is user input ID to searchif not search by ID, then use default way Link to comment Share on other sites More sharing options...
thien le Posted May 19, 2011 Author Share Posted May 19, 2011 Thanks shokinro, I am actually looking a solution to integrate this function to current search system (search.php) because as far as I understand that blocksearch used search.php file from default system. Link to comment Share on other sites More sharing options...
pbweb99 Posted May 20, 2011 Share Posted May 20, 2011 Hello,This Topic might help. you can have auto fill for reference id from product id. http://www.prestashop.com/forums/viewthread/80805/development/create_sql_trigger_copy_product_id_to_reference_id Link to comment Share on other sites More sharing options...
shokinro Posted May 20, 2011 Share Posted May 20, 2011 thanks for sharing the link.yes, it is a good idea to copy product id to reference field so that user can search product id with reference directly. Link to comment Share on other sites More sharing options...
Teapot Creative Posted September 4, 2013 Share Posted September 4, 2013 Bump.... Link to comment Share on other sites More sharing options...
midunmkumar Posted November 6, 2014 Share Posted November 6, 2014 hi am new to prestashop.. i want to add product id to search option can anyone help me to where i can made this changes Link to comment Share on other sites More sharing options...
kaiitechonline Posted December 11, 2015 Share Posted December 11, 2015 bump! im newbie too. i want to know how to add query in search.phpsearching product id.prestashop 1.6.1.1 version Link to comment Share on other sites More sharing options...
Recommended Posts