You are here

function commerce_backoffice_product_variation_type_delete_form_submit in Commerce Backoffice 7

Submit callback for commerce_product_product_type_delete_form().

1 string reference to 'commerce_backoffice_product_variation_type_delete_form_submit'
commerce_backoffice_product_variation_type_delete_form in includes/commerce_backoffice_product.product_variation_types.inc
Form callback: confirmation form for deleting a product variation type.

File

includes/commerce_backoffice_product.product_variation_types.inc, line 370
Product variation specific copy of commerce_product_ui/includes/commerce_product_ui.types.inc and commerce_product_ui/includes/commerce_product_ui.forms.inc.

Code

function commerce_backoffice_product_variation_type_delete_form_submit($form, &$form_state) {
  $product_type = $form_state['product_type'];
  commerce_product_ui_product_type_delete($product_type['type']);
  drupal_set_message(t('The product variation type %name has been deleted.', array(
    '%name' => $product_type['name'],
  )));
  watchdog('commerce_product', 'Deleted product variation type %name.', array(
    '%name' => $product_type['name'],
  ), WATCHDOG_NOTICE);
  $form_state['redirect'] = 'admin/commerce/config/product-variation-types';
}