Last active
August 29, 2015 14:27
-
-
Save iledcom/7179b5fdf3bbbb259fea to your computer and use it in GitHub Desktop.
Drupal 7 commerce_cart_add_to_cart_form
This file contains hidden or 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
$form_idp= commerce_cart_add_to_cart_form_id(array(7)); | |
//in this case product_id of 7 corresponds to a silver level | |
$productp = commerce_product_load(7); | |
$line_itemp = commerce_product_line_item_new($productp, 1); // 1 is quantity | |
$line_itemp->data['context']['product_ids'] = array(7); | |
$formp = drupal_get_form($form_idp, $line_itemp); | |
<?print drupal_render($formp);?> | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment