0

In my product list template I need the current category. I was searching around and the recommended way is to inject the registry into the current block's constructor. Example: https://magento.stackexchange.com/a/101694/59108

But I am using the default ListProduct block. Do I really have to override the block class only to get the current category?

Everybody is hailing dependency injection but it just keeps biting me in my behind whenever I have to do the simplest of tasks. I really don't see the upside.

Your Answer

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

Browse other questions tagged or ask your own question.