Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 
 

207 wiersze
10 KiB

  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. <preference for="Magento\SalesRule\Api\Data\RuleDiscountInterface"
  34. type="Magento\SalesRule\Model\Data\RuleDiscount" />
  35. <preference for="Magento\SalesRule\Api\Data\DiscountDataInterface"
  36. type="Magento\SalesRule\Model\Data\DiscountData" />
  37. <preference for="Magento\SalesRule\Model\Spi\RuleQuoteRecollectTotalsInterface"
  38. type="Magento\SalesRule\Model\Rule\RuleQuoteRecollectTotalsOnDemand" />
  39. <preference for="Magento\SalesRule\Model\Spi\QuoteResetAppliedRulesInterface"
  40. type="Magento\SalesRule\Model\Rule\QuoteResetAppliedRules" />
  41. <type name="Magento\SalesRule\Helper\Coupon">
  42. <arguments>
  43. <argument name="couponParameters" xsi:type="array">
  44. <item name="separator" xsi:type="string">-</item>
  45. <item name="charset" xsi:type="array">
  46. <item name="alphanum" xsi:type="string">ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789</item>
  47. <item name="alpha" xsi:type="string">ABCDEFGHIJKLMNOPQRSTUVWXYZ</item>
  48. <item name="num" xsi:type="string">0123456789</item>
  49. </item>
  50. </argument>
  51. </arguments>
  52. </type>
  53. <type name="Magento\SalesRule\Model\ResourceModel\Rule\Collection" shared="false" />
  54. <type name="Magento\Quote\Model\Quote\Config">
  55. <plugin name="append_sales_rule_keys_to_quote" type="Magento\SalesRule\Model\Plugin\QuoteConfigProductAttributes"/>
  56. </type>
  57. <type name="Magento\Framework\Module\Setup\Migration">
  58. <arguments>
  59. <argument name="compositeModules" xsi:type="array">
  60. <item name="salesrule" xsi:type="string">Magento_SalesRule</item>
  61. </argument>
  62. </arguments>
  63. </type>
  64. <type name="Magento\Framework\App\Rss\RssManagerInterface">
  65. <arguments>
  66. <argument name="dataProviders" xsi:type="array">
  67. <item name="discounts" xsi:type="string">Magento\SalesRule\Block\Rss\Discounts</item>
  68. </argument>
  69. </arguments>
  70. </type>
  71. <type name="Magento\SalesRule\Model\ResourceModel\Report\Rule">
  72. <arguments>
  73. <argument name="connectionName" xsi:type="string">sales</argument>
  74. </arguments>
  75. </type>
  76. <type name="Magento\SalesRule\Model\ResourceModel\Report\Rule\Createdat">
  77. <arguments>
  78. <argument name="connectionName" xsi:type="string">sales</argument>
  79. </arguments>
  80. </type>
  81. <type name="Magento\SalesRule\Model\ResourceModel\Report\Rule\Updatedat">
  82. <arguments>
  83. <argument name="connectionName" xsi:type="string">sales</argument>
  84. </arguments>
  85. </type>
  86. <type name="Magento\Framework\Model\Entity\RepositoryFactory">
  87. <arguments>
  88. <argument name="entities" xsi:type="array">
  89. <item name="Magento\SalesRule\Api\Data\RuleInterface" xsi:type="string">Magento\SalesRule\Model\ResourceModel\Rule</item>
  90. </argument>
  91. </arguments>
  92. </type>
  93. <type name="Magento\Framework\EntityManager\MetadataPool">
  94. <arguments>
  95. <argument name="metadata" xsi:type="array">
  96. <item name="Magento\SalesRule\Api\Data\RuleInterface" xsi:type="array">
  97. <item name="entityTableName" xsi:type="string">salesrule</item>
  98. <item name="identifierField" xsi:type="string">rule_id</item>
  99. </item>
  100. </argument>
  101. </arguments>
  102. </type>
  103. <type name="Magento\Framework\EntityManager\Operation\AttributePool">
  104. <arguments>
  105. <argument name="extensionActions" xsi:type="array">
  106. <item name="salesRule" xsi:type="array">
  107. <item name="Magento\SalesRule\Api\Data\RuleInterface" xsi:type="array">
  108. <item name="read" xsi:type="string">Magento\SalesRule\Model\ResourceModel\ReadHandler</item>
  109. <item name="create" xsi:type="string">Magento\SalesRule\Model\ResourceModel\SaveHandler</item>
  110. <item name="update" xsi:type="string">Magento\SalesRule\Model\ResourceModel\SaveHandler</item>
  111. </item>
  112. </item>
  113. </argument>
  114. </arguments>
  115. </type>
  116. <type name="Magento\SalesRule\Model\Rule\Condition\Address">
  117. <arguments>
  118. <argument name="data" xsi:type="array">
  119. <item name="form_name" xsi:type="string">sales_rule_form</item>
  120. </argument>
  121. </arguments>
  122. </type>
  123. <type name="Magento\SalesRule\Model\Rule\Condition\Combine">
  124. <arguments>
  125. <argument name="data" xsi:type="array">
  126. <item name="form_name" xsi:type="string">sales_rule_form</item>
  127. </argument>
  128. </arguments>
  129. </type>
  130. <type name="Magento\SalesRule\Model\Rule\Condition\Product">
  131. <arguments>
  132. <argument name="data" xsi:type="array">
  133. <item name="form_name" xsi:type="string">sales_rule_form</item>
  134. </argument>
  135. </arguments>
  136. </type>
  137. <type name="Magento\SalesRule\Model\Rule\Condition\Product\Combine">
  138. <arguments>
  139. <argument name="data" xsi:type="array">
  140. <item name="form_name" xsi:type="string">sales_rule_form</item>
  141. </argument>
  142. </arguments>
  143. </type>
  144. <type name="Magento\SalesRule\Model\Rule\Condition\Product\Found">
  145. <arguments>
  146. <argument name="data" xsi:type="array">
  147. <item name="form_name" xsi:type="string">sales_rule_form</item>
  148. </argument>
  149. </arguments>
  150. </type>
  151. <type name="Magento\SalesRule\Model\Rule\Condition\Product\Subselect">
  152. <arguments>
  153. <argument name="data" xsi:type="array">
  154. <item name="form_name" xsi:type="string">sales_rule_form</item>
  155. </argument>
  156. </arguments>
  157. </type>
  158. <type name="Magento\SalesRule\Model\Rule\Customer">
  159. <arguments>
  160. <argument name="data" xsi:type="array">
  161. <item name="form_name" xsi:type="string">sales_rule_form</item>
  162. </argument>
  163. </arguments>
  164. </type>
  165. <virtualType name="Magento\SalesRule\Model\ResourceModel\Rule\AssociatedEntityMap" type="Magento\Framework\DataObject">
  166. <arguments>
  167. <argument name="data" xsi:type="array">
  168. <item name="website" xsi:type="array">
  169. <item name="associations_table" xsi:type="string">salesrule_website</item>
  170. <item name="rule_id_field" xsi:type="string">rule_id</item>
  171. <item name="entity_id_field" xsi:type="string">website_id</item>
  172. </item>
  173. <item name="customer_group" xsi:type="array">
  174. <item name="associations_table" xsi:type="string">salesrule_customer_group</item>
  175. <item name="rule_id_field" xsi:type="string">rule_id</item>
  176. <item name="entity_id_field" xsi:type="string">customer_group_id</item>
  177. </item>
  178. </argument>
  179. </arguments>
  180. </virtualType>
  181. <type name="Magento\Framework\EntityManager\HydratorPool">
  182. <arguments>
  183. <argument name="hydrators" xsi:type="array">
  184. <item name="Magento\SalesRule\Api\Data\RuleInterface" xsi:type="string">Magento\Framework\EntityManager\AbstractModelHydrator</item>
  185. <item name="Magento\SalesRule\Api\Data\CouponInterface" xsi:type="string">Magento\Framework\EntityManager\AbstractModelHydrator</item>
  186. </argument>
  187. </arguments>
  188. </type>
  189. <type name="Magento\Quote\Model\Cart\CartTotalRepository">
  190. <plugin name="coupon_label_plugin" type="Magento\SalesRule\Plugin\CartTotalRepository" />
  191. </type>
  192. <type name="Magento\Sales\Model\Service\OrderService">
  193. <plugin name="coupon_uses_decrement_plugin" type="Magento\SalesRule\Plugin\CouponUsagesDecrement" />
  194. </type>
  195. <type name="\Magento\Quote\Model\QuoteManagement">
  196. <plugin name="coupon_uses_increment_plugin" type="Magento\SalesRule\Plugin\CouponUsagesIncrement" sortOrder="20"/>
  197. </type>
  198. <preference
  199. for="Magento\SalesRule\Model\Spi\CodeLimitManagerInterface"
  200. type="Magento\SalesRule\Model\Coupon\CodeLimitManager" />
  201. <type name="Magento\SalesRule\Observer\RuleQuoteRecollectTotalsObserver">
  202. <arguments>
  203. <argument name="recollectTotals" xsi:type="object">Magento\SalesRule\Model\Rule\RuleQuoteRecollectTotalsAsync\Proxy</argument>
  204. </arguments>
  205. </type>
  206. </config>