Why is my Magento2 di.xml not having any effect?

筅森魡賤 提交于 2019-12-24 15:56:45

问题


I've overridden \Magento\Checkout\Block\Cart\Item\Renderer and when I add this to the end of config in /app/etc/di.xml the override works.

<preference for="Magento\Checkout\Block\Cart\Item\Renderer" type="Tls\Module\Block\Cart\Item\Renderer" />

However, when I try to use /app/code/Tls/Module/etc/di.xml there is no effect. This is the contents of my di.xml (though I've tried many things)

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
    <preference for="Magento\Checkout\Block\Cart\Item\Renderer" type="Tls\Module\Block\Cart\Item\Renderer" />
</config>

Magento 2.2.4

来源:https://stackoverflow.com/questions/50765183/why-is-my-magento2-di-xml-not-having-any-effect

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!