You are here

function commerce_recurring_uninstall in Commerce Recurring Framework 7.2

Same name and namespace in other branches
  1. 7 commerce_recurring.install \commerce_recurring_uninstall()

Implements hook_uninstall().

File

./commerce_recurring.install, line 126

Code

function commerce_recurring_uninstall() {
  module_load_include('module', 'commerce');
  module_load_include('module', 'commerce_product_ui');

  // Delete recurring product type and field instances.
  commerce_product_ui_product_type_delete('recurring');
  commerce_delete_instances('commerce_product', 'recurring');

  // Delete field instances from commerce recurring entity.
  commerce_delete_instances('commerce_recurring');

  // Delete all fields created by this module.
  $fields = array(
    'commerce_recurring_ini_price',
    'commerce_recurring_rec_price',
    'commerce_recurring_ini_period',
    'commerce_recurring_rec_period',
    'commerce_recurring_end_period',
    'commerce_recurring_ref_product',
    'commerce_recurring_order',
    'commerce_recurring_fixed_price',
  );
  foreach ($fields as $field_name) {
    commerce_delete_field($field_name);
  }
}