menu.php 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. /**
  3. * FecShop file.
  4. *
  5. * @link http://www.fecshop.com/
  6. * @copyright Copyright (c) 2016 FecShop Software LLC
  7. * @license http://www.fecshop.com/license/
  8. */
  9. ?>
  10. <?php
  11. $max_first_level_category_count = 6;
  12. ?>
  13. <div class="navigation-menu">
  14. <div class="container">
  15. <div class="row align-items-center justify-content-between">
  16. <div class="col-12 col-lg-12">
  17. <!-- navigation section -->
  18. <div class="main-menu">
  19. <nav>
  20. <ul>
  21. <?php if(is_array($categoryArr) && !empty($categoryArr)): ?>
  22. <?php $i = 0; ?>
  23. <?php foreach($categoryArr as $category1): ?>
  24. <?php $i++; $hidden='';?>
  25. <?php if ($i > $max_first_level_category_count) { $hidden='hidden'; } ?>
  26. <?php if(isset($category1['childMenu']) && is_array($category1['childMenu']) && !empty($category1['childMenu'])): ?>
  27. <li class="menu-item-has-children">
  28. <?php else: ?>
  29. <li class="<?= $hidden ?>">
  30. <?php endif; ?>
  31. <a href="<?= $category1['url'] ?>"><?= $category1['name'] ?></a>
  32. <?php $childMenu1 = $category1['childMenu']; ?>
  33. <?php if(is_array($childMenu1) && !empty($childMenu1)): ?>
  34. <div class="sub-menu">
  35. <?php foreach($childMenu1 as $category2): ?>
  36. <div class="menu2"><a href="<?= $category2['url'] ?>"><?= $category2['name'] ?></a>
  37. <?php $childMenu2 = $category2['childMenu']; ?>
  38. <?php if(is_array($childMenu2) && !empty($childMenu2)): ?>
  39. <ul>
  40. <?php foreach($childMenu2 as $category3): ?>
  41. <li class="item-content">
  42. <div class="item-title"><a href="<?= $category3['url'] ?>" external>&nbsp;&nbsp;<?= $category3['name'] ?></a></div>
  43. </li>
  44. <?php endforeach; ?>
  45. </ul>
  46. <?php endif; ?>
  47. </div>
  48. <?php endforeach; ?>
  49. </div>
  50. <?php endif; ?>
  51. </li>
  52. <?php endforeach; ?>
  53. <?php endif; ?>
  54. </ul>
  55. </nav>
  56. </div>
  57. <!-- end of navigation section -->
  58. </div>
  59. <div class="col-12 col-lg-3">
  60. <!--======= navigation search bar =======-->
  61. <!--======= End of navigation search bar =======-->
  62. </div>
  63. <div class="col-12 d-block d-lg-none">
  64. <!-- Mobile Menu -->
  65. <div class="mobile-menu"></div>
  66. </div>
  67. </div>
  68. </div>
  69. </div>