Wotek Posted May 27, 2015 Share Posted May 27, 2015 Hi, How can i select multiple on order list page ? i would like choose a few statuses. Add multiple = true, not working. Link to comment Share on other sites More sharing options...
PascalVG Posted May 27, 2015 Share Posted May 27, 2015 If you want that, you have to re-code the full code behind this function. It will have to go through the list of selected items, and then add them one after another to the status lists, with its change-date, its consequences for each status (like send email, validate order, etc, etc). You also find a way to tell in which order it has to add the statuses, and what is the final status etc. All in all not so easy, I'm afraid... My 2 cents, pascal. Link to comment Share on other sites More sharing options...
Wotek Posted May 27, 2015 Author Share Posted May 27, 2015 Ok. It's not so easy. Maybe i could list default a few statuses. Id,4,5,8 and 10. If i want display another i choose from list. How do you think ? Link to comment Share on other sites More sharing options...
PascalVG Posted May 28, 2015 Share Posted May 28, 2015 (edited) Well, roughly: In controllers/admin/AdminOrdersController.php, you will have to modify function: public function postProcess() Where it currently gets the single selected state: /* Change order status, add a new entry in order history and send an e-mail to the customer if needed */ elseif (Tools::isSubmit('submitState') && isset($order)) { if ($this->tabAccess['edit'] === '1') { $order_state = new OrderState(Tools::getValue('id_order_state')); What you could do, if you always want to add the same set of statuses , in this specific order, is to just select the last one (status with ID = 10) like you currently do, and then check if this last one is selected in above function. If so, go through this function with the other three fixed statuses first, and then add this final selected status to finish it. so something like: (Sample code from PS 1.6.0.14), add red code: (Make backup of the file first!!!!) if ($this->tabAccess['edit'] === '1') { $order_state_tmp = new OrderState(Tools::getValue('id_order_state')); $statusArr = null; if ($order_state_tmp == 10) // check if chosen state = 10. // If so, add it with three other statuses // to an array we use to 'loop' $statusArr[] = array(4,5,8,10); else $statusArr[] = array($order_state_tmp); // otherwise just add the chosen status to our array. foreach ($statusArr as $order_state) { // make a loop for all statuses in our new array ... // old code to handle the status } } /* Add a new message for the current order and send an e-mail to the customer if needed */ elseif (Tools::isSubmit('submitMessage') && isset($order)) { ... That should come close to what you need, I think. You may need to postpone the redirect we encounter in the original status change code until the last status change has been done: Tools::redirectAdmin(self::$currentIndex.'&id_order='.(int)$order->id.'&vieworder&token='.$this->token); I'll leave that as an exercise for you. So, with fixed statuses and fixed adding-order, I think this may work. If you randomly choose statuses, it will be much more difficult, as described in my reply above. Haven't tried the code, but expect something close to this should work. pascal. Edited May 28, 2015 by PascalVG (see edit history) Link to comment Share on other sites More sharing options...
sudar46 Posted May 31, 2016 Share Posted May 31, 2016 Select multiple Order state in Order list view Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now