I want set ifconfig configuration for below code:
First code in di.xml
<virtualType name="searchFilterList" type="Magento\Catalog\Model\Layer\FilterList">
 <arguments>
 <argument name="filters" xsi:type="array">
 <item name="attribute" xsi:type="string">KM\LayeredNavigation\Model\Layer\Filter\Attribute</item>
 <item name="price" xsi:type="string">KM\LayeredNavigation\Model\Layer\Filter\Price</item>
 <item name="decimal" xsi:type="string">KM\LayeredNavigation\Model\Layer\Filter\Decimal</item>
 <item name="category" xsi:type="string">KM\LayeredNavigation\Model\Layer\Filter\Category</item>
 </argument>
 </arguments>
</virtualType>
i was tried to put ifconfig on virtualtype tag but it's not working.
Second Code in di.xml
<type name="Magento\Catalog\Controller\Category\View">
 <plugin name="ajax_loader" type="KM\LayeredNavigation\Plugin\CategoryView" sortOrder="1" />
</type>
same as process above code.
can you please suggest how can i set the configuration or is there any alternative solution so please provide to me. It will helpful to me and also others.
Thanks
1 Answer 1
It's a third party code, but I'll try to answer. If you need to change filters type and layer type depending on configuration, then you might want to add a plugin for getFilters method of FilterList class and change layerResolver->create() statement in the action class. As of plugin, you can replace it with your own class and call parent method or your own one depending on configuration values: How to override or disable core Plugins in Magento2?
Explore related questions
See similar questions with these tags.