The $rows variable is a string it contains parsed markup, so it's a bit late to work with it, you should start a little sooner to get the values. The variable $category contains all category data, which you can display as follows:
If you want to access a category value, you can do it this way:
To check if the previous category contains a different 'group' value you could extend your foreach loop as follows:
PHP Code:
private function renderFrontendCategoryList() {
...
if(isset($result['total']) && $result['total'] > 0 && !empty($result['categories'])) {
foreach($result['categories'] as $category) {
...
Util::preformat($category);
...
If you want to access a category value, you can do it this way:
PHP Code:
...
$category->field_name
...
To check if the previous category contains a different 'group' value you could extend your foreach loop as follows:
PHP Code:
...
foreach($result['categories'] as $key => $category) {
...
$replace['group'] = '';
if(isset($result['categories'][$key-1]) && $result['categories'][$key-1]->group != $category->group) {
$replace['group'] = $category->group; // where $replace['group'] is the placeholder name in your template
}
...