Skip to content

Instantly share code, notes, and snippets.

@hiephm
Last active February 5, 2016 02:37
Show Gist options
  • Save hiephm/d27442ddc989a1129988 to your computer and use it in GitHub Desktop.
Save hiephm/d27442ddc989a1129988 to your computer and use it in GitHub Desktop.
<!-- To generate Interceptor, declare a plugin for virtualType, but plugin won't be executed with this alone -->
<type name="\Magento\LayeredNavigation\Block\Navigation\Category">
<plugin name="my-plugin" type="\MyVendor\MyModule\Plugin\BlockNavigation"/>
</type>
<!-- For plugin to be actually executed, declare the same plugin for actual class -->
<type name="\Magento\LayeredNavigation\Block\Navigation">
<plugin name="my-plugin" type="\MyVendor\MyModule\Plugin\BlockNavigation"/>
</type>
<!-- This is virtualType declaration in vendor/magento/module-layered-navigation/etc/frontend/di.xml -->
<virtualType name="Magento\LayeredNavigation\Block\Navigation\Category" type="Magento\LayeredNavigation\Block\Navigation">
<arguments>
<argument name="filterList" xsi:type="object">categoryFilterList</argument>
</arguments>
</virtualType>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment