Skip to content

Instantly share code, notes, and snippets.

@joshmiller83
Created February 19, 2016 15:13
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 joshmiller83/a30cd351d72046ee5288 to your computer and use it in GitHub Desktop.
Save joshmiller83/a30cd351d72046ee5288 to your computer and use it in GitHub Desktop.
<?php
/**
* Implements hook_form_FORM_ID_alter().
*
* This will work on all cart forms without running the global hook_form_alter().
*/
function MODULE_form_commerce_cart_add_to_cart_form_alter(&$form, &$form_state, $form_id) {
$product = $form_state['default_product'];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment