|
Ok guys, I have a solution that works. This is not really the correct Magento way of doing things but it does work. This modifies core files but for now it should get you by.
/app/code/core/Mage/Adminhtml/controllers/sales/order/CreateController.php
In the saveAction() Method after this block of code:
$order = $this->_getOrderCreateModel() ->importPostData($this->getRequest()->getPost('order')) ->createOrder();
Insert:
/** * Identify Current User & Save to database */ $_user = Mage::getModel('admin/session')->getUser(); $username = $_user->getFirstname() . " " . $_user->getLastname(); $data = array ( 'salesperson' => $username ); $where[] = "entity_id = '" . $order->getId() . "'"; $conn = Mage::getSingleton('core/resource')->getConnection('core_write'); $conn->update('sales_order', $data, $where);
Make sure that you have added the field:
“salesperson”
Field: 'salesperson' Type: VARCHAR Length: 255 NULL: Null
To the table sales_order.
And add this to the orders grid after the ‘Grand Total’ column (or wherever you want):
/app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php
$this->addColumn('salesperson', array( 'header' => Mage::helper('sales')->__('Salesperson'), 'index' => 'salesperson', ));
That should do it!
-Adam
|