Currently the label for the Webform "Submit" button is changed to "Add to cart" in .module:

function commerce_webform_form_alter(&$form, &$form_state, $form_id) {
  if (stripos($form_id, 'webform_client_form') === 0) {
    if (commerce_webform_is_commerce_webform($form['#node'])) {
      //$form['actions']['submit']['#value'] = !$form['#is_draft'] && !empty($form['#submission']) ? t('Update cart') : t('Add to cart');
    }
  }
}

So to change the label one now has to write a function commerce_webform_form_alter, as the Webform -> Form settings -> Advanced Settings -> Submit button text can't be used anymore to set this label.

It would be great to remove this hook from .module - then users have full control over the label through the standard Webform GUI. In our case e.g. for one project we don't do carts - we do a Submit & Pay -> straight to /checkout.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

johnennew’s picture

Version: 7.x-1.0-beta6 » 7.x-2.x-dev
Status: Active » Fixed

Hi @KarinG - I think you are right. I have committed the attached patch to 7.x-1.x-dev.

johnennew’s picture

Version: 7.x-2.x-dev » 7.x-1.x-dev
FileSize
759 bytes

oops, forgot the patch

johnennew’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
FileSize
759 bytes

Also removed from 2.x branch.

KarinG’s picture

Merci!

-- Karin

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.