You are here

function commerce_coupon_uninstall in Commerce Coupon 7.2

Same name and namespace in other branches
  1. 7 commerce_coupon.install \commerce_coupon_uninstall()

Implements hook_uninstall().

File

./commerce_coupon.install, line 263
Installation hooks and procedures for Commerce Coupon.

Code

function commerce_coupon_uninstall() {
  module_load_include('module', 'commerce');

  // Delete any field instance attached to a coupon type.
  commerce_delete_instances('commerce_coupon');

  // Remove coupon reference field instance on order.
  if ($instance = field_info_instance('commerce_order', 'commerce_coupons', 'commerce_order')) {
    commerce_delete_instance($instance);
  }
}