view_wishlist.blade.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. @extends('frontend.layouts.user_panel')
  2. @section('panel_content')
  3. <div class="aiz-titlebar mt-2 mb-4">
  4. <div class="row align-items-center">
  5. <div class="col-md-6">
  6. <b class="h4">{{ translate('Wishlist')}}</b>
  7. </div>
  8. </div>
  9. </div>
  10. <div class="row gutters-5">
  11. @forelse ($wishlists as $key => $wishlist)
  12. @if ($wishlist->product != null)
  13. <div class="col-xxl-3 col-xl-4 col-lg-3 col-md-4 col-sm-6" id="wishlist_{{ $wishlist->id }}">
  14. <div class="card mb-2 shadow-sm">
  15. <div class="card-body">
  16. <a href="{{ route('product', $wishlist->product->slug) }}" class="d-block mb-3">
  17. <img src="{{ uploaded_asset($wishlist->product->thumbnail_img) }}" class="img-fit h-140px h-md-200px">
  18. </a>
  19. <h5 class="fs-14 mb-0 lh-1-5 fw-600 text-truncate-2">
  20. <a href="{{ route('product', $wishlist->product->slug) }}" class="text-reset">{{ $wishlist->product->getTranslation('name') }}</a>
  21. </h5>
  22. <div class="rating rating-sm mb-1">
  23. {{ renderStarRating($wishlist->product->rating) }}
  24. </div>
  25. <div class=" fs-14">
  26. @if(home_base_price($wishlist->product) != home_discounted_base_price($wishlist->product))
  27. <del class="opacity-60 mr-1">{{ home_base_price($wishlist->product) }}</del>
  28. @endif
  29. <span class="fw-600 text-primary">{{ home_discounted_base_price($wishlist->product) }}</span>
  30. </div>
  31. </div>
  32. <div class="card-footer">
  33. <a href="#" class="link link--style-3" data-toggle="tooltip" data-placement="top" title="Remove from wishlist" onclick="removeFromWishlist({{ $wishlist->id }})">
  34. <i class="la la-trash la-2x"></i>
  35. </a>
  36. <button type="button" class="btn btn-sm btn-block btn-primary ml-3" onclick="showAddToCartModal({{ $wishlist->product->id }})">
  37. <i class="la la-shopping-cart mr-2"></i>{{ translate('Add to cart')}}
  38. </button>
  39. </div>
  40. </div>
  41. </div>
  42. @endif
  43. @empty
  44. <div class="col">
  45. <div class="text-center bg-white p-4 rounded shadow">
  46. <img class="mw-100 h-200px" src="{{ static_asset('assets/img/nothing.svg') }}" alt="Image">
  47. <h5 class="mb-0 h5 mt-3">{{ translate("There isn't anything added yet")}}</h5>
  48. </div>
  49. </div>
  50. @endforelse
  51. </div>
  52. <div class="aiz-pagination">
  53. {{ $wishlists->links() }}
  54. </div>
  55. @endsection
  56. @section('modal')
  57. <div class="modal fade" id="addToCart" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  58. <div class="modal-dialog modal-lg modal-dialog-centered modal-dialog-zoom product-modal" id="modal-size" role="document">
  59. <div class="modal-content position-relative">
  60. <div class="c-preloader">
  61. <i class="fa fa-spin fa-spinner"></i>
  62. </div>
  63. <button type="button" class="close absolute-close-btn" data-dismiss="modal" aria-label="Close">
  64. <span aria-hidden="true">&times;</span>
  65. </button>
  66. <div id="addToCart-modal-body">
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. @endsection
  72. @section('script')
  73. <script type="text/javascript">
  74. function removeFromWishlist(id){
  75. $.post('{{ route('wishlists.remove') }}',{_token:'{{ csrf_token() }}', id:id}, function(data){
  76. $('#wishlist').html(data);
  77. $('#wishlist_'+id).hide();
  78. AIZ.plugins.notify('success', '{{ translate('Item has been renoved from wishlist') }}');
  79. })
  80. }
  81. </script>
  82. @endsection