Jump to content

How to call Custom module controller bulk action


Recommended Posts

Hi, in Prestashop 1.7.8.8 I created A custom module with a Controller that works fine. I also did a new bulk action that displays correctly. But when I "execute" the action, it seems that submits something, but it's not executing the bulk action function I did. Here is an example of the code:

class AdminEtiquetasController extends ModuleAdminController
{
    public function __construct()
    {
        $this->bootstrap  = true;
        $this->table = 'orders';
        $this->identifier = 'id_order';
        $this->_path = _PS_MODULE_DIR_.'modulename';
        parent::__construct();

        $this->list_no_link = true;

        $this->bulk_actions = array(
            'imprimir_etiquetas' => array(
                'text'    => $this->l('Imprimir seleccionadas'),
                'icon'    => 'icon-print',
            ),
        );
	}

	protected function processBulkimprimir_etiquetas() 
    {
        $ids = '';
        if (is_array($this->boxes) && !empty($this->boxes)) {
            $deleted = false;
            foreach ($this->boxes as $id) {
                // EXECUTE CUSTOM ACTION FOR THE MARKED ORDERS
            }
        }
    }
}

Also I tried to delete the class_index.php but no luck. I remember that in other modules I did that and it worked allways.

Thanks in advance!

Link to comment
Share on other sites

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...