You are here

function commerce_avatax_profile_copy_validate in Drupal Commerce Connector for AvaTax 7.5

Element validate callback for the profile copy checkbox.

1 string reference to 'commerce_avatax_profile_copy_validate'
commerce_avatax_form_alter in ./commerce_avatax.module
Implements hook_form_alter().

File

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

Code

function commerce_avatax_profile_copy_validate($element, &$form_state, $form) {
  $triggering_element = end($form_state['triggering_element']['#array_parents']);

  // HACK: Fool the profile copy checkbox by making it believe the checkout
  // continue button was clicked.
  if ($triggering_element == 'validate-address') {
    array_pop($form_state['triggering_element']['#array_parents']);
    $form_state['triggering_element']['#array_parents'][] = 'continue';
  }
}