views:

212

answers:

3

How do you change the QTY (quantity) label in UberCart (in Drupal) without actually hacking the core components? I want the label to be be months, instead of qty.

+1  A: 

I haven't used ubercarts, but I would guess there would be an admin section to do that. Else hook_form_alter() or hook_form_FORM_ID_alter() should be able to do the trick for you.

googletorp
+2  A: 

You could use the "String Overrides"-Module (http://drupal.org/project/stringoverrides). I once ran into a similar issue with ubercart in another language (german), and we "solved" it by re-translating the string. The mentioned module should do the trick in your case.

schneck
+1  A: 

Unfortunately, there is no setting for this in ubercart.

Doing a search for 'Qty' (case sensitive, as there are numerous 'qty' in code) in the current ubercart-6.x-2.0-rc7 release gives seven matches:

  • 3 in theme functions, which you'd need to override in your theme
  • 1 in a form definition, which you'd need to change via hook_form_alter as googletorp suggested
  • 3 in table definitions, which you'd need to change via hook_tapir_table_alter and/or hook_tapir_table_header_alter (see the hooks.php file in ubercarts doc directory for these)

So you should be able to implement your changes without changing the module itself, but given the amount of work involved, I'd try schnecks suggestion first ;)

Henrik Opel

related questions