Is it possible to have an observer while making an order in the admin panel?
I'm trying to change the 'purchased from' depending on which customer group the customer is in. So if a customer is in the wholesale group, they would be purchasing from the wholesale storeview. Obviously this can be done manually but I'm trying to cut out human error.
For example, an admin would select a customer during order creation (this triggers the event) which in turn change the store view to the appropriate one.
Best Answer
There are main two events available for admin order in Magento 2
adminhtml_sales_order_create_process_data_before
adminhtml_sales_order_create_process_data
1. adminhtml_sales_order_create_process_data_before
2. adminhtml_sales_order_create_process_data
Other admin order related events
app/code/Magento/Sales/Controller/Adminhtml/Order/AddressSave.php
app/code/Magento/Sales/Controller/Adminhtml/Order/CreditmemoLoader.php
app/code/Magento/Sales/Model/AdminOrder/Create.php
app/code/Magento/Sales/Model/AdminOrder/Create.php
app/code/Magento/Sales/Model/AdminOrder/Create.php