You are here

function theme_uc_payment_method_select in Ubercart 6.2

Same name and namespace in other branches
  1. 5 payment/uc_payment/uc_payment_checkout_pane.inc \theme_uc_payment_method_select()

We need a theme function for the radios element in case another module alters the default or available payment methods... we need the JS to grab the right default payment details.

1 theme call to theme_uc_payment_method_select()
uc_checkout_pane_payment in payment/uc_payment/uc_payment_checkout_pane.inc
@file Checkout pane functions for uc_payment.module.

File

payment/uc_payment/uc_payment_checkout_pane.inc, line 156
Checkout pane functions for uc_payment.module.

Code

function theme_uc_payment_method_select($form) {
  if (empty($form['#options'])) {
    drupal_set_message(t('Checkout cannot be completed without any payment methods enabled. Please contact an administrator to resolve the issue.'), 'error');
    return;
  }

  // Perhaps instead this should be a normal JS function and we just print the
  // default payment method to a JS variable or use a selector.  -RS
  drupal_add_js(array(
    'ucDefaultPayment' => $form['#default_value'],
  ), 'setting');
  return drupal_render($form);
}