0

I try to override some core files and in my custom module I injected the dependencies like

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Checkout\CustomerData\Cart"
                type="MyVendor\Custom\CustomerData\Cart" />
    <preference for="Magento\Tax\CustomerData\CheckoutTotalsJsLayoutDataProvider"
                type="MyVendor\Custom\CustomerData\CheckoutTotalsJsLayoutDataProvider" />
</config> 

the second one is getting executed but the first does not seems to use the requested file.If set a var_dump in my override file no output is generated

0

Change below code:

 <preference for="Magento\Tax\CustomerData\CheckoutTotalsJsLayoutDataProvider"
                type="MyVendor\Custom\CustomerData\CheckoutTotalsJsLayoutDataProvider" />

to:

<type name="MyVendor\Custom\CustomerData\CheckoutTotalsJsLayoutDataProvider">
        <arguments>
            <argument name="jsLayoutDataProvidersObject" xsi:type="object">Magento\Tax\CustomerData\CheckoutTotalsJsLayoutDataProvider</argument>
        </arguments>
    </type>
  • thanks I tried but does not make any effect. Can you explain what brings different this snippet than the other one? – deroccha May 3 '16 at 12:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.