function uc_weightquote_admin_method_confirm_delete_submit in Ubercart 5
Same name and namespace in other branches
- 6.2 shipping/uc_weightquote/uc_weightquote.admin.inc \uc_weightquote_admin_method_confirm_delete_submit()
- 7.3 shipping/uc_weightquote/uc_weightquote.admin.inc \uc_weightquote_admin_method_confirm_delete_submit()
File
- shipping/
uc_weightquote/ uc_weightquote.module, line 318 - Shipping quote module that defines a shipping rate for each product based on weight.
Code
function uc_weightquote_admin_method_confirm_delete_submit($form_id, $form_values) {
db_query("DELETE FROM {uc_weightquote_methods} WHERE mid = %d", $form_values['mid']);
db_query("DELETE FROM {uc_weightquote_products} WHERE mid = %d", $form_values['mid']);
db_query("DELETE FROM {workflow_ng_cfgs} WHERE name = '%s'", 'uc_weightquote_get_quote_by_' . $form_values['type'] . '_rate_' . $form_values['mid']);
workflow_ng_clear_cache();
$enabled = variable_get('uc_quote_enabled', array());
unset($enabled['weightquote_' . $form_values['mid']]);
variable_set('uc_quote_enabled', $enabled);
$weight = variable_get('uc_quote_method_weight', array());
unset($weight['weightquote_' . $form_values['mid']]);
variable_set('uc_quote_method_weight', $weight);
drupal_set_message('Weight quote shipping method deleted.');
return 'admin/store/settings/quotes/methods/weightquote';
}