0

At the following page:

Sales -> Orders -> Create New Order

I want to skip the page where you choose the customer, so instead it loads the page as if you had clicked a certain customer, and the customer I want it to load is the currently logged in admin.

I'm not sure how to go about this however I am able to retrieve the logged in admin id.

If I take a JavaScript approach, I think I may need to somehow call productGridRowClick(grid, event) on the "order" object.

Or maybe I could load the block directly in PHP, skipping this:

<block type="adminhtml/sales_order_create_customer" template="sales/order/create/abstract.phtml" name="customer">
    <block type="adminhtml/sales_order_create_customer_grid" name="grid" />
</block>
7
  • Could you explain how you relate the customer to the admin user? Commented Feb 19, 2015 at 19:35
  • I am just assuming that an order can be placed for a logged in admin? Is that not the case though?
    – Mex
    Commented Feb 19, 2015 at 20:03
  • No, admin users and customers are in no way related. An admin user has only name, e-mail address, password and a user-role. There is no sales/checkout functionality related to an admin user whereas for a customer it is. Commented Feb 19, 2015 at 20:04
  • Oh right I see, thanks for explaining that. I think I got confused, I realise now that it will in fact be for the logged in customer id, not admin id. Sorry!
    – Mex
    Commented Feb 19, 2015 at 20:22
  • But you cannot have customers being logged in into your admin backend... Commented Feb 19, 2015 at 20:24

1 Answer 1

1

To bypass selecting a customer screen you will need to create a url in the following format

http://www.website.com/index.php/admin/sales_order_create/start/customer_id/[108]/key/[key]

Mage::helper('adminhtml')->getUrl("adminhtml/sales_order_create/start", array('customer_id'=> $customer_id));

Where $customer_id is a valid customer and not a admin user

Take a look at "Create Order" in customer admin

1
  • Thanks, this works perfectly. I was able to override the block and change the method's code. Mage_Adminhtml_Block_Sales_Order::getCreateUrl.
    – Mex
    Commented Feb 19, 2015 at 20:57

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.