I am looking for a way for our admin users on a Drupal Commerce site to look up customer profiles from previous orders, and upon looking at a specific customer profile, provide a button that allows then to create an order for that customer. This use case is for a call center.

So far, I have tried using Button Field to call a rule component but I have having problems writing the rule.

Looking up previous orders and creating a new order with information for the shipping profile attached would also be a viable alternative.

Any suggestions regarding approach or use of modules would be welcome.


1 Answer 1


Things like this, is much easier to accomplish with a bit of custom code. You could add a form on the order view page, with the order as the context. This can be done by using hook_commerce_order_view.

All you really need to do, in the submit handler would be something like this.

$old_order //
$new_order = commerce_order_new();
$new_order->uid = $old_order->uid;
$new_order->commerce_shipping_profile = $old_order->commerce_shipping_profile;
$form_state['redirect'] = 'admin/commerce/order/' . $new_order->order_id . '/edit';

The code above is from memory, should be in a form submit handler and is written from memory, but should work, if I remembered correctly. As you can see, it's pretty simple to accomplish.

  • thanks for the reply, our team will try it out shortly and post our results Commented Dec 20, 2012 at 14:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.