I don't get it how it's possible that required filed asterisk is placed before label title on on uc-cart-checkout-form? Function form_element_label prints asterisk after label title.
I just wanted to print asterisk after the label title but can't find where it's located. According to dev module it's calling regular theme_form_element_label() but it's not behaving as intended.

Comments

longwave’s picture

Status: Active » Fixed

uc_store_pre_render_address_field() prepends theme('form_element_label') to the title to achieve this.

http://api.ubercart.me/api/drupal/ubercart!uc_store!uc_store.module/func...

xalexas’s picture

Thanks. Found it. How to change this without hacking uc_store.module? This function is not themable. Only way I can think of is to create hook_form_alter module.

longwave’s picture

Not sure really. hook_form_alter() might let you add your own pre_render callback, or remove the existing one. Alternatively a patch that adds a theme function might be accepted as a feature request.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

neochief’s picture

In your theme's template.php file, add this:

function THEME_NAME_uc_cart_checkout_form($variables) {
  foreach (element_children($variables['form']['panes']['billing']['address']) as $key) {
    unset($variables['form']['panes']['billing']['address'][$key]['#pre_render']);
  }
  return drupal_render_children($variables['form']);
}