/** * delete the object and updates the product quantities */ function delete() { $this->message = ''; $this->messagetype = ''; $error = false; $cids = JRequest::getVar('cid', array(0), 'request', 'array'); // Get the ProductQuantities model $qmodel = JModel::getInstance('ProductQuantities', 'TiendaModel'); // Filter the quantities $qmodel->setState('filter_attributes', implode(',', $cids)); $quantities = $qmodel->getList(); $qtable = $qmodel->getTable(); // Delete the product quantities foreach (@$quantities as $q) { if (!$qtable->delete($q->productquantity_id)) { $this->message .= $qtable->getError(); $this->messagetype = 'notice'; $error = true; } } if ($error) { $this->message = JText::_('COM_TIENDA_ERROR') . " - " . $this->message; } else { $this->message = JText::_('COM_TIENDA_ITEMS_DELETED'); } // delete the option itself parent::delete(); }
/** * Overrides the delete method, to include the custom models and tables. */ public function delete() { $this->includeCustomModel('ShippingRates'); $this->includeCustomTables(); parent::delete(); }
/** * Deletes record(s) and redirects to default layout */ function delete() { $model = $this->getModel($this->get('suffix')); $row = $model->getTable(); $row->load($model->getId()); $geozoneid = $row->geozone_id; $this->redirect = JRequest::getVar('return') ? base64_decode(JRequest::getVar('return')) : "index.php?option=com_tienda&task=configzones&tmpl=component&geozoneid={$geozoneid}&view==" . $this->get('suffix'); $this->redirect = JRoute::_($this->redirect, false); parent::delete(); }
/** * Displays list of orders to update their status * provide diffrent functions like send mail to user update staus etc. * @return void */ function delete() { $confirmdelete = JRequest::getInt('confirmdelete'); if (!empty($confirmdelete)) { parent::delete(); } else { $cids = JRequest::getVar('cid', array(0), 'request', 'array'); // select only the ids from cid $model = $this->getModel($this->get('suffix')); $query = $model->getQuery(); $query->where("tbl.order_id IN ('" . implode("', '", $cids) . "') "); $model->setQuery($query); // create view, assign model, and display $view = $this->getView('orders', 'html'); $view->set('_controller', 'orders'); $view->set('_view', 'orders'); $view->setModel($model, true); $items = $model->getList(); $view->assign('items', $items); $view->assign('pagination', $model->getPagination()); $view->assign('state', $model->getState()); $view->setLayout('confirmdelete'); $view->setTask(true); $view->display(); $this->footer(); } }