On a current site in development I am using Ubercart to provide a renewable subscription service. To make the user experience clean, I wanted to protect the user from going 'shopping' to add their subscription. To do this I decided to use a rule to add the product to the user cart when the user is created by an administrator or when the subscription is cancelled or fails payment. I tried the Ubercart Rules module, but this is mainly for dealing with orders and not carts, and did not contain the needed add to cart rule.
Lucky it is easy to make one for yourself using the php action in rules. The following is the needed code for adding a nid to a specified users cart:
// uc_cart_add_item($nid, $qty = 1, $data = NULL, $cid = NULL, $msg = TRUE, $check_redirect = TRUE, $rebuild = TRUE)
uc_cart_add_item($product_nid, 1, NULL, $user_uid, FALSE);
Please note the commented out add to cart call with all the bells and whistles. I have included an export of the component for ease of import.