Search

Mar 4, 2024

Magento 2: Create new record when deleting order in magento 2 in admin system

Create logging.xml in app code
app/code/Company/Module/etc/logging.xml


<?xml version="1.0"?>
<logging xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Logging:etc/logging.xsd">
    <groups>
        <group name="lexim_deleteorder">
            <label translate="true">Delete Order</label>
            <events>
                <event controller_action="sales_order_delete" action_alias="delete">
                    <expected_models>
                        <expected_model class="Magento\Sales\Model\Order" />
                    </expected_models>
                </event>
                <event controller_action="sales_order_massDelete" action_alias="massDelete">
                    <expected_models>
                        <expected_model class="Magento\Sales\Model\Order" />
                    </expected_models>
                </event>
            </events>
        </group>
    </groups>
</logging>

No comments:

Post a Comment