Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0"?>
- <!--
- /**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
- -->
- <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
- <type name="MagentoCatalogModelResourceModelProductCollection">
- <plugin name="sidebarFilters" type="SebwiteSidebarModelPluginSidebarFilter"/>
- </type>
- </config>
- <?php namespace SebwiteSidebarModelPlugin;
- use MagentoCatalogModelResourceModelProductCollection as ProductCollection;
- class SidebarFilter
- {
- /**
- * aroundAddFieldToFilter method
- *
- * @param MagentoCatalogModelResourceModelProductCollection $collection
- * @param Closure $proceed
- * @param $fields
- * @param null $condition
- *
- * @return MagentoCatalogModelResourceModelProductCollection
- */
- public function aroundAddFieldToFilter(ProductCollection $collection, Closure $proceed, $fields, $condition = null)
- {
- // Here we can modify the collection
- return $fields ? $proceed($fields, $condition) : $collection;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement