function theme_uc_payment_method_select in Ubercart 5
Same name and namespace in other branches
- 6.2 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
- payment/
uc_payment/ uc_payment_checkout_pane.inc, line 119
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
uc_add_js("\$(document).ready( function () { init_payment_details('" . $form['#default_value'] . "'); } );", 'inline');
return drupal_render($form);
}