Tags/topics: 
1
Answers
Vote up!
0
Vote down!

How to print "add to cart form" with views_php

Hi,
I want to print the "add to cart form" by using a views_php field.
I use thie code in Global PHP field

<?php

              $form
= drupal_get_form('commerce_cart_add_to_cart_form');
              print
drupal_render($form);
?>

But i get this error on the product display page.
Warning : Missing argument 3 for commerce_cart_add_to_cart_form() dans commerce_cart_add_to_cart_form() (ligne 1427 dans ......\sites\all\modules\commerce\modules\cart\commerce_cart.module).

The add to cart button is not shown.

Kind regard

Asked by: mouhammed
on January 22, 2013

1 Answer

Vote up!
0
Vote down!

I had the same problem today. The following link helped me through it.

http://drupal.org/node/1232470

Posted: Jan 24, 2013

Comments

@creativepragmatic. Sadly for me the thread you refer to isn't specific enough about how to achieve this in Views PHP. Could you elaborate ?

Thanks

- El Bandito on October 13, 2013