function uc_get_zone_code in Ubercart 5
Same name and namespace in other branches
- 6.2 uc_store/uc_store.module \uc_get_zone_code()
- 7.3 uc_store/uc_store.module \uc_get_zone_code()
Return 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 - 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_paypal_ec_checkout in payment/
uc_paypal/ uc_paypal.module - uc_paypal_wpp_charge in payment/
uc_paypal/ uc_paypal.module
File
- uc_store/
uc_store.module, line 2049 - 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;
}