You are here

function commerce_avatax_update_7401 in Drupal Commerce Connector for AvaTax 7.4

Implements hook_update().

File

./commerce_avatax.install, line 11
Installation functions for Commerce AvaTax Connector.

Code

function commerce_avatax_update_7401() {
  $company_code = variable_get('commerce_avatax_company_code');
  if ($company_code) {
    $product_version = variable_get('commerce_avatax_product_version');
    $use_mode = variable_get('commerce_avatax_use_mode');
    $update = $company_code;
    $update_var_name = 'commerce_avatax_' . $product_version . '_' . $use_mode . '_company';
    variable_set($update_var_name, $update);
    variable_del('commerce_avatax_company_code');
  }
  $country = variable_get('commerce_avatax_primary_country');
  if (!$country) {
    $country = 'US';
    $update = $country;
    $update_var_name = 'commerce_avatax_primary_country';
    variable_set($update_var_name, $update);
  }
  $account_name = variable_get('commerce_avatax_account_name');
  if (!$account_name) {
    $account_name = variable_get('site_name');
    $update = $account_name;
    $update_var_name = 'commerce_avatax_account_name';
    variable_set($update_var_name, $update);
  }
}