Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (isset($parts[0])) {
- $this->data['category_id'] = $parts[0];
- } else {
- $this->data['category_id'] = 0;
- }
- if (isset($parts[1])) {
- $this->data['child_id'] = $parts[1];
- } else {
- $this->data['child_id'] = 0;
- }
- //ADDED FOR 2ND LEVEL
- if (isset($parts[2])) {
- $this->data['sister_id'] = $parts[2];
- } else {
- $this->data['sister_id'] = 0;
- }
- //DEFINE 2ND LEVEL
- $sisters_data = array();
- $sisters = $this->model_catalog_category->getCategories($child['category_id']);
- foreach ($sisters as $sister) {
- $data = array(
- 'filter_category_id' => $sister['category_id'],
- 'filter_sub_category' => true
- );
- $sisters_data[] = array(
- 'category_id' => $sister['category_id'],
- 'name' => $sister['name'],
- 'href' => $this->url->link('product/category', 'path=' .
- $category['category_id'] . '_' . $child['category_id'] . '_' . $sister['category_id'])
- );
- }
- <?php if ($category['children']) { ?>
- <ul>
- <?php foreach ($category['children'] as $child) { ?>
- <li>
- <?php if ($child['category_id'] == $child_id) { ?>
- <a href="<?php echo $child['href']; ?>" class="active"> - <?php echo $child['name']; ?></a>
- <?php } else { ?>
- <a href="<?php echo $child['href']; ?>"> - <?php echo $child['name']; ?></a>
- <?php } ?>
- <?php if ($category['sisters']) { ?>
- <ul>
- <?php foreach ($category['sisters'] as $sister) { ?>
- <li>
- <?php if ($sister['category_id'] == $sister_id) { ?>
- <a href="<?php echo $sister['href']; ?>" class="active"> <?php echo $sister['name']; ?></a>
- <?php } else { ?>
- <a href="<?php echo $sister['href']; ?>"> <?php echo $sister['name']; ?></a>
- <?php } ?>
- </li>
- <?php } ?>
- </ul>
- <?php } ?>
- </li>
- <?php } ?>
- </ul>
- <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement