How do I add a Product to the Cart programmatically in Ubercart? I'm creating a section of my site where users must purchase individual nodes of a certain content type. In an effort to enhance usability, I allow the user to create the node without paying, but then save it as "Unpublished" so it's not yet visible on the site. Then, once the user pays, we'll publish their node. So whenever a user creates a node of a particular type, it should add a Product (which represents the right to post that particular node) to the user's Cart.

I know I can implement hook_nodeapi() to hook into the node creation event, but how do I add the product to their cart?
Is the node that users create is a valid product type node? In any case you can try this - http://api.lullabot.com/uc_cart_add_item 

uc_cart_add_item($nid, $qty = 1, $data = NULL, $cid = NULL, $msg = TRUE, $check_redirect = TRUE, $rebuild = TRUE)


Here $nid = nid of the product, $cid = cart id (also user id) - look at http://api.lullabot.com/uc_cart_get_id

Hope this helps.