You are here

function commerce_shipping_plugin_get_plugin in Commerce Shipping 7

Util function to get shipping plugins.

5 calls to commerce_shipping_plugin_get_plugin()
commerce_shipping_enable_method in ./commerce_shipping.rules.inc
Generic execution callback for the shipping method.
commerce_shipping_line_item_title in ./commerce_shipping.module
Returns an appropriate title for this line item.
commerce_shipping_method_instance_load in ./commerce_shipping.module
Returns a shipping method instance object which includes the settings specific to the context of the instance.
commerce_shipping_pane_checkout_form_submit in includes/commerce_shipping.checkout_pane.inc
shipping pane: submit callback.
commerce_shipping_plugin_get_plugin_class in ./commerce_shipping.module
Util function to get shipping plugin class.

File

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

Code

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