You are here

function commerce_shipping_plugin_get_plugins in Commerce Shipping 7

Get commerce_shipping plugins of a specific type

Parameters

$plugin_type: The type of plugin to get.

Return value

array of ctools plugin definitions.

3 calls to commerce_shipping_plugin_get_plugins()
commerce_shipping_commerce_price_component_type_info in ./commerce_shipping.module
Implements hook_commerce_price_component_type_info().
commerce_shipping_default_rules_configuration in ./commerce_shipping.rules_defaults.inc
Implements hook_default_rules_configuration().
commerce_shipping_rules_action_info in ./commerce_shipping.rules.inc
Implements hook_rules_action_info().

File

./commerce_shipping.module, line 422
Defines the shipping system and checkout integration.

Code

function commerce_shipping_plugin_get_plugins($plugin_type = 'quotes') {
  ctools_include('plugins');
  $plugins = ctools_get_plugins('commerce_shipping', $plugin_type);
  foreach ($plugins as $id => &$plugin) {
    if ($plugin_type == 'quotes') {
      if (!isset($plugin['method_id'])) {
        $plugin['method_id'] = $id;
      }
      commerce_shipping_set_default_quotes_values($plugin);
    }
  }
  return $plugins;
}