What better way ? Create own event or use afterSave/beforeSave methods?

时间:2016-07-11 20:09:31

标签: magento

I need to handle event changing Base currency (admin panel). But magento 2 doesn't have one. So i have two options to solve this.

  • Create own event and observer for
  • Create plugin for afterSave method

    <type name="Magento\Config\Model\Config\Backend\Currency\Base">
                    <plugin name="namespace_config_currency_plugin"
                    type="Namespace\Config\Model\Config\Backend\Currency\Plugin"
                    sortOrder="10"
                    disabled="false"/>
    </type>
    

I wonder which way is more appropriate or less expensive for system. Thanks!

0 个答案:

没有答案