You are here

function hook_shipping_type in Ubercart 5

Same name and namespace in other branches
  1. 6.2 docs/hooks.php \hook_shipping_type()

Define shipping types for shipping methods.

This hook defines a shipping type that this module is designed to handle. These types are specified by a machine- and human-readable name called 'id', and 'title' respectively. Shipping types may be set for individual products, manufacturers, and for the entire store catalog. Shipping modules should be careful to use the same shipping type ids as other similar shipping modules (i.e., FedEx and UPS both operate on "small package" shipments). Modules that do not fulfill orders may not need to implement this hook.

Return value

An array of shipping types keyed by a machine-readable name.

7 functions implement hook_shipping_type()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

uc_product_get_shipping_type in shipping/uc_quote/uc_quote.module
Get a product's shipping type, defaulting to its manufacturer's or the store's if it doesn't exist.
uc_quote_condition_product_shipping_type in shipping/uc_quote/uc_quote.module
Returns true if the order has a product of the chosen shipping type.
uc_quote_get_shipping_type in shipping/uc_quote/uc_quote.module
Retrieve a product's or manufacturer's shipping type from the database.
uc_quote_set_shipping_type in shipping/uc_quote/uc_quote.module
Store the shipping type of products and manufacturers.
uc_quote_shipping_type in shipping/uc_quote/uc_quote.module
Implementation of Übercart's hook_shipping_type().

... See full list

5 invocations of hook_shipping_type()
uc_cart_pane_quotes in shipping/uc_quote/uc_quote.module
Cart pane callback.
uc_quote_condition_product_shipping_type_form in shipping/uc_quote/uc_quote.module
Settings form for uc_quote_condition_product_shipping_type().
uc_quote_shipping_type_options in shipping/uc_quote/uc_quote.module
Returns an array of shipping types to be selected in a form.
uc_shipping_new_shipment in shipping/uc_shipping/uc_shipping.module
Set up a new shipment with the chosen packages.
_uc_quote_assemble_quotes in shipping/uc_quote/uc_quote.module

File

docs/hooks.php, line 1007
These are the hooks that are invoked by the Übercart core.

Code

function hook_shipping_type() {
  $weight = variable_get('uc_quote_type_weight', array(
    'small_package' => 0,
  ));
  $types = array();
  $types['small_package'] = array(
    'id' => 'small_package',
    'title' => t('Small Packages'),
    'weight' => $weight['small_package'],
  );
  return $types;
}