You are here

function uc_weightquote_admin_method_confirm_delete_submit in Ubercart 6.2

Same name and namespace in other branches
  1. 5 shipping/uc_weightquote/uc_weightquote.module \uc_weightquote_admin_method_confirm_delete_submit()
  2. 7.3 shipping/uc_weightquote/uc_weightquote.admin.inc \uc_weightquote_admin_method_confirm_delete_submit()

See also

uc_weightquote_admin_method_confirm_delete()

File

shipping/uc_weightquote/uc_weightquote.admin.inc, line 186
Weight quote shipping method administration menu items.

Code

function uc_weightquote_admin_method_confirm_delete_submit($form, &$form_state) {
  db_query("DELETE FROM {uc_weightquote_methods} WHERE mid = %d", $form_state['values']['mid']);
  db_query("DELETE FROM {uc_weightquote_products} WHERE mid = %d", $form_state['values']['mid']);
  ca_delete_predicate('uc_weightquote_get_quote_' . $form_state['values']['mid']);
  $enabled = variable_get('uc_quote_enabled', array());
  unset($enabled['weightquote_' . $form_state['values']['mid']]);
  variable_set('uc_quote_enabled', $enabled);
  $weight = variable_get('uc_quote_method_weight', array());
  unset($weight['weightquote_' . $form_state['values']['mid']]);
  variable_set('uc_quote_method_weight', $weight);
  drupal_set_message(t('Weight quote shipping method deleted.'));
  $form_state['redirect'] = 'admin/store/settings/quotes/methods/weightquote';
}