You are here

function theme_commerce_avatax_address in Drupal Commerce Connector for AvaTax 7.5

Same name and namespace in other branches
  1. 7.4 commerce_avatax.module \theme_commerce_avatax_address()

Format address array to be used in the address suggestion form.

2 theme calls to theme_commerce_avatax_address()
commerce_avatax_address_compare in includes/commerce_avatax.address.inc
Compare entered address and the validated addresses returned by AvaTax.
commerce_avatax_address_suggestion_form in ./commerce_avatax.module
Returns address suggestion form.

File

./commerce_avatax.module, line 1073
AvaTax service integration from Avalara, Inc.

Code

function theme_commerce_avatax_address($variables) {
  $address = $variables['address'];
  $components = array(
    $address['thoroughfare'],
  );
  if (!empty($address['premise'])) {
    $components[] = $address['premise'];
  }
  $components[] = $address['locality'];
  $components[] = $address['administrative_area'] . ' ' . $address['postal_code'];
  $components[] = $address['country'];
  return implode('<br/>', $components);
}