<?xml version="1.0"?>
<!--
/**
* BSS Commerce Co.
*
* NOTICE OF LICENSE
*
* This source file is subject to the EULA
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://bsscommerce.com/Bss-Commerce-License.txt
*
* @category   BSS
* @package    Bss_ConfiguableGridView
* @author     Extension Team
* @copyright  Copyright (c) 2018-2019 BSS Commerce Co. ( http://bsscommerce.com )
* @license    http://bsscommerce.com/Bss-Commerce-License.txt
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
	<type name="Magento\Catalog\Block\Product\View">
		<plugin name="bss_modify_add_to_cart_url" type="Bss\ConfiguableGridView\Plugin\AddCartUrl" sortOrder="10" disabled="false"/>
	</type>

    <type name="Magento\ConfigurableProduct\Model\Product\Type\Configurable">
        <plugin name="used_products_cache" type="Bss\ConfiguableGridView\Model\ConfigurableProduct\Model\Plugin\Frontend\UsedProductsCache" />
    </type>

    <type name="Magento\Checkout\Model\Cart">
        <plugin name="bss_config_grid_view_prevent_add_to" type="Bss\ConfiguableGridView\Plugin\Model\Cart\BeforeAddToCart"/>
    </type>

    <type name="Bss\ConfiguableGridView\Plugin\Model\Cart\BeforeAddToCart">
        <arguments>
            <argument name="getSalableQuantityDataBySku" xsi:type="object">
                Magento\InventorySalesAdminUi\Model\GetSalableQuantityDataBySku
            </argument>

            <argument name="preOrderHelper" xsi:type="object">
                Bss\PreOrder\Helper\Data
            </argument>
        </arguments>
    </type>
</config>
