di.xml 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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\SalesRule\Api\RuleRepositoryInterface"
  10. type="Magento\SalesRule\Model\RuleRepository" />
  11. <preference for="Magento\SalesRule\Api\Data\RuleInterface"
  12. type="Magento\SalesRule\Model\Data\Rule" />
  13. <preference for="Magento\SalesRule\Api\Data\ConditionInterface"
  14. type="Magento\SalesRule\Model\Data\Condition" />
  15. <preference for="Magento\SalesRule\Api\Data\RuleSearchResultInterface"
  16. type="Magento\Framework\Api\SearchResults" />
  17. <preference for="Magento\SalesRule\Api\Data\RuleLabelInterface"
  18. type="Magento\SalesRule\Model\Data\RuleLabel" />
  19. <preference for="Magento\SalesRule\Api\Data\CouponInterface"
  20. type="Magento\SalesRule\Model\Coupon" />
  21. <preference for="Magento\SalesRule\Api\CouponRepositoryInterface"
  22. type="Magento\SalesRule\Model\CouponRepository" />
  23. <preference for="Magento\SalesRule\Model\Spi\CouponResourceInterface"
  24. type="Magento\SalesRule\Model\ResourceModel\Coupon" />
  25. <preference for="Magento\SalesRule\Api\Data\CouponSearchResultInterface"
  26. type="Magento\Framework\Api\SearchResults" />
  27. <preference for="Magento\SalesRule\Api\Data\CouponGenerationSpecInterface"
  28. type="Magento\SalesRule\Model\Data\CouponGenerationSpec" />
  29. <preference for="Magento\SalesRule\Api\Data\CouponMassDeleteResultInterface"
  30. type="Magento\SalesRule\Model\Data\CouponMassDeleteResult" />
  31. <preference for="Magento\SalesRule\Api\CouponManagementInterface"
  32. type="Magento\SalesRule\Model\Service\CouponManagementService" />
  33. <type name="Magento\SalesRule\Helper\Coupon">
  34. <arguments>
  35. <argument name="couponParameters" xsi:type="array">
  36. <item name="separator" xsi:type="string">-</item>
  37. <item name="charset" xsi:type="array">
  38. <item name="alphanum" xsi:type="string">ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789</item>
  39. <item name="alpha" xsi:type="string">ABCDEFGHIJKLMNOPQRSTUVWXYZ</item>
  40. <item name="num" xsi:type="string">0123456789</item>
  41. </item>
  42. </argument>
  43. </arguments>
  44. </type>
  45. <type name="Magento\SalesRule\Model\ResourceModel\Rule\Collection" shared="false" />
  46. <type name="Magento\Quote\Model\Quote\Config">
  47. <plugin name="append_sales_rule_keys_to_quote" type="Magento\SalesRule\Model\Plugin\QuoteConfigProductAttributes"/>
  48. </type>
  49. <type name="Magento\Framework\Module\Setup\Migration">
  50. <arguments>
  51. <argument name="compositeModules" xsi:type="array">
  52. <item name="salesrule" xsi:type="string">Magento_SalesRule</item>
  53. </argument>
  54. </arguments>
  55. </type>
  56. <type name="Magento\Framework\App\Rss\RssManagerInterface">
  57. <arguments>
  58. <argument name="dataProviders" xsi:type="array">
  59. <item name="discounts" xsi:type="string">Magento\SalesRule\Block\Rss\Discounts</item>
  60. </argument>
  61. </arguments>
  62. </type>
  63. <type name="Magento\SalesRule\Model\ResourceModel\Report\Rule">
  64. <arguments>
  65. <argument name="connectionName" xsi:type="string">sales</argument>
  66. </arguments>
  67. </type>
  68. <type name="Magento\SalesRule\Model\ResourceModel\Report\Rule\Createdat">
  69. <arguments>
  70. <argument name="connectionName" xsi:type="string">sales</argument>
  71. </arguments>
  72. </type>
  73. <type name="Magento\SalesRule\Model\ResourceModel\Report\Rule\Updatedat">
  74. <arguments>
  75. <argument name="connectionName" xsi:type="string">sales</argument>
  76. </arguments>
  77. </type>
  78. <type name="Magento\Framework\Model\Entity\RepositoryFactory">
  79. <arguments>
  80. <argument name="entities" xsi:type="array">
  81. <item name="Magento\SalesRule\Api\Data\RuleInterface" xsi:type="string">Magento\SalesRule\Model\ResourceModel\Rule</item>
  82. </argument>
  83. </arguments>
  84. </type>
  85. <type name="Magento\Framework\EntityManager\MetadataPool">
  86. <arguments>
  87. <argument name="metadata" xsi:type="array">
  88. <item name="Magento\SalesRule\Api\Data\RuleInterface" xsi:type="array">
  89. <item name="entityTableName" xsi:type="string">salesrule</item>
  90. <item name="identifierField" xsi:type="string">rule_id</item>
  91. </item>
  92. </argument>
  93. </arguments>
  94. </type>
  95. <type name="Magento\Framework\EntityManager\Operation\AttributePool">
  96. <arguments>
  97. <argument name="extensionActions" xsi:type="array">
  98. <item name="salesRule" xsi:type="array">
  99. <item name="Magento\SalesRule\Api\Data\RuleInterface" xsi:type="array">
  100. <item name="read" xsi:type="string">Magento\SalesRule\Model\ResourceModel\ReadHandler</item>
  101. <item name="create" xsi:type="string">Magento\SalesRule\Model\ResourceModel\SaveHandler</item>
  102. <item name="update" xsi:type="string">Magento\SalesRule\Model\ResourceModel\SaveHandler</item>
  103. </item>
  104. </item>
  105. </argument>
  106. </arguments>
  107. </type>
  108. <type name="Magento\SalesRule\Model\Rule\Condition\Address">
  109. <arguments>
  110. <argument name="data" xsi:type="array">
  111. <item name="form_name" xsi:type="string">sales_rule_form</item>
  112. </argument>
  113. </arguments>
  114. </type>
  115. <type name="Magento\SalesRule\Model\Rule\Condition\Combine">
  116. <arguments>
  117. <argument name="data" xsi:type="array">
  118. <item name="form_name" xsi:type="string">sales_rule_form</item>
  119. </argument>
  120. </arguments>
  121. </type>
  122. <type name="Magento\SalesRule\Model\Rule\Condition\Product">
  123. <arguments>
  124. <argument name="data" xsi:type="array">
  125. <item name="form_name" xsi:type="string">sales_rule_form</item>
  126. </argument>
  127. </arguments>
  128. </type>
  129. <type name="Magento\SalesRule\Model\Rule\Condition\Product\Combine">
  130. <arguments>
  131. <argument name="data" xsi:type="array">
  132. <item name="form_name" xsi:type="string">sales_rule_form</item>
  133. </argument>
  134. </arguments>
  135. </type>
  136. <type name="Magento\SalesRule\Model\Rule\Condition\Product\Found">
  137. <arguments>
  138. <argument name="data" xsi:type="array">
  139. <item name="form_name" xsi:type="string">sales_rule_form</item>
  140. </argument>
  141. </arguments>
  142. </type>
  143. <type name="Magento\SalesRule\Model\Rule\Condition\Product\Subselect">
  144. <arguments>
  145. <argument name="data" xsi:type="array">
  146. <item name="form_name" xsi:type="string">sales_rule_form</item>
  147. </argument>
  148. </arguments>
  149. </type>
  150. <type name="Magento\SalesRule\Model\Rule\Customer">
  151. <arguments>
  152. <argument name="data" xsi:type="array">
  153. <item name="form_name" xsi:type="string">sales_rule_form</item>
  154. </argument>
  155. </arguments>
  156. </type>
  157. <virtualType name="Magento\SalesRule\Model\ResourceModel\Rule\AssociatedEntityMap" type="Magento\Framework\DataObject">
  158. <arguments>
  159. <argument name="data" xsi:type="array">
  160. <item name="website" xsi:type="array">
  161. <item name="associations_table" xsi:type="string">salesrule_website</item>
  162. <item name="rule_id_field" xsi:type="string">rule_id</item>
  163. <item name="entity_id_field" xsi:type="string">website_id</item>
  164. </item>
  165. <item name="customer_group" xsi:type="array">
  166. <item name="associations_table" xsi:type="string">salesrule_customer_group</item>
  167. <item name="rule_id_field" xsi:type="string">rule_id</item>
  168. <item name="entity_id_field" xsi:type="string">customer_group_id</item>
  169. </item>
  170. </argument>
  171. </arguments>
  172. </virtualType>
  173. <type name="Magento\Framework\EntityManager\HydratorPool">
  174. <arguments>
  175. <argument name="hydrators" xsi:type="array">
  176. <item name="Magento\SalesRule\Api\Data\RuleInterface" xsi:type="string">Magento\Framework\EntityManager\AbstractModelHydrator</item>
  177. <item name="Magento\SalesRule\Api\Data\CouponInterface" xsi:type="string">Magento\Framework\EntityManager\AbstractModelHydrator</item>
  178. </argument>
  179. </arguments>
  180. </type>
  181. <type name="Magento\Quote\Model\Cart\CartTotalRepository">
  182. <plugin name="coupon_label_plugin" type="Magento\SalesRule\Plugin\CartTotalRepository" />
  183. </type>
  184. </config>