I have developed a custom module and need to dynamically add a product to the cart. Is there an API to allow me to do this?
Something like would be my dream hook 
<?php
mymodule_add_product_to_cart($nid, $qty, $data)
?>Where I could submit the product NID, the quantity to add and any extra data and the item would be put in the cart and the user would be redirected to the cart page.
Is something like this possible? Or is there another approach that I should be looking at?
Thanks for any help!

