index.phtml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <?php
  2. /**
  3. * @version 7.4
  4. */
  5. /* @var int $parentId */
  6. /* @var int $itemsPerPage */
  7. /* @var int|null $storeId */
  8. $storeId = (isset($storeId)) ? $storeId : null;
  9. ?>
  10. <!-- start - container -->
  11. <div id="browse">
  12. <div class="row row-offcanvas row-offcanvas-left">
  13. <!-- start - side bar -->
  14. <aside class="col-md-3 col-xs-12 sidebar-offcanvas">
  15. <div class="filter-results"><?php echo $this->_('Filter Results'); ?></div>
  16. <?php echo $this->basicSearchForm; ?>
  17. </aside>
  18. <!-- end - side bar -->
  19. <!-- start - content -->
  20. <section class="col-md-9 col-xs-12">
  21. <div class="row browse-title">
  22. <div class="col-xs-2 col-sm-1 hidden-md hidden-lg">
  23. <button class="btn btn-default" data-toggle="offcanvas" type="button">
  24. <i class="fa fa-2x fa-list"></i>
  25. </button>
  26. </div>
  27. <div class="col-xs-10 col-sm-11 col-md-12">
  28. <?php if ($storeId) { ?>
  29. <h2 class="section-title"><?php echo $browsePageTitle; ?></h2>
  30. <?php
  31. }
  32. else {
  33. ?>
  34. <h1 class="section-title"><?php echo $browsePageTitle; ?></h1>
  35. <?php } ?>
  36. </div>
  37. </div>
  38. <div class="clearfix"></div>
  39. <?php if ($parentId) { ?>
  40. <?php $featuredItemsContent = $this->action('listings', 'browse', 'listings', array('type' => 'categories', 'parent_id' => $parentId, 'limit' => 4)); ?>
  41. <?php if (!empty($featuredItemsContent)) { ?>
  42. <!-- start - category featured listings -->
  43. <div class="featured">
  44. <h2><?php echo $this->_('Featured Items'); ?></h2>
  45. <?php echo $featuredItemsContent; ?>
  46. </div>
  47. <!-- end - category featured listings -->
  48. <?php } ?>
  49. <?php } ?>
  50. <?php if ($this->paginator->getPages()->totalItemCount) { ?>
  51. <!-- start - ordering/display options -->
  52. <div class="row">
  53. <div class="view-switch col-sm-2 col-xs-12">
  54. <a href="#" id="list"
  55. title="<?php echo $this->_('List View'); ?>"><?php echo $this->_('List view'); ?></a>
  56. <a href="#" id="grid"
  57. title="<?php echo $this->_('Grid View'); ?>"><?php echo $this->_('Grid view'); ?></a>
  58. </div>
  59. <div class="col-sm-6 col-xs-12">
  60. <strong><?php echo $this->paginator->getPages()->totalItemCount; ?></strong> <?php echo $this->_('listings found.'); ?>
  61. <?php if ($this->paginator->getPages()->totalItemCount) { ?>
  62. <?php echo $this->_('Showing results'); ?>
  63. <strong><?php echo $this->paginator->getPages()->firstItemNumber; ?></strong>
  64. <?php echo $this->_('to'); ?>
  65. <strong><?php echo $this->paginator->getPages()->lastItemNumber; ?></strong>.
  66. <?php } ?>
  67. </div>
  68. <div class="col-sm-4 col-xs-12">
  69. <?php
  70. $sortOptions = array(
  71. 'relevance' => $this->_('Relevance'),
  72. 'price_asc' => $this->_('Price Low to High'),
  73. 'price_desc' => $this->_('Price High to Low'),
  74. 'started_desc' => $this->_('Recently Listed'),
  75. 'ending_asc' => $this->_('Ending Soon')
  76. );
  77. $sort = (isset($params['sort'])) ? $params['sort'] : 'relevance';
  78. ?>
  79. <div class="btn-group pull-right">
  80. <button
  81. class="btn btn-default"><?php echo (array_key_exists($sort, $sortOptions)) ? $sortOptions[$sort] : $this->_('Sort By'); ?></button>
  82. <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
  83. <span class="caret"></span>
  84. </button>
  85. <ul class="dropdown-menu text-left">
  86. <?php foreach ($sortOptions as $key => $value) { ?>
  87. <li>
  88. <a href="<?php echo $this->url(array('sort' => $key), null, true); ?>"><?php echo $value; ?></a>
  89. </li>
  90. <?php } ?>
  91. </ul>
  92. </div>
  93. </div>
  94. </div>
  95. <!-- end - ordering/display options -->
  96. <div class="clearfix"></div>
  97. <!-- start - listings display -->
  98. <div class="listings">
  99. <?php
  100. /** @var \Ppb\Db\Table\Row\Listing $listing */
  101. foreach ($this->paginator as $listing) {
  102. echo $this->partial('partials/listing-box.phtml', array(
  103. 'listing' => $listing));
  104. } ?>
  105. </div>
  106. <!-- end - listings display -->
  107. <div class="clearfix"></div>
  108. <?php } ?>
  109. <!-- start - paginate -->
  110. <div>
  111. <?php if (!$this->paginator->getPages()->totalItemCount) { ?>
  112. <div class="no-results">
  113. <?php echo $this->_('There are no listings matching your query.'); ?>
  114. </div>
  115. <?php
  116. }
  117. else {
  118. ?>
  119. <div class="pull-left">
  120. <?php echo $this->partial('partials/items-per-page.phtml', array('itemsPerPage' => $itemsPerPage)); ?>
  121. </div>
  122. <?php } ?>
  123. <div class="pull-right">
  124. <?php echo $this->pagination($this->paginator, 'sliding', 'partials/pagination.phtml'); ?>
  125. </div>
  126. </div>
  127. <!-- end - paginate -->
  128. </section>
  129. <!-- end - content -->
  130. </div>
  131. </div>
  132. <!-- end - container -->