You are here

function commerce_shipping_module_implements_alter in Commerce Shipping 7.2

Implements hook_module_implements_alter().

File

./commerce_shipping.module, line 185
Defines a system for calculating shipping costs associated with an order.

Code

function commerce_shipping_module_implements_alter(&$implementations, $hook) {

  // To allow the default rules defined by this module to be overridden by other
  // modules (such as Features produced modules), we need to ensure that this
  // module's hook_default_rules_configuration() is invoked before theirs.
  if ($hook == 'default_rules_configuration') {

    // Extract this module's entry from the hook implementations array.
    $group = $implementations['commerce_shipping'];
    unset($implementations['commerce_shipping']);

    // And re-add it by prepending it back onto the array.
    $implementations = array(
      'commerce_shipping' => $group,
    ) + $implementations;
  }
}