public function deleteProductListItems() { $listItems = $this->input->get('listItems'); $productListId = $this->input->get('productListId'); if (!empty($listItems)) { // Delete List Items $userLists = $this->product_model->getProductLists($this->getUserId(), $this->isAdmin()); $listIds = array(); foreach ($userLists as $list) { $listIds[] = $list->id; } $this->product_model->deleteProductListItems($listItems, $listIds); } $this->output->set_content_type('application/json')->set_output(json_encode(array('error' => false))); }