di.xml 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <?xml version="1.0"?>
  2. <!--
  3. /**
  4. * Copyright © Magento, Inc. All rights reserved.
  5. * See COPYING.txt for license details.
  6. */
  7. -->
  8. <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
  9. <preference for="Magento\InventoryCatalogApi\Api\DefaultStockProviderInterface" type="Magento\InventoryCatalog\Model\DefaultStockProvider"/>
  10. <preference for="Magento\InventoryCatalogApi\Api\DefaultSourceProviderInterface" type="Magento\InventoryCatalog\Model\DefaultSourceProvider"/>
  11. <preference for="Magento\InventoryCatalogApi\Model\GetProductIdsBySkusInterface" type="Magento\InventoryCatalog\Model\GetProductIdsBySkus"/>
  12. <preference for="Magento\InventoryCatalogApi\Model\GetProductTypesBySkusInterface" type="Magento\InventoryCatalog\Model\ResourceModel\GetProductTypesBySkus" />
  13. <preference for="Magento\InventoryCatalogApi\Model\GetSkusByProductIdsInterface" type="Magento\InventoryCatalog\Model\GetSkusByProductIds"/>
  14. <preference for="Magento\InventoryCatalogApi\Model\IsSingleSourceModeInterface" type="Magento\InventoryCatalog\Model\IsSingleSourceMode"/>
  15. <type name="Magento\InventoryApi\Api\StockRepositoryInterface">
  16. <plugin name="prevent_default_stock_deleting"
  17. type="Magento\InventoryCatalog\Plugin\InventoryApi\StockRepository\PreventDeleting\DefaultStockPlugin"/>
  18. </type>
  19. <type name="Magento\InventoryApi\Api\SourceItemsSaveInterface">
  20. <plugin name="set_data_to_legacy_catalog_inventory_at_source_items_save"
  21. type="Magento\InventoryCatalog\Plugin\InventoryApi\SetDataToLegacyCatalogInventoryAtSourceItemsSavePlugin"/>
  22. </type>
  23. <type name="Magento\InventoryIndexer\Indexer\SourceItem\SourceItemIndexer">
  24. <plugin name="priceIndexUpdater" type="Magento\InventoryCatalog\Plugin\InventoryIndexer\Indexer\SourceItem\PriceIndexUpdater" sortOrder="20"/>
  25. </type>
  26. <type name="Magento\InventoryIndexer\Indexer\Stock\StockIndexer">
  27. <plugin name="priceIndexUpdater" type="Magento\InventoryCatalog\Plugin\InventoryIndexer\Indexer\Stock\PriceIndexUpdater"/>
  28. </type>
  29. <type name="Magento\CatalogInventory\Model\Indexer\ProductPriceIndexFilter">
  30. <plugin name="change_select_for_price_modifier" type="Magento\InventoryCatalog\Plugin\CatalogInventory\Model\Indexer\ModifySelectInProductPriceIndexFilter"/>
  31. </type>
  32. <type name="Magento\InventoryApi\Api\SourceItemsDeleteInterface">
  33. <plugin name="set_to_zero_legacy_catalog_inventory_at_source_items_delete"
  34. type="Magento\InventoryCatalog\Plugin\InventoryApi\SetToZeroLegacyCatalogInventoryAtSourceItemsDeletePlugin"/>
  35. </type>
  36. <type name="Magento\CatalogInventory\Model\ResourceModel\QtyCounterInterface">
  37. <plugin name="update_source_item_at_legacy_qty_counter" type="Magento\InventoryCatalog\Plugin\CatalogInventory\UpdateSourceItemAtLegacyQtyCounterPlugin"/>
  38. </type>
  39. <type name="Magento\CatalogInventory\Model\ResourceModel\Stock\Item">
  40. <plugin name="update_source_item_at_legacy_stock_item_save"
  41. type="Magento\InventoryCatalog\Plugin\CatalogInventory\UpdateSourceItemAtLegacyStockItemSavePlugin"/>
  42. <plugin name="priceIndexUpdater" disabled="true"/>
  43. </type>
  44. <type name="Magento\CatalogInventory\Model\ResourceModel\Stock\Status">
  45. <plugin name="adapt_add_stock_data_to_collection"
  46. type="Magento\InventoryCatalog\Plugin\CatalogInventory\Model\ResourceModel\Stock\Status\AdaptAddStockDataToCollectionPlugin"/>
  47. <plugin name="adapt_add_stock_status_to_select"
  48. type="Magento\InventoryCatalog\Plugin\CatalogInventory\Model\ResourceModel\Stock\Status\AdaptAddStockStatusToSelectPlugin"/>
  49. <plugin name="adapt_add_is_in_stock_filter_to_collection"
  50. type="Magento\InventoryCatalog\Plugin\CatalogInventory\Model\ResourceModel\Stock\Status\AdaptAddIsInStockFilterToCollectionPlugin"/>
  51. </type>
  52. <type name="Magento\CatalogInventory\Helper\Stock">
  53. <plugin name="adapt_add_in_stock_filter_to_collection" type="Magento\InventoryCatalog\Plugin\CatalogInventory\Helper\Stock\AdaptAddInStockFilterToCollectionPlugin"/>
  54. <plugin name="adapt_add_stock_status_to_products" type="Magento\InventoryCatalog\Plugin\CatalogInventory\Helper\Stock\AdaptAddStockStatusToProductsPlugin"/>
  55. <plugin name="adapt_assign_status_to_product" type="Magento\InventoryCatalog\Plugin\CatalogInventory\Helper\Stock\AdaptAssignStatusToProductPlugin"/>
  56. </type>
  57. <type name="Magento\InventoryApi\Model\SourceValidatorChain">
  58. <arguments>
  59. <argument name="validators" xsi:type="array">
  60. <item name="default_source_disable_validator" xsi:type="object">Magento\InventoryCatalog\Model\Source\Validator\DefaultSourceDisableValidator</item>
  61. </argument>
  62. </arguments>
  63. </type>
  64. <type name="Magento\InventoryApi\Model\StockSourceLinkValidatorChain">
  65. <arguments>
  66. <argument name="validators" xsi:type="array">
  67. <item name="default_stock_default_source" xsi:type="object">
  68. Magento\InventoryCatalog\Model\StockSourceLink\Validator\AssignToDefaultStockDefaultSourceValidator
  69. </item>
  70. </argument>
  71. </arguments>
  72. </type>
  73. <type name="Magento\InventorySalesApi\Api\GetStockBySalesChannelInterface">
  74. <plugin name="adapt_stock_resolver_to_admin_website"
  75. type="Magento\InventoryCatalog\Plugin\InventorySalesApi\StockResolver\AdaptStockResolverToAdminWebsitePlugin"/>
  76. </type>
  77. <type name="Magento\InventoryApi\Api\StockSourceLinksDeleteInterface">
  78. <plugin name="prevent_delete_default_stock_links" type="Magento\InventoryCatalog\Plugin\InventoryApi\StockSourceLinksDelete\PreventDeleteDefaultStockLinksPlugin"/>
  79. </type>
  80. <type name="Magento\InventoryCatalog\Setup\Operation\UpdateInventorySourceItem">
  81. <arguments>
  82. <argument name="tableNameSourceItem" xsi:type="const">Magento\Inventory\Model\ResourceModel\SourceItem::TABLE_NAME_SOURCE_ITEM</argument>
  83. </arguments>
  84. </type>
  85. <type name="Magento\InventoryCatalog\Model\UpdateSourceItemBasedOnLegacyStockItem">
  86. <arguments>
  87. <argument name="sourceItemsSave" xsi:type="object">Magento\Inventory\Model\SourceItem\Command\SourceItemsSaveWithoutLegacySynchronization</argument>
  88. </arguments>
  89. </type>
  90. <type name="Magento\Inventory\Model\SourceItem\Command\SourceItemsSaveWithoutLegacySynchronization">
  91. <plugin name="set_data_to_legacy_catalog_inventory_at_source_items_save" disabled="true"/>
  92. </type>
  93. <type name="Magento\CatalogInventory\Api\StockRegistryInterface">
  94. <plugin name="adapt_get_stock_status" type="Magento\InventoryCatalog\Plugin\CatalogInventory\Api\StockRegistry\AdaptGetStockStatusPlugin"/>
  95. <plugin name="adapt_get_stock_status_by_sku" type="Magento\InventoryCatalog\Plugin\CatalogInventory\Api\StockRegistry\AdaptGetStockStatusBySkuPlugin"/>
  96. <plugin name="adapt_get_product_stock_status" type="Magento\InventoryCatalog\Plugin\CatalogInventory\Api\StockRegistry\AdaptGetProductStockStatusPlugin"/>
  97. <plugin name="adapt_get_product_stock_status_by_sku" type="Magento\InventoryCatalog\Plugin\CatalogInventory\Api\StockRegistry\AdaptGetProductStockStatusBySkuPlugin"/>
  98. </type>
  99. <!-- Mass Source Assignment -->
  100. <preference for="Magento\InventoryCatalogApi\Api\BulkSourceAssignInterface"
  101. type="Magento\InventoryCatalog\Model\BulkSourceAssign"/>
  102. <preference for="Magento\InventoryCatalogApi\Api\BulkSourceUnassignInterface"
  103. type="Magento\InventoryCatalog\Model\BulkSourceUnassign"/>
  104. <preference for="Magento\InventoryCatalogApi\Api\BulkInventoryTransferInterface"
  105. type="Magento\InventoryCatalog\Model\BulkInventoryTransfer"/>
  106. <type name="\Magento\InventoryCatalogApi\Model\BulkSourceAssignValidatorChain">
  107. <arguments>
  108. <argument name="validators" xsi:type="array">
  109. <item name="sources"
  110. xsi:type="object">Magento\InventoryCatalog\Model\Source\Validator\Bulk\AssignSourcesValidator</item>
  111. </argument>
  112. </arguments>
  113. </type>
  114. <type name="\Magento\InventoryCatalogApi\Model\BulkSourceUnassignValidatorChain">
  115. <arguments>
  116. <argument name="validators" xsi:type="array">
  117. <item name="sources"
  118. xsi:type="object">Magento\InventoryCatalog\Model\Source\Validator\Bulk\UnassignSourcesValidator</item>
  119. </argument>
  120. </arguments>
  121. </type>
  122. <type name="\Magento\InventoryCatalogApi\Model\BulkInventoryTransferValidatorChain">
  123. <arguments>
  124. <argument name="validators" xsi:type="array">
  125. <item name="sources"
  126. xsi:type="object">Magento\InventoryCatalog\Model\Source\Validator\Bulk\TransferSourceValidator</item>
  127. </argument>
  128. </arguments>
  129. </type>
  130. <!-- Negative Min Quantity Threshold for Backorders -->
  131. <type name="Magento\Catalog\Controller\Adminhtml\Product\Initialization\StockDataFilter">
  132. <plugin name="allow_negative_min_qty"
  133. type="Magento\InventoryCatalog\Plugin\Catalog\Controller\Adminhtml\Product\Initialization\StockDataFilter\AllowNegativeMinQtyPlugin"/>
  134. </type>
  135. <type name="Magento\CatalogInventory\Api\Data\StockItemInterface">
  136. <plugin name="adapt_min_qty_to_backorders"
  137. type="Magento\InventoryCatalog\Plugin\CatalogInventory\Api\Data\StockItemInterface\AdaptMinQtyToBackordersPlugin"/>
  138. </type>
  139. <type name="Magento\CatalogInventory\Model\Spi\StockStateProviderInterface">
  140. <plugin name="adapt_verify_stock_to_negative_min_qty"
  141. type="Magento\InventoryCatalog\Plugin\CatalogInventory\Model\Spi\StockStateProvider\AdaptVerifyStockToNegativeMinQtyPlugin"/>
  142. </type>
  143. </config>