You are here

function uc_flatrate_admin_method_confirm_delete_submit in Ubercart 5

Same name and namespace in other branches
  1. 6.2 shipping/uc_flatrate/uc_flatrate.admin.inc \uc_flatrate_admin_method_confirm_delete_submit()
  2. 7.3 shipping/uc_flatrate/uc_flatrate.admin.inc \uc_flatrate_admin_method_confirm_delete_submit()

File

shipping/uc_flatrate/uc_flatrate.module, line 314
Shipping quote module that defines a flat shipping rate for each product.

Code

function uc_flatrate_admin_method_confirm_delete_submit($form_id, $form_values) {
  db_query("DELETE FROM {uc_flatrate_methods} WHERE mid = %d", $form_values['mid']);
  db_query("DELETE FROM {uc_flatrate_products} WHERE mid = %d", $form_values['mid']);
  db_query("DELETE FROM {workflow_ng_cfgs} WHERE name = '%s'", 'uc_flatrate_get_quote_by_' . $form_values['type'] . '_rate_' . $form_values['mid']);
  workflow_ng_clear_cache();
  $enabled = variable_get('uc_quote_enabled', array());
  unset($enabled['flatrate_' . $form_values['mid']]);
  variable_set('uc_quote_enabled', $enabled);
  $weight = variable_get('uc_quote_method_weight', array());
  unset($weight['flatrate_' . $form_values['mid']]);
  variable_set('uc_quote_method_weight', $weight);
  drupal_set_message('Flat rate shipping method deleted.');
  return 'admin/store/settings/quotes/methods/flatrate';
}