2

I want to show the category-listing on a custom module-page.
For example: [url]/brandstore/index/listing/brand/1/category/10

I tried to copy the content of the catalog_category_view.xml to my custom brandstore_index_listing.xml but i get an exception because the current_category is not defined in the registry.

Any suggestion for this issue?

2
  • Your brandstore module has its own block, controller, model? Commented Sep 12, 2016 at 16:01
  • Yes, it is a custom module with blocks, controllers and models
    – Cenzo
    Commented Sep 13, 2016 at 6:58

1 Answer 1

3

Ok, I think I got a solution.

In my custom Block, I extend the Core Block

\Magento\Catalog\Block\Category\View

And in the construct before calling the parent construct I set the current_category to my custom category.

If someone needs more details, let me know.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.