You are here

function uc_order_address in Ubercart 7.3

Same name and namespace in other branches
  1. 5 uc_order/uc_order.module \uc_order_address()
  2. 6.2 uc_order/uc_order.module \uc_order_address()

Returns an address from an order object.

Parameters

$order: An order object.

$type: Either 'delivery' or 'billing'.

6 calls to uc_order_address()
template_preprocess_uc_packing_slip in shipping/uc_shipping/uc_shipping.module
Preprocess function to make tokens available in the packing slip template.
uc_checkout_pane_address in uc_cart/uc_cart_checkout_pane.inc
Generic address pane handler.
uc_order_pane_bill_to in uc_order/uc_order.order_pane.inc
Handles the "Bill to" order pane.
uc_order_pane_ship_to in uc_order/uc_order.order_pane.inc
Handles the "Ship to" order pane.
uc_order_tokens in uc_order/uc_order.tokens.inc
Implements hook_tokens().

... See full list

File

uc_order/uc_order.module, line 1604

Code

function uc_order_address($order, $type) {
  $name = $order->{$type . '_first_name'} . ' ' . $order->{$type . '_last_name'};
  $address = uc_address_format($order->{$type . '_first_name'}, $order->{$type . '_last_name'}, $order->{$type . '_company'}, $order->{$type . '_street1'}, $order->{$type . '_street2'}, $order->{$type . '_city'}, $order->{$type . '_zone'}, $order->{$type . '_postal_code'}, $order->{$type . '_country'});
  if (variable_get('uc_order_capitalize_addresses', TRUE)) {
    $address = drupal_strtoupper($address);
  }
  return $address;
}