1
vote
Accepted
Get product categories not using ObjectManager
There are multiple ways to create the class but it also depends where you will use it. like
Case1:
If you want to the use the class in phtml file then you can create the Block or viewModels class.
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
category-products × 560magento2 × 188
category × 134
magento-1.9 × 122
product × 58
products × 43
product-collection × 28
magento2.3 × 26
magento-2.1 × 24
category-tree × 23
collection × 22
catalog × 22
magento-1.7 × 19
product-list × 18
category-listing × 18
sorting × 17
attributes × 14
product-attribute × 14
database × 13
layered-navigation × 12
filter × 12
php × 11
magento-1 × 11
magento2.4 × 11
magento-1.8 × 10