You are here

function uc_attribute_option_delete_confirm_submit in Ubercart 5

Same name and namespace in other branches
  1. 6.2 uc_attribute/uc_attribute.admin.inc \uc_attribute_option_delete_confirm_submit()
  2. 7.3 uc_attribute/uc_attribute.admin.inc \uc_attribute_option_delete_confirm_submit()

Submit function for uc_attribute_option_delete_confirm().

File

uc_attribute/uc_attribute.module, line 719

Code

function uc_attribute_option_delete_confirm_submit($form_id, $form_values) {
  if ($form_values['confirm']) {
    $match = 'i:' . $form_values['aid'] . ';s:' . strlen($form_values['oid']) . ':"' . $form_values['oid'] . '";';
    db_query("DELETE FROM {uc_product_adjustments} WHERE combination LIKE '%%%s%%'", $match);
    db_query("DELETE ao, co, po FROM {uc_attribute_options} AS ao LEFT JOIN {uc_product_options} AS po ON ao.oid = po.oid LEFT JOIN {uc_class_attribute_options} AS co ON ao.oid = co.oid WHERE ao.oid = %d", $form_values['oid']);
  }
  return 'admin/store/products/attributes/' . $form_values['aid'] . '/options';
}