nicocolino Posted September 26, 2014 Share Posted September 26, 2014 Hi, there is a way to search a product by it's id when adding it to an order?? Link to comment Share on other sites More sharing options...
bellini13 Posted September 26, 2014 Share Posted September 26, 2014 are you talking about the front or back office? Link to comment Share on other sites More sharing options...
nicocolino Posted September 26, 2014 Author Share Posted September 26, 2014 backoffice Link to comment Share on other sites More sharing options...
bellini13 Posted September 26, 2014 Share Posted September 26, 2014 what version of Prestashop? are you referring to converting a shopping cart to an order? give more information and you will get better assistance Link to comment Share on other sites More sharing options...
nicocolino Posted September 26, 2014 Author Share Posted September 26, 2014 (edited) PS is 1.6 the task i need to do is this: i have an order made by a customer, this one calls me and ask if is possible add another product to it's order.. In back office i go in orders, select it's order and then, in bottom of the page i try to search the product to add... the problem is that in that field i need to put the product id and not the name of the product but PS seems to work only with name of products or manufacturer's id. There is a way to search, in that field, the product by it's id? Edited September 26, 2014 by nicocolino (see edit history) Link to comment Share on other sites More sharing options...
bellini13 Posted September 26, 2014 Share Posted September 26, 2014 The Admin Orders Controller does a specific search based on Product name and is language sensitive, so it will only find products based on the employees language preference. So it would appear to be designed to only allow searching on product name. That doesn't prevent you from overriding this functionality and either changing it to locate products by their ID, or by searching by both product ID and Name. unfortunately I do not see a good way of doing this via a module, so creating an override of the "ajaxProcessSearchProducts" function in the AdminOrdersController file would be necessary. I would suggest doing this. 1) When searching by Product Id, you would enter #10 where 10 is the product ID. This way the code would check if the value leads with a # then it knows you are searching for a product by ID and would skip the name search 2) When searching by Name, you would not lead with the #, and then the code would only perform the name search like it already does. Now something to consider, it currently only works after you type 3 characters into the search field. So you cannot type 1, and you cannot type 10, you would have to type 100 for the search to even trigger. So that javascript logic would have to also change so that you can perform a search for products between 1 and 99 Now as for options 1) You can submit a bug report to Prestashop and hope they will enhance their software to include this type of functionality 2) You can do this development yourself if you are experienced in PHP and Prestashop development 3) You can wait for a community member to offer you a free solution 4) You can move your request to the Paid Job Offers forum and wait for bids You can also contact me via PM or my website and I can provide you with an estimate if you wish to pursue option #4 Link to comment Share on other sites More sharing options...
Recommended Posts