0b43e1121c17b8d8c7c3614eeb421ec76dbee8d1.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. <?php if(isset($category_id)): ?>
  2. <?php
  3. $meta_title = \App\Models\Category::find($category_id)->meta_title;
  4. $meta_description = \App\Models\Category::find($category_id)->meta_description;
  5. ?>
  6. <?php elseif(isset($brand_id)): ?>
  7. <?php
  8. $meta_title = \App\Models\Brand::find($brand_id)->meta_title;
  9. $meta_description = \App\Models\Brand::find($brand_id)->meta_description;
  10. ?>
  11. <?php else: ?>
  12. <?php
  13. $meta_title = get_setting('meta_title');
  14. $meta_description = get_setting('meta_description');
  15. ?>
  16. <?php endif; ?>
  17. <?php $__env->startSection('meta_title'); ?><?php echo e($meta_title); ?><?php $__env->stopSection(); ?>
  18. <?php $__env->startSection('meta_description'); ?><?php echo e($meta_description); ?><?php $__env->stopSection(); ?>
  19. <?php $__env->startSection('meta'); ?>
  20. <!-- Schema.org markup for Google+ -->
  21. <meta itemprop="name" content="<?php echo e($meta_title); ?>">
  22. <meta itemprop="description" content="<?php echo e($meta_description); ?>">
  23. <!-- Twitter Card data -->
  24. <meta name="twitter:title" content="<?php echo e($meta_title); ?>">
  25. <meta name="twitter:description" content="<?php echo e($meta_description); ?>">
  26. <!-- Open Graph data -->
  27. <meta property="og:title" content="<?php echo e($meta_title); ?>" />
  28. <meta property="og:description" content="<?php echo e($meta_description); ?>" />
  29. <?php $__env->stopSection(); ?>
  30. <?php $__env->startSection('content'); ?>
  31. <section class="mb-4 pt-3">
  32. <div class="container sm-px-0">
  33. <form class="" id="search-form" action="" method="GET">
  34. <div class="row">
  35. <div class="col-xl-3">
  36. <div class="aiz-filter-sidebar collapse-sidebar-wrap sidebar-xl sidebar-right z-1035">
  37. <div class="overlay overlay-fixed dark c-pointer" data-toggle="class-toggle" data-target=".aiz-filter-sidebar" data-same=".filter-sidebar-thumb"></div>
  38. <div class="collapse-sidebar c-scrollbar-light text-left">
  39. <div class="d-flex d-xl-none justify-content-between align-items-center pl-3 border-bottom">
  40. <h3 class="h6 mb-0 fw-600"><?php echo e(translate('Filters')); ?></h3>
  41. <button type="button" class="btn btn-sm p-2 filter-sidebar-thumb" data-toggle="class-toggle" data-target=".aiz-filter-sidebar" >
  42. <i class="las la-times la-2x"></i>
  43. </button>
  44. </div>
  45. <div class="bg-white shadow-sm rounded mb-3">
  46. <div class="fs-15 fw-600 p-3 border-bottom">
  47. <?php echo e(translate('Categories')); ?>
  48. </div>
  49. <div class="p-3">
  50. <ul class="list-unstyled">
  51. <?php if(!isset($category_id)): ?>
  52. <?php $__currentLoopData = \App\Models\Category::where('level', 0)->get(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
  53. <li class="mb-2 ml-2">
  54. <a class="text-reset fs-14" href="<?php echo e(route('products.category', $category->slug)); ?>"><?php echo e($category->getTranslation('name')); ?></a>
  55. </li>
  56. <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
  57. <?php else: ?>
  58. <li class="mb-2">
  59. <a class="text-reset fs-14 fw-600" href="<?php echo e(route('search')); ?>">
  60. <i class="las la-angle-left"></i>
  61. <?php echo e(translate('All Categories')); ?>
  62. </a>
  63. </li>
  64. <?php if(\App\Models\Category::find($category_id)->parent_id != 0): ?>
  65. <li class="mb-2">
  66. <a class="text-reset fs-14 fw-600" href="<?php echo e(route('products.category', \App\Models\Category::find(\App\Models\Category::find($category_id)->parent_id)->slug)); ?>">
  67. <i class="las la-angle-left"></i>
  68. <?php echo e(\App\Models\Category::find(\App\Models\Category::find($category_id)->parent_id)->getTranslation('name')); ?>
  69. </a>
  70. </li>
  71. <?php endif; ?>
  72. <li class="mb-2">
  73. <a class="text-reset fs-14 fw-600" href="<?php echo e(route('products.category', \App\Models\Category::find($category_id)->slug)); ?>">
  74. <i class="las la-angle-left"></i>
  75. <?php echo e(\App\Models\Category::find($category_id)->getTranslation('name')); ?>
  76. </a>
  77. </li>
  78. <?php $__currentLoopData = \App\Utility\CategoryUtility::get_immediate_children_ids($category_id); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $id): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
  79. <li class="ml-4 mb-2">
  80. <a class="text-reset fs-14" href="<?php echo e(route('products.category', \App\Models\Category::find($id)->slug)); ?>"><?php echo e(\App\Models\Category::find($id)->getTranslation('name')); ?></a>
  81. </li>
  82. <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
  83. <?php endif; ?>
  84. </ul>
  85. </div>
  86. </div>
  87. <div class="bg-white shadow-sm rounded mb-3">
  88. <div class="fs-15 fw-600 p-3 border-bottom">
  89. <?php echo e(translate('Price range')); ?>
  90. </div>
  91. <div class="p-3">
  92. <div class="aiz-range-slider">
  93. <div
  94. id="input-slider-range"
  95. data-range-value-min="<?php if(\App\Models\Product::count() < 1): ?> 0 <?php else: ?> <?php echo e(\App\Models\Product::min('unit_price')); ?> <?php endif; ?>"
  96. data-range-value-max="<?php if(\App\Models\Product::count() < 1): ?> 0 <?php else: ?> <?php echo e(\App\Models\Product::max('unit_price')); ?> <?php endif; ?>"
  97. ></div>
  98. <div class="row mt-2">
  99. <div class="col-6">
  100. <span class="range-slider-value value-low fs-14 fw-600 opacity-70"
  101. <?php if(isset($min_price)): ?>
  102. data-range-value-low="<?php echo e($min_price); ?>"
  103. <?php elseif($products->min('unit_price') > 0): ?>
  104. data-range-value-low="<?php echo e($products->min('unit_price')); ?>"
  105. <?php else: ?>
  106. data-range-value-low="0"
  107. <?php endif; ?>
  108. id="input-slider-range-value-low"
  109. ></span>
  110. </div>
  111. <div class="col-6 text-right">
  112. <span class="range-slider-value value-high fs-14 fw-600 opacity-70"
  113. <?php if(isset($max_price)): ?>
  114. data-range-value-high="<?php echo e($max_price); ?>"
  115. <?php elseif($products->max('unit_price') > 0): ?>
  116. data-range-value-high="<?php echo e($products->max('unit_price')); ?>"
  117. <?php else: ?>
  118. data-range-value-high="0"
  119. <?php endif; ?>
  120. id="input-slider-range-value-high"
  121. ></span>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. </div>
  127. <?php $__currentLoopData = $attributes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $attribute): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
  128. <div class="bg-white shadow-sm rounded mb-3">
  129. <div class="fs-15 fw-600 p-3 border-bottom">
  130. <?php echo e(translate('Filter by')); ?> <?php echo e($attribute->getTranslation('name')); ?>
  131. </div>
  132. <div class="p-3">
  133. <div class="aiz-checkbox-list">
  134. <?php $__currentLoopData = $attribute->attribute_values; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $attribute_value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
  135. <label class="aiz-checkbox">
  136. <input
  137. type="checkbox"
  138. name="selected_attribute_values[]"
  139. value="<?php echo e($attribute_value->value); ?>" <?php if(in_array($attribute_value->value, $selected_attribute_values)): ?> checked <?php endif; ?>
  140. onchange="filter()"
  141. >
  142. <span class="aiz-square-check"></span>
  143. <span><?php echo e($attribute_value->value); ?></span>
  144. </label>
  145. <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
  146. </div>
  147. </div>
  148. </div>
  149. <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
  150. <?php if(get_setting('color_filter_activation')): ?>
  151. <div class="bg-white shadow-sm rounded mb-3">
  152. <div class="fs-15 fw-600 p-3 border-bottom">
  153. <?php echo e(translate('Filter by color')); ?>
  154. </div>
  155. <div class="p-3">
  156. <div class="aiz-radio-inline">
  157. <?php $__currentLoopData = $colors; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $color): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
  158. <label class="aiz-megabox pl-0 mr-2" data-toggle="tooltip" data-title="<?php echo e($color->name); ?>">
  159. <input
  160. type="radio"
  161. name="color"
  162. value="<?php echo e($color->code); ?>"
  163. onchange="filter()"
  164. <?php if(isset($selected_color) && $selected_color == $color->code): ?> checked <?php endif; ?>
  165. >
  166. <span class="aiz-megabox-elem rounded d-flex align-items-center justify-content-center p-1 mb-2">
  167. <span class="size-30px d-inline-block rounded" style="background: <?php echo e($color->code); ?>;"></span>
  168. </span>
  169. </label>
  170. <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
  171. </div>
  172. </div>
  173. </div>
  174. <?php endif; ?>
  175. </div>
  176. </div>
  177. </div>
  178. <div class="col-xl-9">
  179. <ul class="breadcrumb bg-transparent p-0">
  180. <li class="breadcrumb-item opacity-50">
  181. <a class="text-reset" href="<?php echo e(route('home')); ?>"><?php echo e(translate('Home')); ?></a>
  182. </li>
  183. <?php if(!isset($category_id)): ?>
  184. <li class="breadcrumb-item fw-600 text-dark">
  185. <a class="text-reset" href="<?php echo e(route('search')); ?>">"<?php echo e(translate('All Categories')); ?>"</a>
  186. </li>
  187. <?php else: ?>
  188. <li class="breadcrumb-item opacity-50">
  189. <a class="text-reset" href="<?php echo e(route('search')); ?>"><?php echo e(translate('All Categories')); ?></a>
  190. </li>
  191. <?php endif; ?>
  192. <?php if(isset($category_id)): ?>
  193. <li class="text-dark fw-600 breadcrumb-item">
  194. <a class="text-reset" href="<?php echo e(route('products.category', \App\Models\Category::find($category_id)->slug)); ?>">"<?php echo e(\App\Models\Category::find($category_id)->getTranslation('name')); ?>"</a>
  195. </li>
  196. <?php endif; ?>
  197. </ul>
  198. <div class="text-left">
  199. <div class="row gutters-5 flex-wrap align-items-center">
  200. <div class="col-lg col-10">
  201. <h1 class="h6 fw-600 text-body">
  202. <?php if(isset($category_id)): ?>
  203. <?php echo e(\App\Models\Category::find($category_id)->getTranslation('name')); ?>
  204. <?php elseif(isset($query)): ?>
  205. <?php echo e(translate('Search result for ')); ?>"<?php echo e($query); ?>"
  206. <?php else: ?>
  207. <?php echo e(translate('All Products')); ?>
  208. <?php endif; ?>
  209. </h1>
  210. <input type="hidden" name="keyword" value="<?php echo e($query); ?>">
  211. </div>
  212. <div class="col-2 col-lg-auto d-xl-none mb-lg-3 text-right">
  213. <button type="button" class="btn btn-icon p-0" data-toggle="class-toggle" data-target=".aiz-filter-sidebar">
  214. <i class="la la-filter la-2x"></i>
  215. </button>
  216. </div>
  217. <div class="col-6 col-lg-auto mb-3 w-lg-200px">
  218. <?php if(Route::currentRouteName() != 'products.brand'): ?>
  219. <label class="mb-0 opacity-50"><?php echo e(translate('Brands')); ?></label>
  220. <select class="form-control form-control-sm aiz-selectpicker" data-live-search="true" name="brand" onchange="filter()">
  221. <option value=""><?php echo e(translate('All Brands')); ?></option>
  222. <?php $__currentLoopData = \App\Models\Brand::all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $brand): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
  223. <option value="<?php echo e($brand->slug); ?>" <?php if(isset($brand_id)): ?> <?php if($brand_id == $brand->id): ?> selected <?php endif; ?> <?php endif; ?>><?php echo e($brand->getTranslation('name')); ?></option>
  224. <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
  225. </select>
  226. <?php endif; ?>
  227. </div>
  228. <div class="col-6 col-lg-auto mb-3 w-lg-200px">
  229. <label class="mb-0 opacity-50"><?php echo e(translate('Sort by')); ?></label>
  230. <select class="form-control form-control-sm aiz-selectpicker" name="sort_by" onchange="filter()">
  231. <option value="newest" <?php if(isset($sort_by)): ?> <?php if($sort_by == 'newest'): ?> selected <?php endif; ?> <?php endif; ?>><?php echo e(translate('Newest')); ?></option>
  232. <option value="oldest" <?php if(isset($sort_by)): ?> <?php if($sort_by == 'oldest'): ?> selected <?php endif; ?> <?php endif; ?>><?php echo e(translate('Oldest')); ?></option>
  233. <option value="price-asc" <?php if(isset($sort_by)): ?> <?php if($sort_by == 'price-asc'): ?> selected <?php endif; ?> <?php endif; ?>><?php echo e(translate('Price low to high')); ?></option>
  234. <option value="price-desc" <?php if(isset($sort_by)): ?> <?php if($sort_by == 'price-desc'): ?> selected <?php endif; ?> <?php endif; ?>><?php echo e(translate('Price high to low')); ?></option>
  235. </select>
  236. </div>
  237. </div>
  238. </div>
  239. <input type="hidden" name="min_price" value="">
  240. <input type="hidden" name="max_price" value="">
  241. <div class="row gutters-5 row-cols-xxl-4 row-cols-xl-3 row-cols-lg-4 row-cols-md-3 row-cols-2">
  242. <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
  243. <div class="col">
  244. <?php echo $__env->make('frontend.partials.product_box_1',['product' => $product], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
  245. </div>
  246. <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
  247. </div>
  248. <div class="aiz-pagination aiz-pagination-center mt-4">
  249. <?php echo e($products->appends(request()->input())->links()); ?>
  250. </div>
  251. </div>
  252. </div>
  253. </form>
  254. </div>
  255. </section>
  256. <?php $__env->stopSection(); ?>
  257. <?php $__env->startSection('script'); ?>
  258. <script type="text/javascript">
  259. function filter(){
  260. $('#search-form').submit();
  261. }
  262. function rangefilter(arg){
  263. $('input[name=min_price]').val(arg[0]);
  264. $('input[name=max_price]').val(arg[1]);
  265. filter();
  266. }
  267. </script>
  268. <?php $__env->stopSection(); ?>
  269. <?php echo $__env->make('frontend.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /Users/shaoguo/Desktop/公司资料/小梦/商城/ebayShop/resources/views/frontend/product_listing.blade.php ENDPATH**/ ?>