File: /var/www/vhost/disk-apps/magento.bikenow.co/vendor/magento/module-catalog-rule/etc/di.xml
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\CatalogRule\Model\ResourceModel\Rule">
<arguments>
<argument name="eventManager" xsi:type="object">Magento\Framework\Event\Manager\Proxy</argument>
</arguments>
</type>
<type name="Magento\CatalogRule\Model\ResourceModel\Rule\Collection" shared="false" />
<type name="Magento\Catalog\Model\Product\PriceModifier\Composite">
<arguments>
<argument name="modifiers" xsi:type="array">
<item name="catalog_rule" xsi:type="string">Magento\CatalogRule\Model\Product\PriceModifier</item>
</argument>
</arguments>
</type>
<type name="Magento\Framework\Module\Setup\Migration">
<arguments>
<argument name="compositeModules" xsi:type="array">
<item name="catalogrule" xsi:type="string">Magento_CatalogRule</item>
</argument>
</arguments>
</type>
<virtualType name="Magento\Catalog\Pricing\Price\Pool" type="Magento\Framework\Pricing\Price\Pool">
<arguments>
<argument name="prices" xsi:type="array">
<item name="catalog_rule_price" xsi:type="string">Magento\CatalogRule\Pricing\Price\CatalogRulePrice</item>
</argument>
</arguments>
</virtualType>
<preference for="Magento\CatalogRule\Api\Data\RuleInterface" type="Magento\CatalogRule\Model\Rule" />
<preference for="Magento\CatalogRule\Api\CatalogRuleRepositoryInterface" type="Magento\CatalogRule\Model\CatalogRuleRepository" />
<type name="Magento\Framework\Model\Entity\RepositoryFactory">
<arguments>
<argument name="entities" xsi:type="array">
<item name="Magento\CatalogRule\Api\Data\RuleInterface" xsi:type="string">Magento\CatalogRule\Api\CatalogRuleRepositoryInterface</item>
</argument>
</arguments>
</type>
<type name="Magento\Framework\EntityManager\MetadataPool">
<arguments>
<argument name="metadata" xsi:type="array">
<item name="Magento\CatalogRule\Api\Data\RuleInterface" xsi:type="array">
<item name="entityTableName" xsi:type="string">catalogrule</item>
<item name="identifierField" xsi:type="string">rule_id</item>
</item>
</argument>
<argument name="eavMapping" xsi:type="array">
<item name="Magento\Catalog\Api\Data\ProductInterface" xsi:type="string">catalog_product</item>
</argument>
</arguments>
</type>
<type name="Magento\Framework\EntityManager\Operation\AttributePool">
<arguments>
<argument name="extensionActions" xsi:type="array">
<item name="catalogRule" xsi:type="array">
<item name="Magento\CatalogRule\Api\Data\RuleInterface" xsi:type="array">
<item name="read" xsi:type="string">Magento\CatalogRule\Model\ResourceModel\ReadHandler</item>
<item name="create" xsi:type="string">Magento\CatalogRule\Model\ResourceModel\SaveHandler</item>
<item name="update" xsi:type="string">Magento\CatalogRule\Model\ResourceModel\SaveHandler</item>
</item>
</item>
</argument>
</arguments>
</type>
<type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
<arguments>
<argument name="collections" xsi:type="array">
<item name="catalog_rule_data_source" xsi:type="string">catalogRuleSearchResult</item>
</argument>
</arguments>
</type>
<virtualType name="catalogRuleSearchResult" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
<arguments>
<argument name="mainTable" xsi:type="string">catalogrule</argument>
<argument name="resourceModel" xsi:type="string">\Magento\CatalogRule\Model\ResourceModel\Rule</argument>
</arguments>
</virtualType>
<type name="Magento\CatalogRule\Model\Rule\Condition\Combine">
<arguments>
<argument name="data" xsi:type="array">
<item name="form_name" xsi:type="string">catalog_rule_form</item>
</argument>
</arguments>
</type>
<type name="Magento\CatalogRule\Model\Rule\Condition\Product">
<arguments>
<argument name="data" xsi:type="array">
<item name="form_name" xsi:type="string">catalog_rule_form</item>
</argument>
</arguments>
</type>
<preference for="Magento\CatalogRule\Api\Data\ConditionInterface" type="Magento\CatalogRule\Model\Data\Condition" />
<virtualType name="Magento\CatalogRule\Model\ResourceModel\Rule\AssociatedEntityMap" type="Magento\Framework\DataObject">
<arguments>
<argument name="data" xsi:type="array">
<item name="website" xsi:type="array">
<item name="associations_table" xsi:type="string">catalogrule_website</item>
<item name="rule_id_field" xsi:type="string">rule_id</item>
<item name="entity_id_field" xsi:type="string">website_id</item>
</item>
<item name="customer_group" xsi:type="array">
<item name="associations_table" xsi:type="string">catalogrule_customer_group</item>
<item name="rule_id_field" xsi:type="string">rule_id</item>
<item name="entity_id_field" xsi:type="string">customer_group_id</item>
</item>
</argument>
</arguments>
</virtualType>
<type name="Magento\Framework\EntityManager\HydratorPool">
<arguments>
<argument name="hydrators" xsi:type="array">
<item name="Magento\CatalogRule\Api\Data\RuleInterface" xsi:type="string">Magento\Framework\EntityManager\AbstractModelHydrator</item>
</argument>
</arguments>
</type>
<type name="Magento\Catalog\Model\ResourceModel\Product\LinkedProductSelectBuilderComposite">
<arguments>
<argument name="linkedProductSelectBuilder" xsi:type="array">
<item name="catalogRulePrice" xsi:type="object">Magento\CatalogRule\Model\ResourceModel\Product\LinkedProductSelectBuilderByCatalogRulePrice</item>
</argument>
</arguments>
</type>
<preference for="Magento\CatalogRule\Model\Indexer\IndexerTableSwapperInterface" type="Magento\CatalogRule\Model\Indexer\IndexerTableSwapper" />
<type name="Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\PriceInterface">
<arguments>
<argument name="priceModifiers" xsi:type="array">
<item name="catalogRulePriceModifier" xsi:type="object">Magento\CatalogRule\Model\Indexer\ProductPriceIndexModifier</item>
</argument>
</arguments>
</type>
<type name="Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\BasePriceModifier">
<arguments>
<argument name="priceModifiers" xsi:type="array">
<item name="catalogRulePriceModifier" xsi:type="object">Magento\CatalogRule\Model\Indexer\ProductPriceIndexModifier</item>
</argument>
</arguments>
</type>
<virtualType name="CatalogRuleCustomConditionProvider" type="Magento\Framework\Api\SearchCriteria\CollectionProcessor\ConditionProcessor\CustomConditionProvider">
<arguments>
<argument name="customConditionProcessors" xsi:type="array">
<item name="category_ids" xsi:type="object">Magento\Catalog\Model\Api\SearchCriteria\CollectionProcessor\ConditionProcessor\ProductCategoryCondition</item>
</argument>
</arguments>
</virtualType>
<virtualType name="CatalogRuleAdvancedFilterProcessor" type="Magento\Framework\Api\SearchCriteria\CollectionProcessor\AdvancedFilterProcessor">
<arguments>
<argument name="defaultConditionProcessor" xsi:type="object">Magento\Catalog\Model\Api\SearchCriteria\CollectionProcessor\ConditionProcessor\DefaultCondition</argument>
<argument name="customConditionProvider" xsi:type="object">CatalogRuleCustomConditionProvider</argument>
</arguments>
</virtualType>
<type name="Magento\CatalogRule\Model\ResourceModel\Product\ConditionsToCollectionApplier">
<arguments>
<argument name="searchCriteriaProcessor" xsi:type="object">CatalogRuleAdvancedFilterProcessor</argument>
</arguments>
</type>
<type name="Magento\CatalogRule\Model\Rule\Condition\MappableConditionsProcessor">
<arguments>
<argument name="customConditionProvider" xsi:type="object">CatalogRuleCustomConditionProvider</argument>
</arguments>
</type>
</config>