Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
How can I change the Coupon label and description in the checkout pane?
I tried to user hook_form_alter but it is not working.
I've tried form_id commerce_coupon_pane_checkout_form and commerce_product_ui_product_form.
Is there a different way to do this?
Comments
Comment #1
skchan2 CreditAttribution: skchan2 commentedId like to know this also, I want to change "Enter here your coupon code" to "Enter your coupon code here"
Comment #2
kruser CreditAttribution: kruser commentedI was able to hook_form_alter to change this...
Comment #3
millionleaves CreditAttribution: millionleaves commentedWould be handy if the ability to change (or remove) the instructions were exposed in the module configuration page, or perhaps in the 'Coupons' checkout panes configuration screen.
At the every least, could I suggest changing the hard-coded label to the grammatically more correct: "Enter your coupon code here".
UPDATE: confirmed that the method outlined in #2 works. I created a custom module including this function and was able to override the form label with that. I still have to open up a module file to make changes, but at least this is better than changing the commerce_coupon module code and having it overridden next time I upgrade the module.
Comment #4
leewillis77 CreditAttribution: leewillis77 commentedThere's an issue (With patch) here https://drupal.org/node/2112905#comment-7970437 that covers some of this.
Once this is installed, the strings should be translatable, which would mean you could change them using String Overrides module (http://drupal.org/project/string_override). It also changes the grammar of the string you identified.
Comment #5
sureshpotnuru CreditAttribution: sureshpotnuru commentedyes, correct leewillis77. but you finds module at https://www.drupal.org/project/stringoverrides. Thanks for save my day.