public function update($id, $params) { $status = Response::STATUS_BAD_REQUEST; $data = array(); $lang_code = $this->safeGet($params, 'lang_code', DEFAULT_LANGUAGE); $tax_id = fn_update_tax($params, $id, $lang_code); if ($tax_id) { $status = Response::STATUS_OK; $data = array('tax_id' => $tax_id); } return array('status' => $status, 'data' => $data); }
} // // Delete taxes // if ($mode == 'm_delete') { // Delete selected taxes if (!empty($_REQUEST['tax_ids'])) { fn_delete_taxes($_REQUEST['tax_ids']); } $suffix = '.manage'; } // // Update selected tax data // if ($mode == 'update') { $tax_id = fn_update_tax($_REQUEST['tax_data'], $_REQUEST['tax_id'], DESCR_SL); $suffix = ".update?tax_id={$tax_id}"; } if ($mode == 'apply_selected_taxes') { if (!empty($_REQUEST['tax_ids'])) { $tax_names = fn_get_tax_name($_REQUEST['tax_ids']); foreach ($_REQUEST['tax_ids'] as $v) { db_query("UPDATE ?:products SET tax_ids = ?p", fn_add_to_set('?:products.tax_ids', $v)); fn_set_notification('N', __('notice'), __('text_tax_applied', array('[tax]' => $tax_names[$v]))); } } $suffix = '.manage'; } if ($mode == 'unset_selected_taxes') { if (!empty($_REQUEST['tax_ids'])) { $tax_names = fn_get_tax_name($_REQUEST['tax_ids']);