ganeshgp Posted February 25, 2014 Share Posted February 25, 2014 (edited) how to add the bulk actions with dropdown prestashop v 1.5.6.1 I want to add the order status drop down in order grid view. for the purpose of batch order status change Edited February 25, 2014 by ganeshgp (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted February 25, 2014 Share Posted February 25, 2014 how to add the bulk actions with dropdown prestashop v 1.5.6.1 what actions? and where? for what purposes? please elaborate a bit more, now no one knows what you exactly want to achieve. Link to comment Share on other sites More sharing options...
codeincode Posted March 4, 2014 Share Posted March 4, 2014 Hi, I have one problem. I need a button that will change the status of the selected orders to "sended". Can you help me? I add this button to template: $this->bulk_actions = array('sended' => array('text' => 'Oznacz jako wysłane', 'confirm' => 'Na pewno chcesz zmienić status dla zaznaczonych zamówień?')); and now I wonder what to do next. Link to comment Share on other sites More sharing options...
vekia Posted March 4, 2014 Share Posted March 4, 2014 where you added this code? Link to comment Share on other sites More sharing options...
codeincode Posted March 5, 2014 Share Posted March 5, 2014 In controllers/admin/AdminOrdersController.php Link to comment Share on other sites More sharing options...
codeincode Posted March 5, 2014 Share Posted March 5, 2014 I solved my problem Link to comment Share on other sites More sharing options...
rv01 Posted March 6, 2014 Share Posted March 6, 2014 Hi, I am interested to know how you did that: "select orders in orders list and change the status of the selected orders" THANKS Link to comment Share on other sites More sharing options...
codeincode Posted March 6, 2014 Share Posted March 6, 2014 I added: 1.This code: $this->bulk_actions = array('sended' => array('text' => 'Mark as sent', 'confirm' => 'your message to user')); In file AdminOrdersController.php, in public function __construct() 2. This code: protected function processBulkSended(){ if (is_array($this->boxes) && !empty($this->boxes)){ $employee_id = $this->context->employee->id; $new_order_state = 4; // id state $dbQuery = Db::getInstance(); foreach ($this->boxes as $id_order){ $result = $dbQuery->query('UPDATE '._DB_PREFIX_.'orders SET current_state = '.$new_order_state.' WHERE id_order = '.$id_order); } } } In AdminController.php 3. Add 'sended' to: protected $actions_available = array('view', 'edit', 'delete', 'duplicate', 'sended'); In AdminController.php 1 Link to comment Share on other sites More sharing options...
ganeshgp Posted March 6, 2014 Author Share Posted March 6, 2014 I added: 1.This code: $this->bulk_actions = array('sended' => array('text' => 'Mark as sent', 'confirm' => 'your message to user')); In file AdminOrdersController.php, in public function __construct() 2. This code: protected function processBulkSended(){ if (is_array($this->boxes) && !empty($this->boxes)){ $employee_id = $this->context->employee->id; $new_order_state = 4; // id state $dbQuery = Db::getInstance(); foreach ($this->boxes as $id_order){ $result = $dbQuery->query('UPDATE '._DB_PREFIX_.'orders SET current_state = '.$new_order_state.' WHERE id_order = '.$id_order); } } } In AdminController.php 3. Add 'sended' to: protected $actions_available = array('view', 'edit', 'delete', 'duplicate', 'sended'); In AdminController.php ok thanks how to get the $new_order_state from the order grid view ..? please help me... Link to comment Share on other sites More sharing options...
codeincode Posted March 6, 2014 Share Posted March 6, 2014 You can find id of statuses in admin panel: Orders -> Statuses Link to comment Share on other sites More sharing options...
ganeshgp Posted March 6, 2014 Author Share Posted March 6, 2014 ok thanks how to get the $new_order_state from the order grid view ..? please help me... Ok thanks admin panel i want how to show the order statuses are included in drop down that code i need... Link to comment Share on other sites More sharing options...
ganeshgp Posted March 6, 2014 Author Share Posted March 6, 2014 Ok thanks admin panel i want how to show the order statuses are included in drop down that code i need... For example this is your $this->bulk_actions = array('sended' => array('text' => 'Mark as sent', 'confirm' => 'your message to user')); this code produce "Mark as sent" button similarly i need the code for dropdown with order status..Thanks Link to comment Share on other sites More sharing options...
ganeshgp Posted March 6, 2014 Author Share Posted March 6, 2014 Hi, I added the gift voucher from admin side. It was displayed properly in cart summary. I need automatically apply for the check out without selecting the voucher code if it is applicable the order Thanks Ganesan Link to comment Share on other sites More sharing options...
diondp Posted February 23, 2015 Share Posted February 23, 2015 Thats great, but how do you handle email to the customers with this "bulk-actions" i dont see any code triggering sending the corresponding email (if the status is setup for it) 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