src/module-elasticsuite-virtual-category/etc/adminhtml/di.xml
<?xml version="1.0"?>
<!--
/**
* Smile_ElasticsuiteVirtualCategory adminhtml DI.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Smile ElasticSuite to newer
* versions in the future.
*
* @category Smile
* @package Smile\ElasticsuiteVirtualCategory
* @author Romain Ruaud <romain.ruaud@smile.fr>
* @copyright 2020 Smile
* @license Open Software License ("OSL") v. 3.0
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<virtualType name="Smile\ElasticsuiteVirtualCategory\Ui\Component\Category\Form\VirtualCategoryRoot\Options" type="Magento\Catalog\Ui\Component\Product\Form\Categories\Options">
<arguments>
<argument name="categoryCollectionFactory" xsi:type="object">Smile\ElasticsuiteVirtualCategory\Model\Category\Attribute\Source\VirtualCategoryRoot\CollectionFactory</argument>
</arguments>
</virtualType>
<!-- Overridden directly because this block is called via hardcoded calls -->
<preference for="\Magento\Catalog\Block\Adminhtml\Category\Tab\Product" type="Smile\ElasticsuiteVirtualCategory\Block\Adminhtml\Catalog\Category\Tab\Product"/>
<type name="\Magento\CatalogRule\Controller\Adminhtml\Promo\Widget\Chooser">
<plugin name="category_chooser_plugin" type="Smile\ElasticsuiteVirtualCategory\Plugin\Catalog\Category\ChooserPlugin"/>
</type>
<!-- Remove assign_product and facet_config fieldset in staging form -->
<type name="Magento\CatalogStaging\Model\Category\DataProvider">
<plugin name="smile_elasticsuite_virtual_categories_category_staging_form_dataprovider"
type="Smile\ElasticsuiteVirtualCategory\Plugin\Staging\Catalog\Category\DataProviderPlugin" />
</type>
<type name="\Magento\VisualMerchandiser\Block\Adminhtml\Category\Merchandiser\Grid">
<plugin name="remove_position_column" type="Smile\ElasticsuiteVirtualCategory\Plugin\Block\Category\RemovePosition"/>
</type>
</config>