Changing QTY label in Uber Cart?

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

+2


source to share


3 answers


You can use the String Overrides module . Here's an excerpt from his project page:

Provides a quick and easy way to replace any text on your site.

Features:

  • Easy to replace whatever went through t ()
  • Locale support to override strings in any language.
  • Possibility to import / export * .po files, for easy migration from Locale module
  • Note that this is not a replacement for Locale, as thousands of overrides can be more painful than helpful. Use this only if you need some simple text changes.


I once faced a similar problem with Ubercart in another language (German) and we "solved" it by translating the string. The said module should do the trick in your case.

+2


source


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



+2


source


Unfortunately there are no settings for ubercart.

Doing a search for "Qty" (case sensitive since there are many "qty" s in the code) in the current ubercart-6.x-2.0-rc7 release yields seven matches:

  • 3 in theme functions you need to override in theme
  • 1 in the shape definition you need to change with hook_form_alter

    as googletorp suggested
  • 3 in the table definitions you need to modify with hook_tapir_table_alter

    and / or hook_tapir_table_header_alter

    (see the hooks.php file in the 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, I'll try schnecks' suggestion first;)

+1


source







All Articles