Has anyone developed a way to create a new order from a user page or within a view? Perhaps a block snippet that has a "create a new order for this user" link. Or a view with a "Create order for node author" field. If not I'll make something next week.
I took a peek inside the uc_order module and noticed that going to example.com/admin/store/orders/create/1 would create an order for user one. 1 being the uid. I created a simple php block with this code. It provides a link on user profile pages to create an order for the user.
<?php
$user = arg(0);
$uid = arg(1);
if (is_numeric($uid) && ($user == 'user')) print(l('create order for this user', 'admin/store/orders/create/' . $uid));
?>This method no longers works in current version of ubercart 
Just can't puzzle out how to do this in current UC.
Looking at the order module :
/**
* @see uc_order_create_form()
*/
function uc_order_create_form_submit($form, &$form_state) {
global $user;
$order = uc_order_new($form_state['values']['uid'], 'post_checkout');
uc_order_comment_save($order->order_id, $user->uid, t('Order created by the administration.'), 'admin');
$form_state['redirect'] = 'admin/store/orders/'. $order->order_id .'/edit';
}
Would it be possible to add a condition to test if UID is passed in URL instead of the form state for uid? Is this where the modification should actually be made?
After looking at it for a while, I came up with adding this to uc_create_order
if (arg(4)) {
global $user;
$uid = check_plain(arg(4));
$order = uc_order_new($uid, 'post_checkout');
uc_order_comment_save($order->order_id, $user->uid, t('Order created by the administration.'), 'admin');
drupal_goto('admin/store/orders/'. $order->order_id .'/edit');
}Now I can finally create orders from links! This is exceptionally handy coupled with Views.
Great stuff. Thanks guys, got it working, exactly what I needed. Now each user page has a "create new order for user" link available to authorised users.
Chris
Awesome, glad you got it working 
For me it works right now.
But i am not sure if it works ok. I still get the create order screen. When i click on create order i go to the new order. There i see the correct user.
Is it possible to skip the entire create order screen?

