<?xml version="1.0"?>
<!--
/**
 * Copyright © MageWorx. All rights reserved.
 * See LICENSE.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<!--    <event name="catalog_product_save_before">-->
<!--        <observer name="mageworx_customergroupprices_observer_save_custom_field_data"-->
<!--                  instance="MageWorx\CustomerGroupPrices\Observer\Adminhtml\SaveCustomFieldDataProductGroup"/>-->
<!--    </event>-->

    <event name="catalog_product_save_after">
        <observer name="mageworx_customergroupprices_observer_save_custom_field_data"
                  instance="MageWorx\CustomerGroupPrices\Observer\Adminhtml\SaveCustomFieldDataProductGroup"/>
    </event>

    <event name="customer_group_save_after">
        <!-- Add new child rows on customer group creation for customer product (special) prices whose parents were assigned to "All Groups" -->
        <observer name="mageworx_customergroupprices_save_product_price_children_for_new_group"
                  instance="MageWorx\CustomerGroupPrices\Observer\Adminhtml\AddChildrenGroupPricesOnGroupCreation"/>
    </event>

    <event name="catalog_product_load_after">
        <observer name="mageworx_customergroupprices_add_group_price_to_product_adminhtml"
                instance="MageWorx\CustomerGroupPrices\Observer\Adminhtml\AddGroupPriceDataToProduct"
        />
    </event>
</config>
