You are here

function uc_quote_order_update_rates in Ubercart 7.3

AJAX callback for applying shipping rates.

1 string reference to 'uc_quote_order_update_rates'
uc_order_pane_quotes in shipping/uc_quote/uc_quote.module
Shipping quote order pane callback.

File

shipping/uc_quote/uc_quote.module, line 907
The controller module for fulfillment modules that process physical goods.

Code

function uc_quote_order_update_rates($form, $form_state) {

  // Update shipping line item.
  if (isset($form_state['uc_quote'])) {
    $lid = $form_state['uc_quote']['lid'];
    $form['line_items'][$lid]['title']['#value'] = $form_state['uc_quote']['title'];
    $form['line_items'][$lid]['amount']['#value'] = $form_state['uc_quote']['amount'];
  }
  $commands[] = ajax_command_replace('#order-line-items', drupal_render($form['line_items']));

  // Reset shipping form.
  $commands[] = ajax_command_replace('#quote', drupal_render($form['quotes']['quotes']));
  $commands[] = ajax_command_prepend('#quote', theme('status_messages'));
  return array(
    '#type' => 'ajax',
    '#commands' => $commands,
  );
}