Guest User

Untitled

a guest
Apr 23rd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. function nodebasket_nodeviewform($form_state, $node) {
  2. $form['#action'] = url('basket/'. $node->nid .'/add', $options = array(
  3. 'query' => drupal_get_destination(),
  4. ));
  5. $form['#id'] = 'formBasketButton_'. $node->nid;
  6. $form['#attributes'] = array(
  7. 'class' => 'add-to-cart-form',
  8. );
  9. $form['text']=array(
  10. '#type' => 'text',
  11. '#value' => '1',
  12. '#attributes' => array(
  13. 'class' => 'count',
  14. 'id' => 'BasketCount_'. $node->nid,
  15. 'maxlength'=>'4',
  16. ),
  17. );
  18. $form['submit'] = array(
  19. '#type' => 'submit',
  20. '#value' => t('Add to basket'),
  21. '#attributes' => array(
  22. 'class' => 'basket-actions',
  23. 'id' => 'BasketButton_'. $node->nid,
  24. ),
  25. );
  26. return $form;
  27. }
Add Comment
Please, Sign In to add comment