Jump to content

Custom Bulk Action Admin


frajdy

Recommended Posts

Hi, i would like to implement my own bulk action function, like the one default in PS16 - change order status.

 

I was able to add a new button under the change order status, modified AdminOrdersController and added $this->bulk_actions my new action, but i can't figure out how to make own functions to process selected orders.

 

I think after clicking change order status is called function renderList()  in AdminOrdersController.php to show options of statuses

 

public function renderList()
    {
        if (Tools::isSubmit('submitBulkupdateOrderStatus'.$this->table))
        {
            if (Tools::getIsset('cancel'))
                Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token);
        
            $this->tpl_list_vars['updateOrderStatus_mode'] = true;
            $this->tpl_list_vars['order_statuses'] = $this->statuses_array;
            $this->tpl_list_vars['REQUEST_URI'] = $_SERVER['REQUEST_URI'];
            $this->tpl_list_vars['POST'] = $_POST;
        }
       
        return parent::renderList();
    }

 

and then function processBulkUpdateOrderStatus() to handle the selected.

 

Can somebody help me where can I add my own function or how to process the selected orders? Thx in advance for any help.

Link to comment
Share on other sites

  • 1 month later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...