Created
March 6, 2014 18:11
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* 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