Created
November 6, 2012 03:48
-
-
Save danreb/4022434 to your computer and use it in GitHub Desktop.
Change Add to Cart button label in Drupal Commerce for specific 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
<?php | |
/** | |
* Implements hook_form_alter | |
* | |
*/ | |
function arma_form_alter(&$form, $form_state, $form_id) { | |
if ($form_id === 'commerce_cart_add_to_cart_form_2' || $form_id === 'commerce_cart_add_to_cart_form_1') { | |
$form['submit']['#attributes']['title'] = $form['submit']['#attributes']['value'] = t('Buy Corporate Membership'); | |
} | |
if ($form_id === 'commerce_cart_add_to_cart_form_4' || $form_id === 'commerce_cart_add_to_cart_form_3') { | |
$form['submit']['#attributes']['title'] = $form['submit']['#attributes']['value'] = t('Buy Individual Membership'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment