This is my previous question: How to convert a decimal $attribute['text']; into a fraction in opencart
I have a helper function that is declared in startup.php
and defined in helper/dec2frac.php
I am trying to call the helper function from a category.tpl
file with this code:
<?php if ($product['attribute_groups']) { ?>
<?php foreach ($product['attribute_groups'] as $attribute_group) { ?>
<?php foreach ($attribute_group['attribute'] as $attribute) { ?>
<?php /*var_dump($attribute);*/
if($attribute['name'] == "Adjuster Position")
{
//echo("<h1>HELLLO</h1>");
dec2frac($attribute['text']);
}
?>
...but I am getting this error message:
Fatal error: Call to undefined function dec2frac() in startup.php helper/dec2frac.php
How can I call my helper function in the category.tpl
file?
Do I need to reference the helper function in my category.php
file?