You are here

function uc_get_zone_code in Ubercart 6.2

Same name and namespace in other branches
  1. 5 uc_store/uc_store.module \uc_get_zone_code()
  2. 7.3 uc_store/uc_store.module \uc_get_zone_code()

Returns the code abbreviation for a zone based on the zone ID or name.

16 calls to uc_get_zone_code()
uc_2checkout_form in payment/uc_2checkout/uc_2checkout.module
Form to build the submission to 2Checkout.com.
uc_authorizenet_arb_create in payment/uc_authorizenet/uc_authorizenet.module
Sends an ARB Create request via the XML API.
uc_cybersource_calculate_tax in payment/uc_cybersource/uc_cybersource.module
Calculates taxes for an order using CyberSource's tax service.
uc_cybersource_hop_form in payment/uc_cybersource/uc_cybersource.module
Define values to be posted to CyberSource.
uc_paypal_ec_checkout in payment/uc_paypal/uc_paypal.module
Redirects if a customer selects PayPal Express Checkout as a payment method.

... See full list

File

uc_store/uc_store.module, line 1126
Contains global Ubercart functions and store administration functionality.

Code

function uc_get_zone_code($zone = NULL) {
  if (empty($zone)) {
    return FALSE;
  }
  if (is_numeric($zone)) {
    $result = db_query("SELECT zone_code FROM {uc_zones} WHERE zone_id = %d", $zone);
  }
  else {
    $result = db_query("SELECT zone_code FROM {uc_zones} WHERE zone_name = '%s'", $zone);
  }
  if ($row = db_fetch_object($result)) {
    return $row->zone_code;
  }
  return FALSE;
}