Skip to content

Instantly share code, notes, and snippets.

@Greg-Boggs
Created March 6, 2014 18:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Greg-Boggs/9395900 to your computer and use it in GitHub Desktop.
Save Greg-Boggs/9395900 to your computer and use it in GitHub Desktop.
The code to change the quantity label in a Drupal Commerce product
* Implements hook_form_alter().
*
* Modify quantity text
*/
function HOOKNAME_form_alter(&$form, &$form_state, $form_id) {
if (strstr($form_id, 'commerce_cart_add_to_cart_form')) {
// Rename add-to-cart form fields label (quantity).
$form['quantity']['#title'] = t('Quantity');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment