function uc_get_zone_code in Ubercart 7.3
Same name and namespace in other branches
- 5 uc_store/uc_store.module \uc_get_zone_code()
- 6.2 uc_store/uc_store.module \uc_get_zone_code()
Returns the code abbreviation for a zone based on the zone ID or name.
14 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_cybersource_hop_form in payment/
uc_cybersource/ uc_cybersource.module - Defines values to be posted to CyberSource.
- uc_cybersource_uc_calculate_tax in payment/
uc_cybersource/ uc_cybersource.module - Implements hook_uc_calculate_tax().
- uc_paypal_ec_checkout in payment/
uc_paypal/ uc_paypal.module - Redirects if a customer selects PayPal Express Checkout as a payment method.
- uc_paypal_wpp_charge in payment/
uc_paypal/ uc_paypal.module - Processes a credit card payment through Website Payments Pro.
File
- uc_store/
uc_store.module, line 1160 - 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 = :id", array(
':id' => $zone,
));
}
else {
$result = db_query("SELECT zone_code FROM {uc_zones} WHERE zone_name = :name", array(
':name' => $zone,
));
}
if ($row = $result
->fetchObject()) {
return $row->zone_code;
}
return FALSE;
}