delivery_info.blade.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. @extends('frontend.layouts.app')
  2. @section('content')
  3. <section class="pt-5 mb-4">
  4. <div class="container">
  5. <div class="row">
  6. <div class="col-xl-8 mx-auto">
  7. <div class="row aiz-steps arrow-divider">
  8. <div class="col done">
  9. <div class="text-center text-success">
  10. <i class="la-3x mb-2 las la-shopping-cart"></i>
  11. <h3 class="fs-14 fw-600 d-none d-lg-block">{{ translate('1. My Cart')}}</h3>
  12. </div>
  13. </div>
  14. <div class="col done">
  15. <div class="text-center text-success">
  16. <i class="la-3x mb-2 las la-map"></i>
  17. <h3 class="fs-14 fw-600 d-none d-lg-block">{{ translate('2. Shipping info')}}</h3>
  18. </div>
  19. </div>
  20. <div class="col active">
  21. <div class="text-center text-primary">
  22. <i class="la-3x mb-2 las la-truck"></i>
  23. <h3 class="fs-14 fw-600 d-none d-lg-block">{{ translate('3. Delivery info')}}</h3>
  24. </div>
  25. </div>
  26. <div class="col">
  27. <div class="text-center">
  28. <i class="la-3x mb-2 opacity-50 las la-credit-card"></i>
  29. <h3 class="fs-14 fw-600 d-none d-lg-block opacity-50">{{ translate('4. Payment')}}</h3>
  30. </div>
  31. </div>
  32. <div class="col">
  33. <div class="text-center">
  34. <i class="la-3x mb-2 opacity-50 las la-check-circle"></i>
  35. <h3 class="fs-14 fw-600 d-none d-lg-block opacity-50">{{ translate('5. Confirmation')}}</h3>
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. </div>
  41. </div>
  42. </section>
  43. <section class="py-4 gry-bg">
  44. <div class="container">
  45. <div class="row">
  46. <div class="col-xxl-8 col-xl-10 mx-auto">
  47. <form class="form-default" action="{{ route('checkout.store_delivery_info') }}" role="form" method="POST">
  48. @csrf
  49. @php
  50. $admin_products = array();
  51. $seller_products = array();
  52. foreach ($carts as $key => $cartItem){
  53. $product = \App\Models\Product::find($cartItem['product_id']);
  54. if($product->added_by == 'admin'){
  55. array_push($admin_products, $cartItem['product_id']);
  56. }
  57. else{
  58. $product_ids = array();
  59. if(isset($seller_products[$product->user_id])){
  60. $product_ids = $seller_products[$product->user_id];
  61. }
  62. array_push($product_ids, $cartItem['product_id']);
  63. $seller_products[$product->user_id] = $product_ids;
  64. }
  65. }
  66. $pickup_point_list = array();
  67. if (get_setting('pickup_point') == 1) {
  68. $pickup_point_list = \App\Models\PickupPoint::where('pick_up_status',1)->get();
  69. }
  70. @endphp
  71. @if (!empty($admin_products))
  72. <div class="card mb-3 shadow-sm border-0 rounded">
  73. <div class="card-header p-3">
  74. <h5 class="fs-16 fw-600 mb-0">{{ get_setting('site_name') }} {{ translate('Products') }}</h5>
  75. </div>
  76. <div class="card-body">
  77. <ul class="list-group list-group-flush">
  78. @foreach ($admin_products as $key => $cartItem)
  79. @php
  80. $product = \App\Models\Product::find($cartItem);
  81. @endphp
  82. <li class="list-group-item">
  83. <div class="d-flex">
  84. <span class="mr-2">
  85. <img
  86. src="{{ uploaded_asset($product->thumbnail_img) }}"
  87. class="img-fit size-60px rounded"
  88. alt="{{ $product->getTranslation('name') }}"
  89. >
  90. </span>
  91. <span class="fs-14 opacity-60">{{ $product->getTranslation('name') }}</span>
  92. </div>
  93. </li>
  94. @endforeach
  95. </ul>
  96. <div class="row border-top pt-3">
  97. <div class="col-md-6">
  98. <h6 class="fs-15 fw-600">{{ translate('Choose Delivery Type') }}</h6>
  99. </div>
  100. <div class="col-md-6">
  101. <div class="row gutters-5">
  102. <div class="col-6">
  103. <label class="aiz-megabox d-block bg-white mb-0">
  104. <input
  105. type="radio"
  106. name="shipping_type_{{ \App\Models\User::where('user_type', 'admin')->first()->id }}"
  107. value="home_delivery"
  108. onchange="show_pickup_point(this)"
  109. data-target=".pickup_point_id_admin"
  110. checked
  111. >
  112. <span class="d-flex p-3 aiz-megabox-elem">
  113. <span class="aiz-rounded-check flex-shrink-0 mt-1"></span>
  114. <span class="flex-grow-1 pl-3 fw-600">{{ translate('Home Delivery') }}</span>
  115. </span>
  116. </label>
  117. </div>
  118. @if ($pickup_point_list)
  119. <div class="col-6">
  120. <label class="aiz-megabox d-block bg-white mb-0">
  121. <input
  122. type="radio"
  123. name="shipping_type_{{ \App\Models\User::where('user_type', 'admin')->first()->id }}"
  124. value="pickup_point"
  125. onchange="show_pickup_point(this)"
  126. data-target=".pickup_point_id_admin"
  127. >
  128. <span class="d-flex p-3 aiz-megabox-elem">
  129. <span class="aiz-rounded-check flex-shrink-0 mt-1"></span>
  130. <span class="flex-grow-1 pl-3 fw-600">{{ translate('Local Pickup') }}</span>
  131. </span>
  132. </label>
  133. </div>
  134. @endif
  135. </div>
  136. @if ($pickup_point_list)
  137. <div class="mt-4 pickup_point_id_admin d-none">
  138. <select
  139. class="form-control aiz-selectpicker"
  140. name="pickup_point_id_{{ \App\Models\User::where('user_type', 'admin')->first()->id }}"
  141. data-live-search="true"
  142. >
  143. <option>{{ translate('Select your nearest pickup point')}}</option>
  144. @foreach ($pickup_point_list as $key => $pick_up_point)
  145. <option
  146. value="{{ $pick_up_point->id }}"
  147. data-content="<span class='d-block'>
  148. <span class='d-block fs-16 fw-600 mb-2'>{{ $pick_up_point->getTranslation('name') }}</span>
  149. <span class='d-block opacity-50 fs-12'><i class='las la-map-marker'></i> {{ $pick_up_point->getTranslation('address') }}</span>
  150. <span class='d-block opacity-50 fs-12'><i class='las la-phone'></i>{{ $pick_up_point->phone }}</span>
  151. </span>"
  152. >
  153. </option>
  154. @endforeach
  155. </select>
  156. </div>
  157. @endif
  158. </div>
  159. </div>
  160. </div>
  161. </div>
  162. @endif
  163. @if (!empty($seller_products))
  164. @foreach ($seller_products as $key => $seller_product)
  165. <div class="card mb-3 shadow-sm border-0 rounded">
  166. <div class="card-header p-3">
  167. <h5 class="fs-16 fw-600 mb-0">{{ \App\Models\Shop::where('user_id', $key)->first()->name }} {{ translate('Products') }}</h5>
  168. </div>
  169. <div class="card-body">
  170. <ul class="list-group list-group-flush">
  171. @foreach ($seller_product as $cartItem)
  172. @php
  173. $product = \App\Models\Product::find($cartItem);
  174. @endphp
  175. <li class="list-group-item">
  176. <div class="d-flex">
  177. <span class="mr-2">
  178. <img
  179. src="{{ uploaded_asset($product->thumbnail_img) }}"
  180. class="img-fit size-60px rounded"
  181. alt="{{ $product->getTranslation('name') }}"
  182. >
  183. </span>
  184. <span class="fs-14 opacity-60">{{ $product->getTranslation('name') }}</span>
  185. </div>
  186. </li>
  187. @endforeach
  188. </ul>
  189. <div class="row border-top pt-3">
  190. <div class="col-md-6">
  191. <h6 class="fs-15 fw-600">{{ translate('Choose Delivery Type') }}</h6>
  192. </div>
  193. <div class="col-md-6">
  194. <div class="row gutters-5">
  195. <div class="col-6">
  196. <label class="aiz-megabox d-block bg-white mb-0">
  197. <input
  198. type="radio"
  199. name="shipping_type_{{ $key }}"
  200. value="home_delivery"
  201. onchange="show_pickup_point(this)"
  202. data-target=".pickup_point_id_{{ $key }}"
  203. checked
  204. >
  205. <span class="d-flex p-3 aiz-megabox-elem">
  206. <span class="aiz-rounded-check flex-shrink-0 mt-1"></span>
  207. <span class="flex-grow-1 pl-3 fw-600">{{ translate('Home Delivery') }}</span>
  208. </span>
  209. </label>
  210. </div>
  211. @if ($pickup_point_list)
  212. <div class="col-6">
  213. <label class="aiz-megabox d-block bg-white mb-0">
  214. <input
  215. type="radio"
  216. name="shipping_type_{{ $key }}"
  217. value="pickup_point"
  218. onchange="show_pickup_point(this)"
  219. data-target=".pickup_point_id_{{ $key }}"
  220. >
  221. <span class="d-flex p-3 aiz-megabox-elem">
  222. <span class="aiz-rounded-check flex-shrink-0 mt-1"></span>
  223. <span class="flex-grow-1 pl-3 fw-600">{{ translate('Local Pickup') }}</span>
  224. </span>
  225. </label>
  226. </div>
  227. @endif
  228. </div>
  229. @if ($pickup_point_list)
  230. <div class="mt-4 pickup_point_id_{{ $key }} d-none">
  231. <select
  232. class="form-control aiz-selectpicker"
  233. name="pickup_point_id_{{ $key }}"
  234. data-live-search="true"
  235. >
  236. <option>{{ translate('Select your nearest pickup point')}}</option>
  237. @foreach ($pickup_point_list as $key => $pick_up_point)
  238. <option
  239. value="{{ $pick_up_point->id }}"
  240. data-content="<span class='d-block'>
  241. <span class='d-block fs-16 fw-600 mb-2'>{{ $pick_up_point->getTranslation('name') }}</span>
  242. <span class='d-block opacity-50 fs-12'><i class='las la-map-marker'></i> {{ $pick_up_point->getTranslation('address') }}</span>
  243. <span class='d-block opacity-50 fs-12'><i class='las la-phone'></i>{{ $pick_up_point->phone }}</span>
  244. </span>"
  245. >
  246. </option>
  247. @endforeach
  248. </select>
  249. </div>
  250. @endif
  251. </div>
  252. </div>
  253. </div>
  254. </div>
  255. @endforeach
  256. @endif
  257. <div class="pt-4 d-flex justify-content-between align-items-center">
  258. <a href="{{ route('home') }}" >
  259. <i class="la la-angle-left"></i>
  260. {{ translate('Return to shop')}}
  261. </a>
  262. <button type="submit" class="btn fw-600 btn-primary">{{ translate('Continue to Payment')}}</button>
  263. </div>
  264. </form>
  265. </div>
  266. </div>
  267. </div>
  268. </section>
  269. @endsection
  270. @section('script')
  271. <script type="text/javascript">
  272. function display_option(key){
  273. }
  274. function show_pickup_point(el) {
  275. var value = $(el).val();
  276. var target = $(el).data('target');
  277. // console.log(value);
  278. if(value == 'home_delivery'){
  279. if(!$(target).hasClass('d-none')){
  280. $(target).addClass('d-none');
  281. }
  282. }else{
  283. $(target).removeClass('d-none');
  284. }
  285. }
  286. </script>
  287. @endsection