Is it possible to use a small function without creating an entire module to use a helper? I don't have a lot of experience with that, and I would prefer if I could just use the function without having to do all that.
For example this answer:
Do I have to create a module to use that function in a phtml file?
public function getCustomMenuCategory($categoryId) {
try {
$categoryChild = Mage::getModel('catalog/category')->load($categoryId)->getChildrenCategories();
if (count($categoryChild) > 0) {
return $categoryChild;
} else {
$parentcategories = Mage::getModel('catalog/category')->load($categoryId)->getParentCategory()->getChildrenCategories();
return $parentcategories;
}
}
} catch (Exception $ex) {
Mage::log($ex, null, 'subcategory.log');
}
}
^ that is what I want to use in a phtml file.