如何在Magento 2.2.8的抽象类中覆盖受保护的函数

问题描述 投票:0回答:1

在Magento 2.2.8中,我想覆盖CalculateWithTaxInPrice文件中的/vendor/magento/module-tax/Model/Calculation/AbstractAggregateCalculator.php受保护的功能。

我尝试使用插件和首选项,但未覆盖该功能。

任何人都可以帮助我解决问题。

谢谢。

magento2.2
1个回答
0
投票

在Magento插件中仅适用于公共功能。

对于您的情况,建议您尽可能使用Observer,否则可以使用首选项。

© www.soinside.com 2019 - 2024. All rights reserved.