<?xml version="1.0"?>
<!--
* *
 *  @author Yeboyebo
 *  @package Yeboyebo_MrwPuntosRecogida
 */
 -->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Yeboyebo\MrwPuntosRecogida\Api\MrwPuntosRecogidaManagementInterface" type="Yeboyebo\MrwPuntosRecogida\Model\MrwPuntosRecogidaManagement" />
    <preference for="Yeboyebo\MrwPuntosRecogida\Api\GuestMrwPuntosRecogidaManagementInterface" type="Yeboyebo\MrwPuntosRecogida\Model\GuestCart\GuestMrwPuntosRecogidaManagement" />
    <virtualType name="YeboyeboPuntorecogidaGridFilterPool" type="Magento\Framework\View\Element\UiComponent\DataProvider\FilterPool">
        <arguments>
            <argument name="appliers" xsi:type="array">
                <item name="regular" xsi:type="object">Magento\Framework\View\Element\UiComponent\DataProvider\RegularFilter</item>
                <item name="fulltext" xsi:type="object">Magento\Framework\View\Element\UiComponent\DataProvider\FulltextFilter</item>
            </argument>
        </arguments>
    </virtualType>
    <virtualType name="YeboyeboPuntorecogidaGridDataProvider" type="Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider">
        <arguments>
            <argument name="collection" xsi:type="object" shared="false">Yeboyebo\MrwPuntosRecogida\Model\ResourceModel\Puntorecogida\Collection</argument>
            <argument name="filterPool" xsi:type="object" shared="false">YeboyeboPuntorecogidaGridFilterPool</argument>
        </arguments>
    </virtualType>
    <virtualType name="Yeboyebo\MrwPuntosRecogida\Model\ResourceModel\Puntorecogida\Grid\Collection" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
        <arguments>
            <argument name="mainTable" xsi:type="string">yeboyebo_mrw_puntos_recogida</argument>
            <argument name="resourceModel" xsi:type="string">Yeboyebo\MrwPuntosRecogida\Model\ResourceModel\Puntorecogida</argument>
        </arguments>
    </virtualType>
    <type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
        <arguments>
            <argument name="collections" xsi:type="array">
                <item name="yeboyebo_puntorecogida_index_listing_data_source" xsi:type="string">Yeboyebo\MrwPuntosRecogida\Model\ResourceModel\Puntorecogida\Grid\Collection</item>
            </argument>
        </arguments>
    </type>
    <type name="Magento\Checkout\Block\Checkout\LayoutProcessor">
        <plugin name="checkout_mrw_puntos_recogida_fields" type="Yeboyebo\MrwPuntosRecogida\Plugin\Checkout\LayoutProcessorPlugin" sortOrder="11"/>
    </type>
    <type name="Magento\Checkout\Model\ShippingInformationManagement">
        <plugin name="save_to_quote_table_mrw_puntos_recogida" type="Yeboyebo\MrwPuntosRecogida\Plugin\Quote\SaveToQuote" sortOrder="11"/>
    </type>
</config>