checkout.blade.php_221104 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  1. @extends('views.layouts.master')
  2. <link rel="stylesheet" href="{{ csset('/themes/pro/modunawa/resources/css/checkout.css') }}">
  3. @section('content')
  4. <!--=====================================
  5. BANNER PART START
  6. =======================================-->
  7. <section class="inner-section single-banner">
  8. <div class="container">
  9. <h2>결제하기</h2>
  10. <ol class="breadcrumb">
  11. <li class="breadcrumb-item"><a href="/">Home</a></li>
  12. <!--<li class="breadcrumb-item"><a href="shop-4column.html">shop grid</a></li>-->
  13. <li class="breadcrumb-item active" aria-current="page">결제하기</li>
  14. </ol>
  15. </div>
  16. </section>
  17. <!--=====================================
  18. BANNER PART END
  19. =======================================-->
  20. <!--=====================================
  21. CHECKOUT PART START
  22. =======================================-->
  23. <section class="inner-section checkout-part">
  24. <form class="container" id="checkout-form" action="{{ route('checkout.store') }}" method="POST">
  25. <input type="hidden" name="ship_fee" value="{{ $checkoutCharge['charge_amt'] }}">
  26. @csrf
  27. <div class="row">
  28. <!--
  29. <div class="col-lg-12">
  30. <div class="alert-info">
  31. <p>Returning customer? <a href="login.html">Click here to login</a></p>
  32. </div>
  33. </div>
  34. -->
  35. <div class="col-lg-12 order">
  36. <div class="account-card">
  37. <div class="account-title">
  38. <h4>Your order</h4>
  39. </div>
  40. <div class="account-content">
  41. <div class="table-scroll">
  42. <table class="table-list">
  43. <thead>
  44. <tr>
  45. <th scope="col">Serial</th>
  46. <th scope="col">Product</th>
  47. <th scope="col">Name</th>
  48. <th scope="col">Price</th>
  49. <th scope="col">brand</th>
  50. <th scope="col">quantity</th>
  51. <th scope="col">action</th>
  52. </tr>
  53. </thead>
  54. <tbody>
  55. @forelse ($listType1Book['Book'][2]['Page'] ?? [] as $index => $cart)
  56. <tr>
  57. <td class="table-serial"><h6>{{ $cart['C3'] }}</h6></td>
  58. <td class="table-image"><img src="{{ env('MEDIA_URL') . $cart['C2'] }}" alt="product"></td>
  59. <td class="table-name"><h6>{{ $cart['C4'] }}</h6></td>
  60. <td class="table-price"><h6>{{ number_format($cart['C6']) }} 원<!--<small>/kilo</small>--></h6></td>
  61. <td class="table-brand"><h6>{{ $cart['C5'] }}</h6></td>
  62. <td class="table-quantity">
  63. <h6>
  64. <div class="product-action">
  65. <button type="button" class="action-minus" title="Quantity Minus"><i class="icofont-minus"></i></button>
  66. <input class="action-input" title="Quantity Number" onchange="cart_qty_update(this, {{ $cart['Id'] }})"
  67. type="text" min="1" value="{{ (int)$cart['C7'] }}">
  68. <button type="button" class="action-plus" title="Quantity Plus"><i class="icofont-plus"></i></button>
  69. </div>
  70. </h6>
  71. </td>
  72. <td class="table-action">
  73. {{-- <a class="view" href="#" title="Quick View" data-bs-toggle="modal" data-bs-target="#product-view"><i class="fas fa-eye"></i></a>--}}
  74. <button type="button" class="trash" onclick="cart_delete({{ $cart['Id'] }})" title="Remove Wishlist">
  75. <i class="icofont-trash"></i>
  76. </button>
  77. </td>
  78. </tr>
  79. @empty
  80. <tr>
  81. <td class="text-center" colspan="7">쇼핑카트가 비어있습니다</td>
  82. </tr>
  83. @endforelse
  84. </tbody>
  85. </table>
  86. </div>
  87. <div class="chekout-coupon">
  88. <button type="button" class="coupon-btn">쿠폰 코드가 있습니까?</button>
  89. <form class="coupon-form">
  90. <input type="text" placeholder="Enter your coupon code">
  91. <button type="submit"><span>확인</span></button>
  92. </form>
  93. </div>
  94. <div class="checkout-charge">
  95. <ul>
  96. <li>
  97. <span>Sub total</span>
  98. <span>{{ number_format($checkoutCharge['sub_total']) }} 원</span>
  99. </li>
  100. <li>
  101. <span>배송료</span>
  102. <span>{{ number_format($checkoutCharge['charge_amt']) }} 원</span>
  103. </li>
  104. <li>
  105. <span>할인</span>
  106. <span>0 원</span>
  107. </li>
  108. <li>
  109. <span>Total<small>(VAT 포함)</small></span>
  110. <span>{{ number_format($checkoutCharge['total']) }} 원</span>
  111. </li>
  112. </ul>
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. {{-- <div class="col-lg-12">--}}
  118. {{-- <div class="account-card">--}}
  119. {{-- <div class="account-title">--}}
  120. {{-- <h4>배송일정</h4>--}}
  121. {{-- </div>--}}
  122. {{-- <div class="account-content">--}}
  123. {{-- <div class="row">--}}
  124. {{-- <div class="col-md-6 col-lg-4 alert fade show">--}}
  125. {{-- <div class="profile-card schedule">--}}
  126. {{-- <h6>express</h6>--}}
  127. {{-- <p>90 min express delivery</p>--}}
  128. {{-- </div>--}}
  129. {{-- </div>--}}
  130. {{-- <div class="col-md-6 col-lg-4 alert fade show">--}}
  131. {{-- <div class="profile-card schedule">--}}
  132. {{-- <h6>8am-10pm</h6>--}}
  133. {{-- <p>8.00 AM - 10.00 PM</p>--}}
  134. {{-- </div>--}}
  135. {{-- </div>--}}
  136. {{-- <div class="col-md-6 col-lg-4 alert fade show">--}}
  137. {{-- <div class="profile-card schedule">--}}
  138. {{-- <h6>Next day</h6>--}}
  139. {{-- <p>Next day or Tomorrow</p>--}}
  140. {{-- </div>--}}
  141. {{-- </div>--}}
  142. {{-- </div>--}}
  143. {{-- </div>--}}
  144. {{-- </div>--}}
  145. {{-- </div>--}}
  146. <div class="col-lg-12">
  147. <div class="account-card">
  148. <div class="account-title">
  149. <h4>연락처</h4>
  150. <button type="button" class="medium-btn" data-serialize-form="#checkout-form" data-attr="{{ route('contact.index', [ 'seq_no' => $listType1Book['Book'][0]['Page'] ? (int)$listType1Book['Book'][0]['Page'][count($listType1Book['Book'][0]['Page']) - 1]['C1'] + 1 : 0 ]) }}">
  151. 연락처 추가
  152. </button>
  153. </div>
  154. <div class="account-content">
  155. <div class="row" id="company-contact-bd-div">
  156. @forelse ($listType1Book['Book'][0]['Page'] ?? [] as $contact)
  157. <div class="col-md-6 col-lg-4 alert fade show">
  158. <div class="profile-card contact">
  159. <h6>(<span class="sort-txt">{{ DataConverter::execute($contact['C2'], "sort('company-contact-bd')") }}</span>) <span class="ship-contact-txt">{{ $contact['C3'] }}</span></h6>
  160. <p class="ship-mobile-txt">{{ $contact['C4'] }}</p>
  161. <ul>
  162. <li><button type="button" class="edit icofont-edit medium-btn" title="Edit This" data-attr="{{ route('contact.show', $contact['Id']) }}"></button></li>
  163. <li><button type="button" class="trash icofont-ui-delete destroy-btn" title="Remove This" data-attr="{{ route('contact.destroy', $contact['Id']) }}"></button></li>
  164. </ul>
  165. </div>
  166. </div>
  167. @empty
  168. <div class="col">
  169. 비어있습니다
  170. </div>
  171. @endforelse
  172. </div>
  173. </div>
  174. </div>
  175. </div>
  176. <div class="col-lg-12">
  177. <div class="account-card">
  178. <div class="account-title">
  179. <h4>배송지</h4>
  180. <button type="button" class="medium-btn" data-attr="{{ route('address.index', [ 'seq_no' => $listType1Book['Book'][1]['Page'] ? (int)$listType1Book['Book'][1]['Page'][count($listType1Book['Book'][1]['Page']) - 1]['C1'] + 1 : 0 ]) }}">주소 추가</button>
  181. </div>
  182. <div class="account-content">
  183. <div class="row" id="company-destina-bd-div">
  184. @forelse ($listType1Book['Book'][1]['Page'] ?? [] as $index => $address)
  185. <div class="col-md-6 col-lg-4 alert fade show">
  186. <div class="profile-card address">
  187. <h6 class="sort">{{ DataConverter::execute($address['C2'], "sort('company-destina-bd')") }}</h6>
  188. <p>(<span class="ship-zip-code-txt">{{ $address['C3'] }}</span>) <span class="ship-addr1-txt">{{ $address['C4'] }}</span> <span class="ship-addr2-txt">{{ $address['C5'] }}</span></p>
  189. <ul class="user-action">
  190. <li><button type="button" class="edit icofont-edit medium-btn" title="Edit This" data-attr="{{ route('address.show', $address['Id']) }}"></button></li>
  191. <li><button type="button" class="trash icofont-ui-delete destroy-btn" title="Remove This" data-attr="{{ route('address.destroy', $address['Id']) }}"></button></li>
  192. </ul>
  193. </div>
  194. </div>
  195. @empty
  196. <div class="col">
  197. 비어있습니다
  198. </div>
  199. @endforelse
  200. </div>
  201. </div>
  202. </div>
  203. </div>
  204. <div class="col-lg-12">
  205. <div class="account-card page-pc">
  206. <div class="account-title">
  207. <h4>결제방법</h4>
  208. </div>
  209. <div class="account-content" id="paymethod-div">
  210. <div class="d-flex align-items-center">
  211. @forelse ($codeTitle['paymethod']['sorder'] ?? [] as $key => $paymethod)
  212. @if ($paymethod['Code'] !== '')
  213. <div class="paymethod-div">
  214. <input type="radio" value="{{ $paymethod['Code'] }}" name="paymethod" id="paymethod-radio-{{ $key }}" {{ $key === 'RM' ? 'checked' : '' }}>
  215. <label for="paymethod-radio-{{ $key }}" class="form-label">{{ $paymethod['Title'] }}</label>
  216. </div>
  217. @endif
  218. @empty
  219. <div class="col">
  220. 비어있습니다
  221. </div>
  222. @endforelse
  223. </div>
  224. <div class="virtual-account-payment pay-type-content">
  225. <p class="validate-message" style="display: none;"></p>
  226. <ul class="pay-type-sections">
  227. <li class="deposit-bank-wrap pay-type-section">
  228. <label for="deposit-bank-select" class="line-title">은행명</label>
  229. <div class="line-data">
  230. <select id="deposit-bank-select" onchange="change_remit_account(this)">
  231. <option value="" selected>선택</option>
  232. @forelse ($listType1Book['Book'][4]['Page'] ?? [] as $index => $setup)
  233. @php
  234. $remitAccountSetup = json_decode($setup['C1'], true);
  235. @endphp
  236. <option data-holder-name="{{ $remitAccountSetup['HolderName'] }}"
  237. value="{{ $remitAccountSetup['AccountNo'] }}">{{ $remitAccountSetup['BankName'] }}</option>
  238. @empty
  239. @endforelse
  240. </select>
  241. <p class="validate-message" style="display: none;">은행을 선택해 주세요</p>
  242. <p class="pay-box__deactivated-payment-notice" id="bank-name-txt"></p>
  243. </div>
  244. </li>
  245. <li class="payBox-section pay-type-section mt-2">
  246. <label class="line-title d-block">계좌번호</label>
  247. <input type="text" class="form-text" id="account-no-txt" readonly>
  248. </li>
  249. <li class="payBox-section pay-type-section mt-2">
  250. <label class="line-title d-block">예금주</label>
  251. <input type="text" class="form-text" id="holder-name-txt" readonly>
  252. </li>
  253. <li class="payBox-section pay-type-section mt-2">
  254. <label class="line-title d-block">입금자명</label>
  255. <input type="text" class="form-text" name="remit_name" id="remit-name-txt" required>
  256. </li>
  257. </ul>
  258. </div>
  259. <dl class="virtual-account-payment-explain mt-2">
  260. <dt class="mb-2">무통장입금 시 유의사항</dt>
  261. <dd>입금완료 후 상품품절로 인해 자동취소된 상품은 환불 처리해 드립니다.</dd>
  262. <dd>무통장입금 결제 시 부분취소가 불가하며 전체취소 후 다시 주문하시기 바랍니다.</dd>
  263. <dd>은행 이체 수수료가 발생될 수 있습니다. 입금시 수수료를 확인해주세요.</dd>
  264. </dl>
  265. </div>
  266. </div>
  267. </div>
  268. <div class="col-lg-12">
  269. <div class="account-card mb-0">
  270. <div class="account-title">
  271. <h4>결제하기</h4>
  272. {{-- <button data-bs-toggle="modal" data-bs-target="#payment-add">지갑 추가</button>--}}
  273. </div>
  274. {{-- <div class="account-content">--}}
  275. {{-- <div>--}}
  276. {{-- <label class="line-title d-block">입금자명</label>--}}
  277. {{-- <input type="text" class="form-text" name="remit_name" id="remit-name-txt" required>--}}
  278. {{-- </div>--}}
  279. {{-- </div>--}}
  280. <div class="checkout-check">
  281. <input type="checkbox" id="checkout-check">
  282. <label for="checkout-check">약관동의 <a href="{{ route('policy.index') }}">약관보기</a>.</label>
  283. </div>
  284. <div class="checkout-proced">
  285. {{-- <a href="/checkout-ok" class="btn btn-inline">결제하기</a>--}}
  286. <button type="submit" id="checkout-btn" class="btn btn-inline button-prevent-multiple-submits">
  287. <i class="spinner fa fa-spinner fa-spin"></i>
  288. 결제하기
  289. </button>
  290. </div>
  291. </div>
  292. </div>
  293. </div>
  294. </form>
  295. </section>
  296. <!--=====================================
  297. CHECKOUT PART END
  298. =======================================-->
  299. <!--=====================================
  300. MODAL ADD FORM START
  301. =======================================-->
  302. <!-- payment add form -->
  303. <div class="modal fade" id="payment-add">
  304. <div class="modal-dialog modal-dialog-centered">
  305. <div class="modal-content">
  306. <button type="button" class="modal-close" data-bs-dismiss="modal"><i class="icofont-close"></i></button>
  307. <form class="modal-form form-prevent-multiple-submits" action="{{ route('wallet.store') }}" method="POST">
  308. @csrf
  309. <div class="form-title">
  310. <h3>지갑 추가</h3>
  311. </div>
  312. <div class="form-group">
  313. <label class="form-label">토큰</label>
  314. <input class="form-control" name="token" type="text" placeholder="Enter your token number" required>
  315. </div>
  316. <button type="button" class="form-btn button-prevent-multiple-submits" type="submit">
  317. <i class="spinner fa fa-spinner fa-spin"></i>
  318. 저장
  319. </button>
  320. </form>
  321. </div>
  322. </div>
  323. </div>
  324. @endsection
  325. @push('modal')
  326. @include('views.modals.medium')
  327. @endpush
  328. @push('js')
  329. <script>
  330. $('form').on('submit', function() {
  331. event.preventDefault()
  332. const company_contact_bd_div = '#company-contact-bd-div .profile-card'
  333. const company_destina_bd_div = '#company-destina-bd-div .profile-card'
  334. const deposit_bank_select = '#deposit-bank-select option:selected'
  335. if (isEmpty($(deposit_bank_select).val())) {
  336. iziToast.info({ title: 'Info', message: '무통장입금 계좌를 선택하세요' })
  337. return
  338. }
  339. if (! $(company_contact_bd_div).hasClass('active')) {
  340. iziToast.info({ title: 'Info', message: '연락처를 선택하세요' })
  341. return
  342. }
  343. if (! $(company_destina_bd_div).hasClass('active')) {
  344. iziToast.info({ title: 'Info', message: '배송지를 선택하세요' })
  345. return
  346. }
  347. if (! $('#checkout-check').prop('checked')) {
  348. iziToast.info({ title: 'Info', message: '약관을 확인하세요' })
  349. return
  350. }
  351. click_submit_btn(this)
  352. const ship_contact = $(company_contact_bd_div + '.active').find('.ship-contact-txt').text()
  353. const ship_mobile = $(company_contact_bd_div + '.active').find('.ship-mobile-txt').text()
  354. const ship_zip_code = $(company_destina_bd_div + '.active').find('.ship-zip-code-txt').text()
  355. const ship_addr1 = $(company_destina_bd_div + '.active').find('.ship-addr1-txt').text()
  356. const ship_addr2 = $(company_destina_bd_div + '.active').find('.ship-addr2-txt').text()
  357. const remit_account = $(deposit_bank_select).text() + ' ' + $('#account-no-txt').val() + ' ' + $('#holder-name-txt').val()
  358. $(this).append($('<input>', { 'type': 'hidden', 'name': 'ship_contact', 'value': ship_contact }))
  359. $(this).append($('<input>', { 'type': 'hidden', 'name': 'ship_mobile', 'value': ship_mobile }))
  360. $(this).append($('<input>', { 'type': 'hidden', 'name': 'ship_mobile', 'value': ship_mobile }))
  361. $(this).append($('<input>', { 'type': 'hidden', 'name': 'ship_zip_code', 'value': ship_zip_code }))
  362. $(this).append($('<input>', { 'type': 'hidden', 'name': 'ship_addr1', 'value': ship_addr1 }))
  363. $(this).append($('<input>', { 'type': 'hidden', 'name': 'ship_addr2', 'value': ship_addr2 }))
  364. $(this).append($('<input>', { 'type': 'hidden', 'name': 'remit_account', 'value': remit_account }))
  365. this.submit();
  366. });
  367. function change_remit_account($this) {
  368. $('.pay-type-content #account-no-txt').val($($this).val())
  369. $('.pay-type-content #holder-name-txt').val($($this).find('option:selected').data('holder-name'))
  370. }
  371. </script>
  372. @endpush