You are here

function hook_uc_addresses_order_load in Ubercart Addresses 7

This hook allows you to act on addresses being attached on an order.

Parameters

object $order: The order to which addresses are attached.

Return value

void

1 invocation of hook_uc_addresses_order_load()
uc_addresses_order_attach_addresses in ./uc_addresses.module
Attaches UcAddressesAddress instances to the order.

File

./uc_addresses.api.php, line 215
These hooks are invoked by the Ubercart Addresses module. @todo more documentation needed for hook_uc_addresses_field_handlers(). @todo Document the rest of the API.

Code

function hook_uc_addresses_order_load($order) {

  // Example: set a value for my custom added field (through hook_uc_addresses_fields()).
  if (isset($order->uc_addresses['shipping'])) {
    $order->uc_addresses['shipping']
      ->setField('myfield', 'myvalue');
  }
  if (isset($order->uc_addresses['billing'])) {
    $order->uc_addresses['billing']
      ->setField('myfield', 'myvalue');
  }
}