function uc_pma_payment_method_ajax in Ubercart Payment Method Adjustments 7
AJAX callback for payment method details on the checkout form and adding a line item of payment method adjustment.
1 string reference to 'uc_pma_payment_method_ajax'
- uc_pma_form_alter in ./
uc_pma.module - Implements hook_form_alter().
File
- ./
uc_pma.module, line 85 - This module hooks into a few different parts of Ubercart to allow store administrators to associate a fee or discount with payment methods.
Code
function uc_pma_payment_method_ajax($form, $form_state) {
if (isset($form['panes']['payment']['details'])) {
$commands[] = ajax_command_replace('#payment-details', drupal_render($form['panes']['payment']['details']));
}
if (isset($form['panes']['payment']['line_items'])) {
$commands[] = ajax_command_replace('#line-items-div', drupal_render($form['panes']['payment']['line_items']));
$commands[] = ajax_command_prepend('#line-items-div', theme('status_messages'));
}
return array(
'#type' => 'ajax',
'#commands' => $commands,
);
}