Fantastic, Gordon, thanks.
I have added print drupal_get_form('product_cart_form', $node); to my teaser template, and it displays the quantity box and the add to cart button.
Now, another question, sorry for being a php greenhorn, but is there a possibility to only display the 'Add to cart' button without the quantity box, with the quantity automatically set to '1'?
Many thanks Laura
2008/2/26, Gordon Heydon gordon@heydon.com.au:
Hi,
This is because the cart is not added for the teaser.
What you could do is do a
print drupal_get_form('product_cart_form', $node);
Gordon.
laura oldenbourg wrote:
Hello there, I am having yet another problem with CCK teaser layout. I am using Drupal 5.x, CCK module and Contemplate module.
I would like to add an 'Add to cart'-button to the teasers of one of my CCK content types.
In the body template, by writing
<div><?php print $node->content['cart']['#value'] ?></div>
I see a little field for inputting the 'Quantity', and then a button 'Add to cart'.
If I do the same to the teaser template, it doesn't display anything. Any help? In the end, I would like to display an 'Add to cart'-button only, with the quantity autonmatically set to '1'. Any suggestions?
Help much appreciated as always...
Laura
-- [ Drupal support list | http://lists.drupal.org/ ]