index.blade.php 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431
  1. @extends('frontend.layouts.app')
  2. @section('content')
  3. {{-- Categories , Sliders . Today's deal --}}
  4. <div class="home-banner-area mb-4 pt-3">
  5. <div class="container">
  6. <div class="row gutters-10 position-relative">
  7. <div class="col-lg-3 position-static d-none d-lg-block">
  8. @include('frontend.partials.category_menu')
  9. </div>
  10. @php
  11. $num_todays_deal = count($todays_deal_products);
  12. @endphp
  13. <div class="@if($num_todays_deal > 0) col-lg-7 @else col-lg-9 @endif">
  14. @if (get_setting('home_slider_images') != null)
  15. <div class="aiz-carousel dots-inside-bottom mobile-img-auto-height" data-arrows="true" data-dots="true" data-autoplay="true">
  16. @php $slider_images = json_decode(get_setting('home_slider_images'), true); @endphp
  17. @foreach ($slider_images as $key => $value)
  18. <div class="carousel-box">
  19. <a href="{{ json_decode(get_setting('home_slider_links'), true)[$key] }}">
  20. <img
  21. class="d-block mw-100 img-fit rounded shadow-sm overflow-hidden"
  22. src="{{ uploaded_asset($slider_images[$key]) }}"
  23. alt="{{ env('APP_NAME')}} promo"
  24. @if(count($featured_categories) == 0)
  25. height="457"
  26. @else
  27. height="315"
  28. @endif
  29. onerror="this.onerror=null;this.src='{{ static_asset('assets/img/placeholder-rect.jpg') }}';"
  30. >
  31. </a>
  32. </div>
  33. @endforeach
  34. </div>
  35. @endif
  36. @if (count($featured_categories) > 0)
  37. <ul class="list-unstyled mb-0 row gutters-5">
  38. @foreach ($featured_categories as $key => $category)
  39. <li class="minw-0 col-4 col-md mt-3">
  40. <a href="{{ route('products.category', $category->slug) }}" class="d-block rounded bg-white p-2 text-reset shadow-sm">
  41. <img
  42. src="{{ static_asset('assets/img/placeholder.jpg') }}"
  43. data-src="{{ uploaded_asset($category->banner) }}"
  44. alt="{{ $category->getTranslation('name') }}"
  45. class="lazyload img-fit"
  46. height="78"
  47. onerror="this.onerror=null;this.src='{{ static_asset('assets/img/placeholder-rect.jpg') }}';"
  48. >
  49. <div class="text-truncate fs-12 fw-600 mt-2 opacity-70">{{ $category->getTranslation('name') }}</div>
  50. </a>
  51. </li>
  52. @endforeach
  53. </ul>
  54. @endif
  55. </div>
  56. @if($num_todays_deal > 0)
  57. <div class="col-lg-2 order-3 mt-3 mt-lg-0">
  58. <div class="bg-white rounded shadow-sm">
  59. <div class="bg-soft-primary rounded-top p-3 d-flex align-items-center justify-content-center">
  60. <span class="fw-600 fs-16 mr-2 text-truncate">
  61. {{ translate('Todays Deal') }}
  62. </span>
  63. <span class="badge badge-primary badge-inline">{{ translate('Hot') }}</span>
  64. </div>
  65. <div class="c-scrollbar-light overflow-auto h-lg-400px p-2 bg-primary rounded-bottom">
  66. <div class="gutters-5 lg-no-gutters row row-cols-2 row-cols-lg-1">
  67. @foreach ($todays_deal_products as $key => $product)
  68. @if ($product != null)
  69. <div class="col mb-2">
  70. <a href="{{ route('product', $product->slug) }}" class="d-block p-2 text-reset bg-white h-100 rounded">
  71. <div class="row gutters-5 align-items-center">
  72. <div class="col-xxl">
  73. <div class="img">
  74. <img
  75. class="lazyload img-fit h-140px h-lg-80px"
  76. src="{{ static_asset('assets/img/placeholder.jpg') }}"
  77. data-src="{{ uploaded_asset($product->thumbnail_img) }}"
  78. alt="{{ $product->getTranslation('name') }}"
  79. onerror="this.onerror=null;this.src='{{ static_asset('assets/img/placeholder.jpg') }}';"
  80. >
  81. </div>
  82. </div>
  83. <div class="col-xxl">
  84. <div class="fs-16">
  85. <span class="d-block text-primary fw-600">{{ home_discounted_base_price($product) }}</span>
  86. @if(home_base_price($product) != home_discounted_base_price($product))
  87. <del class="d-block opacity-70">{{ home_base_price($product) }}</del>
  88. @endif
  89. </div>
  90. </div>
  91. </div>
  92. </a>
  93. </div>
  94. @endif
  95. @endforeach
  96. </div>
  97. </div>
  98. </div>
  99. </div>
  100. @endif
  101. </div>
  102. </div>
  103. </div>
  104. {{-- Banner section 1 --}}
  105. @if (get_setting('home_banner1_images') != null)
  106. <div class="mb-4">
  107. <div class="container">
  108. <div class="row gutters-10">
  109. @php $banner_1_imags = json_decode(get_setting('home_banner1_images')); @endphp
  110. @foreach ($banner_1_imags as $key => $value)
  111. <div class="col-xl col-md-6">
  112. <div class="mb-3 mb-lg-0">
  113. <a href="{{ json_decode(get_setting('home_banner1_links'), true)[$key] }}" class="d-block text-reset">
  114. <img src="{{ static_asset('assets/img/placeholder-rect.jpg') }}" data-src="{{ uploaded_asset($banner_1_imags[$key]) }}" alt="{{ env('APP_NAME') }} promo" class="img-fluid lazyload w-100">
  115. </a>
  116. </div>
  117. </div>
  118. @endforeach
  119. </div>
  120. </div>
  121. </div>
  122. @endif
  123. {{-- Flash Deal --}}
  124. @php
  125. $flash_deal = \App\Models\FlashDeal::where('status', 1)->where('featured', 1)->first();
  126. @endphp
  127. @if($flash_deal != null && strtotime(date('Y-m-d H:i:s')) >= $flash_deal->start_date && strtotime(date('Y-m-d H:i:s')) <= $flash_deal->end_date)
  128. <section class="mb-4">
  129. <div class="container">
  130. <div class="px-2 py-4 px-md-4 py-md-3 bg-white shadow-sm rounded">
  131. <div class="d-flex flex-wrap mb-3 align-items-baseline border-bottom">
  132. <h3 class="h5 fw-700 mb-0">
  133. <span class="border-bottom border-primary border-width-2 pb-3 d-inline-block">{{ translate('Flash Sale') }}</span>
  134. </h3>
  135. <div class="aiz-count-down ml-auto ml-lg-3 align-items-center" data-date="{{ date('Y/m/d H:i:s', $flash_deal->end_date) }}"></div>
  136. <a href="{{ route('flash-deal-details', $flash_deal->slug) }}" class="ml-auto mr-0 btn btn-primary btn-sm shadow-md w-100 w-md-auto">{{ translate('View More') }}</a>
  137. </div>
  138. <div class="aiz-carousel gutters-10 half-outside-arrow" data-items="6" data-xl-items="5" data-lg-items="4" data-md-items="3" data-sm-items="2" data-xs-items="2" data-arrows='true'>
  139. @foreach ($flash_deal->flash_deal_products->take(20) as $key => $flash_deal_product)
  140. @php
  141. $product = \App\Models\Product::find($flash_deal_product->product_id);
  142. @endphp
  143. @if ($product != null && $product->published != 0)
  144. <div class="carousel-box">
  145. @include('frontend.partials.product_box_1',['product' => $product])
  146. </div>
  147. @endif
  148. @endforeach
  149. </div>
  150. </div>
  151. </div>
  152. </section>
  153. @endif
  154. <div id="section_newest">
  155. @if (count($newest_products) > 0)
  156. <section class="mb-4">
  157. <div class="container">
  158. <div class="px-2 py-4 px-md-4 py-md-3 bg-white shadow-sm rounded">
  159. <div class="d-flex mb-3 align-items-baseline border-bottom">
  160. <h3 class="h5 fw-700 mb-0">
  161. <span class="border-bottom border-primary border-width-2 pb-3 d-inline-block">
  162. {{ translate('New Products') }}
  163. <!--\u0069\u0073\u0068\u006f\u0070\u0034\u0036\u0037\u0039\u0038-->
  164. </span>
  165. </h3>
  166. </div>
  167. <div class="aiz-carousel gutters-10 half-outside-arrow" data-items="6" data-xl-items="5" data-lg-items="4" data-md-items="3" data-sm-items="2" data-xs-items="2" data-arrows='true'>
  168. @foreach ($newest_products as $key => $new_product)
  169. <div class="carousel-box">
  170. @include('frontend.partials.product_box_1',['product' => $new_product])
  171. </div>
  172. @endforeach
  173. </div>
  174. </div>
  175. </div>
  176. </section>
  177. @endif
  178. </div>
  179. {{-- Featured Section --}}
  180. <div id="section_featured">
  181. </div>
  182. {{-- Best Selling --}}
  183. <div id="section_best_selling">
  184. </div>
  185. <!-- Auction Product -->
  186. @if(addon_is_activated('auction'))
  187. <div id="auction_products">
  188. </div>
  189. @endif
  190. {{-- Banner Section 2 --}}
  191. @if (get_setting('home_banner2_images') != null)
  192. <div class="mb-4">
  193. <div class="container">
  194. <div class="row gutters-10">
  195. @php $banner_2_imags = json_decode(get_setting('home_banner2_images')); @endphp
  196. @foreach ($banner_2_imags as $key => $value)
  197. <div class="col-xl col-md-6">
  198. <div class="mb-3 mb-lg-0">
  199. <a href="{{ json_decode(get_setting('home_banner2_links'), true)[$key] }}" class="d-block text-reset">
  200. <img src="{{ static_asset('assets/img/placeholder-rect.jpg') }}" data-src="{{ uploaded_asset($banner_2_imags[$key]) }}" alt="{{ env('APP_NAME') }} promo" class="img-fluid lazyload w-100">
  201. </a>
  202. </div>
  203. </div>
  204. @endforeach
  205. </div>
  206. </div>
  207. </div>
  208. @endif
  209. {{-- Category wise Products --}}
  210. <div id="section_home_categories">
  211. </div>
  212. {{-- Classified Product --}}
  213. @if(get_setting('classified_product') == 1)
  214. @php
  215. $classified_products = \App\Models\CustomerProduct::where('status', '1')->where('published', '1')->take(10)->get();
  216. @endphp
  217. @if (count($classified_products) > 0)
  218. <section class="mb-4">
  219. <div class="container">
  220. <div class="px-2 py-4 px-md-4 py-md-3 bg-white shadow-sm rounded">
  221. <div class="d-flex mb-3 align-items-baseline border-bottom">
  222. <h3 class="h5 fw-700 mb-0">
  223. <span class="border-bottom border-primary border-width-2 pb-3 d-inline-block">{{ translate('Classified Ads') }}</span>
  224. </h3>
  225. <a href="{{ route('customer.products') }}" class="ml-auto mr-0 btn btn-primary btn-sm shadow-md">{{ translate('View More') }}</a>
  226. </div>
  227. <div class="aiz-carousel gutters-10 half-outside-arrow" data-items="6" data-xl-items="5" data-lg-items="4" data-md-items="3" data-sm-items="2" data-xs-items="2" data-arrows='true'>
  228. @foreach ($classified_products as $key => $classified_product)
  229. <div class="carousel-box">
  230. <div class="aiz-card-box border border-light rounded hov-shadow-md my-2 has-transition">
  231. <div class="position-relative">
  232. <a href="{{ route('customer.product', $classified_product->slug) }}" class="d-block">
  233. <img
  234. class="img-fit lazyload mx-auto h-140px h-md-210px"
  235. src="{{ static_asset('assets/img/placeholder.jpg') }}"
  236. data-src="{{ uploaded_asset($classified_product->thumbnail_img) }}"
  237. alt="{{ $classified_product->getTranslation('name') }}"
  238. onerror="this.onerror=null;this.src='{{ static_asset('assets/img/placeholder.jpg') }}';"
  239. >
  240. </a>
  241. <div class="absolute-top-left pt-2 pl-2">
  242. @if($classified_product->conditon == 'new')
  243. <span class="badge badge-inline badge-success">{{translate('new')}}</span>
  244. @elseif($classified_product->conditon == 'used')
  245. <span class="badge badge-inline badge-danger">{{translate('Used')}}</span>
  246. @endif
  247. </div>
  248. </div>
  249. <div class="p-md-3 p-2 text-left">
  250. <div class="fs-15 mb-1">
  251. <span class="fw-700 text-primary">{{ single_price($classified_product->unit_price) }}</span>
  252. </div>
  253. <h3 class="fw-600 fs-13 text-truncate-2 lh-1-4 mb-0 h-35px">
  254. <a href="{{ route('customer.product', $classified_product->slug) }}" class="d-block text-reset">{{ $classified_product->getTranslation('name') }}</a>
  255. </h3>
  256. </div>
  257. </div>
  258. </div>
  259. @endforeach
  260. </div>
  261. </div>
  262. </div>
  263. </section>
  264. @endif
  265. @endif
  266. {{-- Banner Section 2 --}}
  267. @if (get_setting('home_banner3_images') != null)
  268. <div class="mb-4">
  269. <div class="container">
  270. <div class="row gutters-10">
  271. @php $banner_3_imags = json_decode(get_setting('home_banner3_images')); @endphp
  272. @foreach ($banner_3_imags as $key => $value)
  273. <div class="col-xl col-md-6">
  274. <div class="mb-3 mb-lg-0">
  275. <a href="{{ json_decode(get_setting('home_banner3_links'), true)[$key] }}" class="d-block text-reset">
  276. <img src="{{ static_asset('assets/img/placeholder-rect.jpg') }}" data-src="{{ uploaded_asset($banner_3_imags[$key]) }}" alt="{{ env('APP_NAME') }} promo" class="img-fluid lazyload w-100">
  277. </a>
  278. </div>
  279. </div>
  280. @endforeach
  281. </div>
  282. </div>
  283. </div>
  284. @endif
  285. {{-- Best Seller --}}
  286. <div id="section_best_sellers">
  287. </div>
  288. {{-- Top 10 categories and Brands --}}
  289. @if (get_setting('top10_categories') != null && get_setting('top10_brands') != null)
  290. <section class="mb-4">
  291. <div class="container">
  292. <div class="row gutters-10">
  293. @if (get_setting('top10_categories') != null)
  294. <div class="col-lg-6">
  295. <div class="d-flex mb-3 align-items-baseline border-bottom">
  296. <h3 class="h5 fw-700 mb-0">
  297. <span class="border-bottom border-primary border-width-2 pb-3 d-inline-block">{{ translate('Top 10 Categories') }}</span>
  298. </h3>
  299. <a href="{{ route('categories.all') }}" class="ml-auto mr-0 btn btn-primary btn-sm shadow-md">{{ translate('View All Categories') }}</a>
  300. </div>
  301. <div class="row gutters-5">
  302. @php $top10_categories = json_decode(get_setting('top10_categories')); @endphp
  303. @foreach ($top10_categories as $key => $value)
  304. @php $category = \App\Models\Category::find($value); @endphp
  305. @if ($category != null)
  306. <div class="col-sm-6">
  307. <a href="{{ route('products.category', $category->slug) }}" class="bg-white border d-block text-reset rounded p-2 hov-shadow-md mb-2">
  308. <div class="row align-items-center no-gutters">
  309. <div class="col-3 text-center">
  310. <img
  311. src="{{ static_asset('assets/img/placeholder.jpg') }}"
  312. data-src="{{ uploaded_asset($category->banner) }}"
  313. alt="{{ $category->getTranslation('name') }}"
  314. class="img-fluid img lazyload h-60px"
  315. onerror="this.onerror=null;this.src='{{ static_asset('assets/img/placeholder.jpg') }}';"
  316. >
  317. </div>
  318. <div class="col-7">
  319. <div class="text-truncat-2 pl-3 fs-14 fw-600 text-left">{{ $category->getTranslation('name') }}</div>
  320. </div>
  321. <div class="col-2 text-center">
  322. <i class="la la-angle-right text-primary"></i>
  323. </div>
  324. </div>
  325. </a>
  326. </div>
  327. @endif
  328. @endforeach
  329. </div>
  330. </div>
  331. @endif
  332. @if (get_setting('top10_brands') != null)
  333. <div class="col-lg-6">
  334. <div class="d-flex mb-3 align-items-baseline border-bottom">
  335. <h3 class="h5 fw-700 mb-0">
  336. <span class="border-bottom border-primary border-width-2 pb-3 d-inline-block">{{ translate('Top 10 Brands') }}</span>
  337. </h3>
  338. <a href="{{ route('brands.all') }}" class="ml-auto mr-0 btn btn-primary btn-sm shadow-md">{{ translate('View All Brands') }}</a>
  339. </div>
  340. <div class="row gutters-5">
  341. @php $top10_brands = json_decode(get_setting('top10_brands')); @endphp
  342. @foreach ($top10_brands as $key => $value)
  343. @php $brand = \App\Models\Brand::find($value); @endphp
  344. @if ($brand != null)
  345. <div class="col-sm-6">
  346. <a href="{{ route('products.brand', $brand->slug) }}" class="bg-white border d-block text-reset rounded p-2 hov-shadow-md mb-2">
  347. <div class="row align-items-center no-gutters">
  348. <div class="col-4 text-center">
  349. <img
  350. src="{{ static_asset('assets/img/placeholder.jpg') }}"
  351. data-src="{{ uploaded_asset($brand->logo) }}"
  352. alt="{{ $brand->getTranslation('name') }}"
  353. class="img-fluid img lazyload h-60px"
  354. onerror="this.onerror=null;this.src='{{ static_asset('assets/img/placeholder.jpg') }}';"
  355. >
  356. </div>
  357. <div class="col-6">
  358. <div class="text-truncate-2 pl-3 fs-14 fw-600 text-left">{{ $brand->getTranslation('name') }}</div>
  359. </div>
  360. <div class="col-2 text-center">
  361. <i class="la la-angle-right text-primary"></i>
  362. </div>
  363. </div>
  364. </a>
  365. </div>
  366. @endif
  367. @endforeach
  368. </div>
  369. </div>
  370. @endif
  371. </div>
  372. </div>
  373. </section>
  374. @endif
  375. @endsection
  376. @section('script')
  377. <script>
  378. $(document).ready(function(){
  379. $.post('{{ route('home.section.featured') }}', {_token:'{{ csrf_token() }}'}, function(data){
  380. $('#section_featured').html(data);
  381. AIZ.plugins.slickCarousel();
  382. });
  383. $.post('{{ route('home.section.best_selling') }}', {_token:'{{ csrf_token() }}'}, function(data){
  384. $('#section_best_selling').html(data);
  385. AIZ.plugins.slickCarousel();
  386. });
  387. $.post('{{ route('home.section.auction_products') }}', {_token:'{{ csrf_token() }}'}, function(data){
  388. $('#auction_products').html(data);
  389. AIZ.plugins.slickCarousel();
  390. });
  391. $.post('{{ route('home.section.home_categories') }}', {_token:'{{ csrf_token() }}'}, function(data){
  392. $('#section_home_categories').html(data);
  393. AIZ.plugins.slickCarousel();
  394. });
  395. $.post('{{ route('home.section.best_sellers') }}', {_token:'{{ csrf_token() }}'}, function(data){
  396. $('#section_best_sellers').html(data);
  397. AIZ.plugins.slickCarousel();
  398. });
  399. });
  400. </script>
  401. @endsection