I'd like to list all first level categories from inside my custom block. I'd like to get the category names and the URLs.
How can I achieve this?
blockscategorymagento2
I'd like to list all first level categories from inside my custom block. I'd like to get the category names and the URLs.
How can I achieve this?
Best Answer
Try:
Where $storeId is your current store id. You can get it by
[Update]
Sample block class: