VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product creation => Topic started by: hades87 on May 01, 2012, 13:39:51 PM

Title: add product to cart without the button
Post by: hades87 on May 01, 2012, 13:39:51 PM
Hello everyone,

im working on my own project and wanted to add a product but not with the standard button.
there are multiple actions that need to occur and i didn't think it very user friendly if the customer has to press 2 different buttons for it to work.
so when the user presses a button  it needs to save information to a db and it needs to set a product in the cart.
but im lost in the code of virtuemart. which function do i need to use and what does it need to properly add the product to the cart?

i hope someone can help me
thanks in advance
Title: Re: add product to cart without the button
Post by: jenkinhill on May 02, 2012, 12:57:42 PM
You don't want the modal "Added to cart" popup? Then try selecting "Display modal popup upon 'Add to cart' " in VM configuration/Checkout.
Title: Re: add product to cart without the button
Post by: hades87 on May 03, 2012, 10:03:32 AM
yes, i know about the popup, that isn't what i was talking about. but thanks for your reply  :D

i want with my own button in my own module to add a product to the cart.
which function in virtuemart code should i use, or do i need to put certain things in sessions.
i just can't figure it out.

thank you

Title: Re: add product to cart without the button
Post by: jenkinhill on May 03, 2012, 17:48:06 PM
For an add to cart in an article see http://forum.virtuemart.net/index.php?topic=94539.msg337937#msg337937

For a product module with add to cart see how the provided VM modules work.
Title: Re: add product to cart without the button
Post by: hades87 on May 04, 2012, 09:19:55 AM
Thank you very much, i think this is exactly what i need.