item-gallery.blade.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. @extends('views.layouts.master')
  2. @section('content')
  3. <!--=====================================
  4. BANNER PART START
  5. =======================================-->
  6. <section class="inner-section single-banner">
  7. <div class="container">
  8. <h2>{{ $igroup['IgroupName'] }}</h2>
  9. <ol class="breadcrumb">
  10. <li class="breadcrumb-item"><a href="/">Home</a></li>
  11. <li class="breadcrumb-item active" aria-current="page">{{ $igroup['IgroupName'] }}</li>
  12. </ol>
  13. </div>
  14. </section>
  15. <!--=====================================
  16. BANNER PART END
  17. =======================================-->
  18. <!--=====================================
  19. SHOP PART START
  20. =======================================-->
  21. <section class="inner-section shop-part">
  22. <div class="container">
  23. <div class="row">
  24. <div class="col-lg-12">
  25. @component('views.partial.table-options')
  26. @endcomponent
  27. </div>
  28. </div>
  29. <div class="row row-cols-2 row-cols-md-3 row-cols-lg-3 row-cols-xl-4">
  30. @forelse($itemGallery['Page'] ?? [] as $item)
  31. <div class="col">
  32. <form class="product-card" action="{{ route('wish-list.favorite') }}" method="POST">
  33. @csrf
  34. <input type="hidden" name="item_id" value="{{ $item['Id'] }}">
  35. <div class="product-media">
  36. <div class="product-label">
  37. <label class="label-text new">new</label>
  38. </div>
  39. @if (empty($item['BdPage']))
  40. <button type="submit" class="product-wish wish">
  41. <i class="far fa-heart"></i>
  42. </button>
  43. @else
  44. <button type="submit" class="product-wish wish">
  45. <input type="hidden" name="_method" value="delete" />
  46. <i class="fas fa-heart"></i>
  47. </button>
  48. @endif
  49. <a class="product-image" onclick="select_item({{ $item['Id'] }})" href="{{ route('item-details', $item['C9'] ?: $item['Id']) }}"> <img src="{{ env('MEDIA_URL') . $item['C1'] }}" alt="product" onerror="this.src='/images/folder.jpg'"> </a>
  50. </div>
  51. <div class="product-content">
  52. <h6 class="product-name"> <a onclick="select_item({{ $item['Id'] }})" href="{{ route('item-details', $item['C9'] ?: $item['Id']) }}">{{ $item['C5'] }}</a> </h6>
  53. <h6 class="product-price">
  54. <span>{{ number_format($item['C7']) }}원</span> </h6>
  55. </div>
  56. </form>
  57. </div>
  58. @empty
  59. <div class="pricing_box1 full_width">
  60. 상품이 존재하지 않습니다
  61. </div>
  62. @endforelse
  63. </div>
  64. <div class="row">
  65. <div class="col-lg-12">
  66. <div class="bottom-paginate d-flex justify-content-end">
  67. {{ $itemGallery['Page']->appends(['limit' => request('limit'), 'sort' => request('sort')])->links() }}
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. </section>
  73. <!--=====================================
  74. SHOP PART END
  75. =======================================-->
  76. @endsection
  77. @push('js')
  78. <script>
  79. $(document).ready(function() {
  80. const items = []
  81. itemGallery['Page']['data'] = itemGallery['Page']['data'].map((item, index) => {
  82. item['index'] = index
  83. return item
  84. })
  85. itemGallery['Page']['data'].forEach(item => {
  86. items.push({
  87. item_id: item['Id'],
  88. item_name: item['C5'],
  89. price: item['C7'],
  90. item_brand: item['C6'],
  91. item_category: item['C3'],
  92. item_list_name: item['C3'] + ' ' + item['C5'],
  93. index: item['index'],
  94. })
  95. });
  96. gtag("event", "view_item_list", {
  97. "items": items
  98. });
  99. });
  100. function select_item(item_id) {
  101. const item = itemGallery['Page']['data'].filter(item => {
  102. return item['Id'] === item_id
  103. })[0]
  104. gtag("event", "select_item", {
  105. "items": [{
  106. item_id: item['Id'],
  107. item_name: item['C5'],
  108. price: item['C7'],
  109. item_brand: item['C6'],
  110. item_category: item['C3'],
  111. index: item['index']
  112. }],
  113. item_list_name: item['C3'] + ' ' + item['C5'],
  114. item_list_id: item['Id'],
  115. currency: "KRW"
  116. });
  117. }
  118. const itemGallery = @json($itemGallery);
  119. </script>
  120. @endpush