<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Checkout\Controller\Cart\CouponPost">
        <plugin name="Bloyal_coupon_plugin" type="Bloyal\Calculatecart\Plugin\Magento\Checkout\Controller\Cart\CouponPost" sortOrder="10" disabled="false"  />
    </type>
    <!--Add custom logger-->
    <type name="Bloyal\Calculatecart\Logger\Handler">
        <arguments>
            <argument name="filesystem" xsi:type="object">Magento\Framework\Filesystem\Driver\File</argument>
        </arguments>
    </type>
    <type name="Bloyal\Calculatecart\Logger\Logger">
        <arguments>
            <argument name="name" xsi:type="string">customLogHandler</argument>
            <argument name="handlers"  xsi:type="array">
                <item name="system" xsi:type="object">Bloyal\Calculatecart\Logger\Handler</item>
            </argument>
        </arguments>
    </type>
    <preference for="Magento\Quote\Model\CouponManagement" type="Bloyal\Calculatecart\Model\Quote\CouponManagement" />
	<type name="Magento\Customer\Controller\Account\Login">
        <plugin name="CheckIfCustomerIsloggedIn" type="Bloyal\Calculatecart\Plugin\Customer\Account\Login" disabled="false" sortOrder="1" />
    </type>
    <type name="Magento\Customer\Controller\Account\LoginPost">
        <plugin name="CustomerGetSessionKey" type="Bloyal\Calculatecart\Plugin\Customer\Account\LoginPost" disabled="false" sortOrder="1" />
    </type>
    
   <type name="Magento\Checkout\Model\DefaultConfigProvider">
        <plugin name="CustomCheckoutModelDefaultConfigProvider" type="Bloyal\Calculatecart\Plugin\Checkout\Model\DefaultConfigProvider" sortOrder="100"/>
    </type> 

    <!-- Add Custom bLoyal tax -->
    <preference for="Magento\Tax\Model\Sales\Total\Quote\Tax" type="Bloyal\Calculatecart\Model\CustomTax" />
</config>
