I want to modify ubercarts "Add to cart" text button but only on ONE page that I've customized. I haven't been able to figure out how to call the button via php so I don't know if that's possible. I figured I could use string override but that would change the text across all pages and for that I can just change the option in ubercart.

1 Answer 1


I'm betting you're looking for hook_form_alter() ... I'm pretty sure its just a form buttom on the page and you can change its #valueproperty as-needed with that hook. Its up to you to figure out how to target just that form, on just that page ... I don't think you need stringoverride for this.

You would want to test this out of course :)

  • I think this is probably correct. Although my Fapi skills are relatively weak. Can you edit your answer to fit a basic ubercart 'add to cart' form with a bit of an example? Jul 2, 2012 at 17:32
  • I dont have ubercart installed anywhere at this time ... setting up a site + ubercart + devel generate (i hope to make dummy content) would take up too much of my time at the moment, apologies.
    – tenken
    Jul 2, 2012 at 22:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.