I want to get category names as select box in my custom module file discount.php which creates display in backoffice. I am calling the function $cat = CategoryCore::getCategories();
from category.php
now when I var_dump($cat);
I am getting array but I am not sure how will I get the names only.
Is there any other way to get category names?
Try:
$categories = Category::getCategories($this->context->language->id);
foreach ($categories as $category)
echo $category['name'];