function uc_flatrate_admin_method_confirm_delete_submit in Ubercart 6.2
Same name and namespace in other branches
- 5 shipping/uc_flatrate/uc_flatrate.module \uc_flatrate_admin_method_confirm_delete_submit()
- 7.3 shipping/uc_flatrate/uc_flatrate.admin.inc \uc_flatrate_admin_method_confirm_delete_submit()
See also
uc_flatrate_admin_method_confirm_delete()
File
- shipping/
uc_flatrate/ uc_flatrate.admin.inc, line 180 - Flat rate shipping method administration menu items.
Code
function uc_flatrate_admin_method_confirm_delete_submit($form, &$form_state) {
db_query("DELETE FROM {uc_flatrate_methods} WHERE mid = %d", $form_state['values']['mid']);
db_query("DELETE FROM {uc_flatrate_products} WHERE mid = %d", $form_state['values']['mid']);
ca_delete_predicate('uc_flatrate_get_quote_' . $form_state['values']['mid']);
$enabled = variable_get('uc_quote_enabled', array());
unset($enabled['flatrate_' . $form_state['values']['mid']]);
variable_set('uc_quote_enabled', $enabled);
$weight = variable_get('uc_quote_method_weight', array());
unset($weight['flatrate_' . $form_state['values']['mid']]);
variable_set('uc_quote_method_weight', $weight);
drupal_set_message(t('Flat rate shipping method deleted.'));
$form_state['redirect'] = 'admin/store/settings/quotes/methods/flatrate';
}