<?xml version="1.0"?>
<!--
/**
 * Copyright © MageWorx. All rights reserved.
 * See LICENSE.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <!-- Installation -->
    <type name="MageWorx\OptionBase\Model\Installer">
        <arguments>
            <argument name="installSchema" xsi:type="array">
                <item name="optionbase_install_schema_data" xsi:type="object">MageWorx\OptionBase\Model\InstallSchema</item>
            </argument>
        </arguments>
    </type>
    <!-- Data -->
    <type name="MageWorx\OptionBase\Model\Product\Option\Attributes">
        <arguments>
            <argument name="data" xsi:type="array">
                <item name="option_title" xsi:type="object">MageWorx\OptionBase\Model\Attribute\Option\Title</item>
                <item name="option_price" xsi:type="object">MageWorx\OptionBase\Model\Attribute\Option\Price</item>
            </argument>
        </arguments>
    </type>
    <type name="MageWorx\OptionBase\Model\Product\Option\Value\Attributes">
        <arguments>
            <argument name="data" xsi:type="array">
                <item name="option_type_title" xsi:type="object">MageWorx\OptionBase\Model\Attribute\Value\Title</item>
                <item name="option_type_price" xsi:type="object">MageWorx\OptionBase\Model\Attribute\Value\Price</item>
            </argument>
        </arguments>
    </type>
    <type name="MageWorx\OptionBase\Model\Product\Option\CollectionUpdaters">
        <arguments>
            <argument name="data" xsi:type="array">
                <item name="option_title" xsi:type="object">MageWorx\OptionBase\Model\CollectionUpdater\Option\Title</item>
                <item name="option_price" xsi:type="object">MageWorx\OptionBase\Model\CollectionUpdater\Option\Price</item>
            </argument>
        </arguments>
    </type>
    <type name="MageWorx\OptionBase\Model\Product\Option\Value\CollectionUpdaters">
        <arguments>
            <argument name="data" xsi:type="array">
                <item name="option_type_title" xsi:type="object">MageWorx\OptionBase\Model\CollectionUpdater\Value\Title</item>
                <item name="option_type_price" xsi:type="object">MageWorx\OptionBase\Model\CollectionUpdater\Value\Price</item>
            </argument>
        </arguments>
    </type>
    <!-- Plugins -->
    <type name="Magento\Catalog\Model\ResourceModel\Product\Option\Collection">
        <plugin name="mageworx_optionbase_collect_product_option_conditions"
                type="MageWorx\OptionBase\Plugin\CollectProductOptionConditions"
                sortOrder="10"
                disabled="false"/>
    </type>
    <type name="Magento\Catalog\Model\ResourceModel\Product\Collection">
        <plugin name="mageworx_optionbase_collect_product_conditions"
                type="MageWorx\OptionBase\Plugin\CollectProductConditions"
                sortOrder="10"
                disabled="false"/>
    </type>
    <type name="Magento\Catalog\Model\Product\Option\Repository">
        <plugin name="mageworx_optionbase_collect_enterprise_product_conditions"
                type="MageWorx\OptionBase\Plugin\CollectEnterpriseProductConditions"
                sortOrder="10"
                disabled="false"/>
    </type>
    <type name="Magento\Catalog\Model\ResourceModel\Product\Collection">
        <plugin name="mageworx_optionbase_extend_product_collection"
                type="MageWorx\OptionBase\Plugin\ExtendProductCollection"
                sortOrder="10"
                disabled="false"/>
    </type>
    <type name="Magento\Catalog\Model\ResourceModel\Product\Option\Collection">
        <plugin name="mageworx_optionbase_extend_option_collection"
                type="MageWorx\OptionBase\Plugin\ExtendOptionCollection"
                sortOrder="10"
                disabled="false"/>
    </type>
    <type name="Magento\Catalog\Model\ResourceModel\Product\Option\Value\Collection">
        <plugin name="mageworx_optionbase_extend_option_value_collection"
                type="MageWorx\OptionBase\Plugin\ExtendOptionValueCollection"
                sortOrder="10"
                disabled="false"/>
    </type>

    <type name="Magento\Catalog\Block\Product\View\Options">
        <plugin name="mageworx_optionbase_around_options_html"
                type="MageWorx\OptionBase\Plugin\AroundOptionsHtml"
                sortOrder="10"
                disabled="false"/>
    </type>
    <type name="Magento\Catalog\Block\Product\View\Options\Type\Select">
        <plugin name="mageworx_optionbase_around_option_values_html"
                type="MageWorx\OptionBase\Plugin\AroundOptionValuesHtml"
                sortOrder="5"
                disabled="false"/>
    </type>
    <type name="Magento\Catalog\Model\Product\Option\Type\DefaultType">
        <plugin name="mageworx_optionbase_validate_add_to_cart"
                type="MageWorx\OptionBase\Plugin\ValidateAddToCart"
                sortOrder="10"
                disabled="false"
        />
    </type>
    <type name="Magento\Catalog\Model\Product\Type\AbstractType">
        <plugin name="mageworx_optionbase_validate_cart_checkout"
                type="MageWorx\OptionBase\Plugin\ValidateCartCheckout"
                sortOrder="10"
                disabled="false"
        />
    </type>
    <type name="Magento\Catalog\Model\Product">
        <plugin name="mageworx_optiontemplates_is_require_checker_aftersave"
                type="MageWorx\OptionBase\Plugin\IsRequireChecker"
                sortOrder="10"
                disabled="false"/>
    </type>
    <type name="Magento\Catalog\Model\Product\Option\Value">
        <plugin name="mageworx_optionbase_save_values_bugfix"
                type="MageWorx\OptionBase\Plugin\SaveValuesBugfix"
                sortOrder="10"
                disabled="false"/>
    </type>
</config>
