di.xml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. <type name="Magento\Catalog\Controller\Adminhtml\Product\Attribute\Save">
  10. <plugin name="save_swatches_frontend_input" type="Magento\Swatches\Controller\Adminhtml\Product\Attribute\Plugin\Save"/>
  11. </type>
  12. <type name="Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab\Main">
  13. <arguments>
  14. <argument name="formFactory" xsi:type="object">Magento\Swatches\Block\Adminhtml\Product\Attribute\Edit\FormFactory</argument>
  15. </arguments>
  16. </type>
  17. <virtualType name="Magento\Swatches\Block\Adminhtml\Product\Attribute\Edit\FormFactory" type="Magento\Framework\Data\FormFactory">
  18. <arguments>
  19. <argument name="instanceName" xsi:type="string">Magento\Swatches\Block\Adminhtml\Product\Attribute\Edit\Form</argument>
  20. </arguments>
  21. </virtualType>
  22. <type name="Magento\ConfigurableProduct\Controller\Adminhtml\Product\Attribute\GetAttributes">
  23. <arguments>
  24. <argument name="attributesList" xsi:type="object">Magento\Swatches\Model\AttributesList</argument>
  25. </arguments>
  26. </type>
  27. <type name="Magento\Catalog\Model\ResourceModel\Eav\Attribute">
  28. <plugin name="invalidate_caches_after_attribute_save" type="Magento\Swatches\Plugin\Catalog\CacheInvalidate" />
  29. </type>
  30. <type name="Magento\Eav\Model\Adminhtml\System\Config\Source\Inputtype">
  31. <plugin name="append_compatible_input_types" type="Magento\Swatches\Plugin\Eav\System\Config\Source\InputtypePlugin" />
  32. </type>
  33. <type name="Magento\Catalog\Controller\Adminhtml\Product\Attribute\Validate">
  34. <arguments>
  35. <argument name="multipleAttributeList" xsi:type="array">
  36. <item name="swatch_text" xsi:type="string">optiontext</item>
  37. <item name="swatch_visual" xsi:type="string">optionvisual</item>
  38. </argument>
  39. </arguments>
  40. </type>
  41. </config>