Latha
Latha

Reputation: 1

How to override the protected function in abstract class in Magento 2.2.8

In Magento 2.2.8, I want to override the CalculateWithTaxInPrice protected function in the /vendor/magento/module-tax/Model/Calculation/AbstractAggregateCalculator.php file.

I tried using the plugin and preference but the function was not overridden.

Can anyone help me to solve the problem.

Thanks.

Upvotes: 0

Views: 2198

Answers (1)

Sanjib Chowdhury
Sanjib Chowdhury

Reputation: 41

In Magento Plugin only work for public functions.

For your case, I recommend using Observer if possible, else you can use preferences.

Upvotes: 1

Related Questions