Skip to content

Commit

Permalink
Ensure dynamic instantiation of category layer will properly uses ful…
Browse files Browse the repository at this point in the history
…ltext product collection.
  • Loading branch information
romainruaud committed Mar 20, 2017
1 parent 8648dcc commit 7ff6af6
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/module-elasticsuite-catalog/etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,20 @@
</arguments>
</type>

<!-- Ensure automatic instantiation of layer will properly use a fulltext product collection -->
<virtualType name="Smile\ElasticsuiteCatalog\Model\Layer\Category\Context" type="Magento\Catalog\Model\Layer\Context">
<arguments>
<!-- This provider uses the Magento\CatalogSearch\Model\ResourceModel\Fulltext\CollectionFactory as Collection Factory -->
<argument name="collectionProvider" xsi:type="object">Magento\CatalogSearch\Model\Layer\Category\ItemCollectionProvider</argument>
<argument name="stateKey" xsi:type="object">Magento\Catalog\Model\Layer\Category\StateKey</argument>
<argument name="collectionFilter" xsi:type="object">Magento\Catalog\Model\Layer\Category\CollectionFilter</argument>
</arguments>
</virtualType>

<type name="Magento\Catalog\Model\Layer\Category">
<arguments>
<argument name="context" xsi:type="object">Smile\ElasticsuiteCatalog\Model\Layer\Category\Context</argument>
</arguments>
</type>

</config>

0 comments on commit 7ff6af6

Please sign in to comment.