[eluser]LuckyFella73[/eluser]
You could build an array containing all needed informations
in your model. In your model get all rows of a category, send
the result to a method of your model that formats the result
and add the info "free" or not and then send the complete result
array to your controller and from controller to your view.
That way you have everything at one place (regarding your issue).
[EDIT]
Could look like this (not tested):
Code:
// MODEL:
function getCatalog($catId)
{
// your query here
$query = $this->db->query("YOUR QUERY");
return $this->format_result($query);
}
private function format_result($query)
{
$result = array();
foreach ($query->result_array() as $row)
{
$result['title_or_whatever'][] = $row['title_or_whatever']; // I guess you have more infos then delivery from db
if ($row['delivery'] > 0)
{
$result['delivery'][] = $row['delivery'].'%';
}
else
{
$result['delivery'][] = 'Free!';
}
}
return $result;
}