You are here

function uc_store_uninstall in Ubercart 7.3

Same name and namespace in other branches
  1. 8.4 uc_store/uc_store.install \uc_store_uninstall()
  2. 5 uc_store/uc_store.install \uc_store_uninstall()
  3. 6.2 uc_store/uc_store.install \uc_store_uninstall()

Implements hook_uninstall().

File

uc_store/uc_store.install, line 165
Install, update, and uninstall functions for the uc_store module.

Code

function uc_store_uninstall() {
  db_delete('variable')
    ->condition(db_or()
    ->condition('name', 'uc_address_format_%', 'LIKE')
    ->condition('name', 'uc_currency_%', 'LIKE')
    ->condition('name', 'uc_store_%', 'LIKE')
    ->condition('name', 'uc_weight_%', 'LIKE')
    ->condition('name', 'uc_length_%', 'LIKE')
    ->condition('name', 'uc_field_%', 'LIKE'))
    ->execute();
  variable_del('uc_customer_list_address');
  variable_del('uc_sign_after_amount');
  variable_del('date_format_uc_store');
  variable_del('uc_address_fields');
  variable_del('uc_address_fields_required');
  variable_del('uc_address_fields_weight');
  variable_del('uc_footer_message');

  // Unset mail Ubercart hander in variable mail_system
  $mail_system = variable_get('mail_system', array(
    'default-system' => 'DefaultMailSystem',
  ));
  unset($mail_system['uc_cart']);
  unset($mail_system['uc_order']);
  unset($mail_system['uc_file']);
  unset($mail_system['uc_roles']);
  unset($mail_system['uc_stock']);
  unset($mail_system['uc_store']);
  variable_set('mail_system', $mail_system);
}