<?xml version="1.0"?>
<!--
/**
 * Mageplaza
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Mageplaza.com license that is
 * available through the world-wide-web at this URL:
 * https://www.mageplaza.com/LICENSE.txt
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade this extension to newer
 * version in the future.
 *
 * @category    Mageplaza
 * @package     Mageplaza_GoogleTagManager
 * @copyright   Copyright (c) Mageplaza (https://www.mageplaza.com/)
 * @license     https://www.mageplaza.com/LICENSE.txt
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Mageplaza\GoogleTagManager\Api\CodeRepositoryInterface" type="Mageplaza\GoogleTagManager\Model\CodeRepository"/>
    <preference for="Mageplaza\GoogleTagManager\Api\Data\GtmCartItemInterface" type="Mageplaza\GoogleTagManager\Model\Api\Data\GtmCartItem"/>
    <type name="Magento\Quote\Api\CartItemRepositoryInterface">
        <plugin name="mp_gtm_cart_extra_attribute" type="Mageplaza\GoogleTagManager\Plugin\CartItemRepositoryPlugin" />
    </type>
    <type name="Magento\QuoteGraphQl\Model\Resolver\AddSimpleProductsToCart">
        <plugin name="mp_gtm_graphql_add_to_cart_simple_product" type="Mageplaza\GoogleTagManager\Plugin\QuoteGraphQl\Resolver\AddOrRemoveProductsToCartPlugin" />
    </type>
    <type name="Magento\QuoteGraphQl\Model\Resolver\AddProductsToCart">
        <plugin name="mp_gtm_graphql_add_to_cart" type="Mageplaza\GoogleTagManager\Plugin\QuoteGraphQl\Resolver\AddOrRemoveProductsToCartPlugin" />
    </type>
    <type name="Magento\QuoteGraphQl\Model\Resolver\RemoveItemFromCart">
        <plugin name="mp_gtm_graphql_remove_from_cart" type="Mageplaza\GoogleTagManager\Plugin\QuoteGraphQl\Resolver\AddOrRemoveProductsToCartPlugin" />
    </type>
</config>
