/ Published in: PHP
                    
                                        
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
<?php
$top_cat_id = '';
$path = $this->request->get['path'];
$top_cat_id = $cat_array[0];
}
$this->load->model('tool/seo_url');
$results = $this->model_catalog_category->getCategories();
if ($results) {
$output = '<ul>';
}
foreach ($results as $result) {
$new_path = $result['category_id'];
$unrewritten = HTTP_SERVER.'index.php?route=product/category&path=' . $new_path;
$rewritten = $this->model_tool_seo_url->rewrite($unrewritten);
if ($new_path == $top_cat_id) {
$output .= '<li id="current-cat"><a href="'.str_replace('&', '&', $rewritten).'">'.$result['name'].'</a>';
} else {
}
$output .= '</li>';
}
if ($results) {
$output .= '</ul>';
}
echo $output;
?>
Comments
 Subscribe to comments
                    Subscribe to comments
                
                