You are here

function uc_quote_get_shipping_type in Ubercart 7.3

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

Retrieves shipping type information from the database.

Parameters

$id_type: Type can be 'product' or '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
Gets a product's shipping type.
uc_quote_form_alter in shipping/uc_quote/uc_quote.module
Implements hook_form_alter().

File

shipping/uc_quote/uc_quote.module, line 397
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_query("SELECT shipping_type FROM {uc_quote_shipping_types} WHERE id_type = :type AND id = :id", array(
      ':type' => $id_type,
      ':id' => $id,
    ))
      ->fetchField();
  }
  return $types[$id_type][$id];
}