I have activated reorder on my magento 2 site. Now I want a event which can catch reorder both in frontend and backend (admin). I am using "controller_action_predispatch_sales_order_reorder" for my front end which is working perfectly fine but I want to catch reorder on the backend as well. Can anyone tell me which event to use for backend as "controller_action_predispatch_adminhtml_sales_order_create_reorder" is not working for backend?
Here is my code:
Event file app/code/VoltLighting/OrderInfo/etc/adminhtml/events.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<event name="controller_action_predispatch_adminhtml_sales_order_create_reorder">
<observer name="admin_reorder_observer" instance="VoltLighting\OrderInfo\Observer\AdminReorder" />
</event>
<event name="checkout_submit_all_after">
<observer name="admin_order_observer" instance="VoltLighting\OrderInfo\Observer\AdminOrder" />
</event>
Observer file app/code/VoltLighting/OrderInfo/Observer/AdminReorder.php
<?php
namespace VoltLighting\OrderInfo\Observer;
use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
class AdminReorder implements ObserverInterface
{
public function execute(Observer $observer)
{
$order= $observer->getEvent();
echo "hello world";
exit;
}
}