I can't change 'Add to cart' button value (site http://zoo812.ru)

Now it is value="Добавить в корзину", I want to change it to value="buy"

I inserted

function ivanco_form_commerce_cart_add_to_cart_form_alter(&$form, &$form_state, $form_id) {
    $form['submit']['#value'] == t('Buy');

in template.php, but it does absolutely nothing.

String overrides also doesn't work.

There is no js code linked with it nor any other mentions about it in theme files.

You see, there is Catalog View, and each item's displayed with Evo.

I can do this with JS of course, but it wont be elegant..


I've used this code and worked fine:

function MY_MODULE_form_alter(&$form, &$form_state, $form_id) {
  if (strstr($form_id, 'commerce_cart_add_to_cart_form')) {
    $form['submit']['#value'] = 'CUSTOM BUTTON VALUE';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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