dwojod Posted September 28, 2016 Share Posted September 28, 2016 Hello, in my module, in controller I want to delete object and I do it using bulk actions: $this->bulk_actions = array( 'delete' => array( 'text' => $this->l('Delete selected'), 'icon' => 'icon-trash', 'confirm' => $this->l('Delete selected items?') ) after this action I want to delete other row in database in second table of module using method created in Model, I don't know how to do it. I try conditional statement but it doesn't work if(Tools::isSubmit('submitBulkdelete'.$this->table) || Tools::isSubmit('delete'.$this->table)) or if(Tools::getIsset('submitBulkdelete'.$this->table) If I delete one row, my method works. Link to comment Share on other sites More sharing options...
dwojod Posted September 28, 2016 Author Share Posted September 28, 2016 ok, i found a solutions: bulkaction send parametr as array, I try send int variable, and my method doesm;t work $row_array = Tools::getValue($this->table.'Box'); if (count($row_array)) { foreach ($row_array as $id_gallery) { CategoryGalleryModel::deleteGallery((int)$id_gallery); } } 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