Create new order from user page

Posts: 94
Joined: 08/09/2007
Uber DonorBug Finder

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.

--

Biodiesel * (ubercart + drupal) = Sundays Energy

Posts: 94
Joined: 08/09/2007
Uber DonorBug Finder

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));
?>

--

Biodiesel * (ubercart + drupal) = Sundays Energy

Posts: 5378
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Good idea. Smiling