You are here

function commerce_free_shipping_uninstall in Commerce Free Shipping 7

Implements hook_uninstall().

File

./commerce_free_shipping.install, line 10
Commerce Free Shipping install function

Code

function commerce_free_shipping_uninstall() {
  $shipping_services = commerce_shipping_services();
  foreach ($shipping_services as $service) {
    $base = $service['base'];
    variable_del($base . '_free_shipping_enabled');
    variable_del($base . '_free_shipping_rate_limit');
    variable_del($base . '_free_shipping_rate_limit_currency');
    variable_del($base . '_free_shipping_excluded_line_item_types');
    variable_del($base . '_free_shipping_excluded_line_item_product_types');
    variable_del($base . '_free_shipping_gift_message_display');
    variable_del($base . '_free_shipping_gift_message');
    variable_del($base . '_free_shipping_reject_message_display');
    variable_del($base . '_free_shipping_reject_message');
    variable_del($base . '_free_shipping_additionnal_rules');
    variable_del($base . '_free_shipping_rules_reject_message_display');
    variable_del($base . '_free_shipping_rules_reject_message');
  }

  // Delete free shipping rules.
  $rules = rules_config_load_multiple(FALSE);
  foreach ($rules as $rule) {
    if (strpos($rule->name, 'commerce_free_shipping') === 0) {
      rules_config_delete(array(
        $rule->id,
      ));
    }
  }
}