You are here

function uc_quote_get_shipping_type in Ubercart 5

Same name and namespace in other branches
  1. 8.4 shipping/uc_quote/uc_quote.module \uc_quote_get_shipping_type()
  2. 6.2 shipping/uc_quote/uc_quote.module \uc_quote_get_shipping_type()
  3. 7.3 shipping/uc_quote/uc_quote.module \uc_quote_get_shipping_type()

Retrieve a product's or manufacturer's shipping type from the database.

Parameters

$id_type: product | manufacturer

$id: Either the node id or term id of the object that was assigned the shipping type.

Return value

The shipping type.

2 calls to uc_quote_get_shipping_type()
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_form_alter in shipping/uc_quote/uc_quote.module
Implementation of hook_form_alter().

File

shipping/uc_quote/uc_quote.module, line 904
The controller module for fulfillment modules that process physical goods.

Code

function uc_quote_get_shipping_type($id_type, $id) {
  static $types = array();
  if (!isset($types[$id_type][$id])) {
    $types[$id_type][$id] = db_result(db_query("SELECT shipping_type FROM {uc_quote_shipping_types} WHERE id_type = '%s' AND id = %d", $id_type, $id));
  }
  return $types[$id_type][$id];
}