You are here

function uc_taxes_form_alter in Ubercart 6.2

Same name and namespace in other branches
  1. 5 uc_taxes/uc_taxes.module \uc_taxes_form_alter()

Implements hook_form_alter().

File

uc_taxes/uc_taxes.module, line 100

Code

function uc_taxes_form_alter(&$form, $form_state, $form_id) {
  if ($form_id == 'uc_cart_checkout_form') {
    if (isset($form['panes']['payment'])) {
      drupal_add_js(array(
        'ucTaxWeight' => variable_get('uc_li_tax_weight', 9),
        'ucURL' => array(
          'calculateTax' => url('taxes/calculate'),
        ),
      ), 'setting');
      drupal_add_js(drupal_get_path('module', 'uc_taxes') . '/uc_taxes.js');
    }
  }
  elseif ($form_id == 'uc_order_edit_form') {
    if (isset($form['quotes'])) {
      drupal_add_js(array(
        'ucURL' => array(
          'calculateTax' => url('taxes/calculate'),
        ),
      ), 'setting');
      drupal_add_js(drupal_get_path('module', 'uc_taxes') . '/uc_taxes.js');
    }
  }
}