daily pastebin goal
24%
SHARE
TWEET

Untitled

a guest Feb 19th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if (isset($parts[0])) {
  2. $this->data['category_id'] = $parts[0];
  3. } else {
  4. $this->data['category_id'] = 0;
  5. }
  6.  
  7. if (isset($parts[1])) {
  8. $this->data['child_id'] = $parts[1];
  9. } else {
  10. $this->data['child_id'] = 0;
  11. }
  12. //ADDED FOR 2ND LEVEL
  13. if (isset($parts[2])) {
  14. $this->data['sister_id'] = $parts[2];
  15. } else {
  16. $this->data['sister_id'] = 0;
  17. }
  18.  
  19. //DEFINE 2ND LEVEL
  20. $sisters_data = array();
  21.  
  22. $sisters = $this->model_catalog_category->getCategories($child['category_id']);
  23.  
  24. foreach ($sisters as $sister) {
  25. $data = array(
  26.     'filter_category_id'  => $sister['category_id'],
  27.     'filter_sub_category' => true
  28. );      
  29.  
  30. $sisters_data[] = array(
  31.     'category_id' => $sister['category_id'],
  32.     'name'        => $sister['name'],
  33.     'href'        => $this->url->link('product/category', 'path=' .
  34. $category['category_id'] . '_' . $child['category_id'] . '_' . $sister['category_id'])  
  35. );              
  36. }
  37.    
  38. <?php if ($category['children']) { ?>
  39.     <ul>
  40.     <?php foreach ($category['children'] as $child) { ?>
  41.     <li>
  42.     <?php if ($child['category_id'] == $child_id) { ?>
  43.         <a href="<?php echo $child['href']; ?>" class="active"> - <?php echo $child['name']; ?></a>
  44.         <?php } else { ?>
  45.         <a href="<?php echo $child['href']; ?>"> - <?php echo $child['name']; ?></a>
  46.         <?php } ?>
  47.  
  48.     <?php if ($category['sisters']) { ?>
  49.     <ul>
  50.     <?php foreach ($category['sisters'] as $sister) { ?>
  51.         <li>
  52.         <?php if ($sister['category_id'] == $sister_id) { ?>
  53.         <a href="<?php echo $sister['href']; ?>" class="active">  <?php echo $sister['name']; ?></a>
  54.         <?php } else { ?>
  55.         <a href="<?php echo $sister['href']; ?>">  <?php echo $sister['name']; ?></a>
  56.         <?php } ?>
  57.         </li>
  58.     <?php } ?>
  59.     </ul>
  60.     <?php } ?>
  61.         </li>
  62. <?php } ?>
  63. </ul>
  64. <?php } ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top