Skip to content
Advertisement

Shopware 5.6 override class method

I want to override method ajaxAddArticleCartAction in engine/Shopware/Controllers/Frontend/Checkout.php, cuz i want a bit complicated logic on accessories quantity calculation.

My question is: Is it possible to override this method in my custom plugin. With other words, if i add product in cart, i want to use my function (in plugin), not the Shopware one.

Thanks a lot!

Advertisement

Answer

Yes that is possible. You can use an event hook through which you can either execute something before, after or instead of a given action in any controller.

https://developers.shopware.com/developers-guide/event-guide/

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement