You are here

function uc_fulfillment_address_property_set in Ubercart 8.4

Entity metadata callback to set origin or destination address of an order.

1 string reference to 'uc_fulfillment_address_property_set'
uc_fulfillment_rules_data_info in shipping/uc_fulfillment/uc_fulfillment.rules.inc
Implements hook_rules_data_info().

File

shipping/uc_fulfillment/uc_fulfillment.rules.inc, line 188
Rules hooks for uc_fulfillment.module.

Code

function uc_fulfillment_address_property_set($shipment, $name, $address) {
  switch ($name) {
    case 'origin':
      $type = 'o_';
      break;
    case 'destination':
      $type = 'd_';
      break;
    default:
      return;
  }
  foreach ($address as $field => $value) {
    $shipment->{$type . $field} = $value;
  }
}