app/template/user_data/cart_index.twig line 1

Open in your IDE?
  1. {% extends '@user_data/layout/default_frame.twig' %}
  2. {% block title %}
  3. カート | オリジナル缶バッジ/カンバッチ製作【個人小ロットから業務用OEMまで激安印刷】ZEAMI Goods
  4. {% endblock %}
  5. {% block css %}
  6. <link href="{{ asset('assets/custom_css/amazon_payment.css') }}" rel="stylesheet" type="text/css" media="screen, projection">
  7. {% endblock %}
  8. {% block js %}
  9. <script>
  10. function removeCartItem(button, id) {
  11. if (window.confirm('本当に削除しますか?')) {
  12. const token = $(button).attr('token-for-anchor');
  13. $.ajax({
  14. url: `/cart_index/${id}/delete`,
  15. method: 'DELETE',
  16. data: {
  17. _token: token
  18. },
  19. success: function (result) {
  20. let parent = button.parentNode;
  21. parent.parentNode.remove();
  22. window.location.reload();
  23. },
  24. error: function (xhr, status, error) {
  25. console.log(error)
  26. }
  27. });
  28. }
  29. }
  30. const WORKING_TIME = {{ working_time|json_encode|raw }};
  31. </script>
  32. <script src="{{ asset('assets/js/holiday_calender.js') }}" type="text/javascript"></script>
  33. <script src="{{ asset('assets/js/home/order_options_cart_index.js') }}" type="text/javascript"></script>
  34. {% endblock %}
  35. {% block content %}
  36. <!-- // ++ パンクズ ++ //////////////////////////////////////////////////////////// // -->
  37. <div id="bread_crumbBloc" class="fades">
  38. <ul id="breadCrumb" class="fades">
  39. <li class="up">
  40. <a href="/"><img src="{{ asset('assets/img/icon_home.png') }}" alt="ホーム"></a>
  41. </li>
  42. <li class="up">カートの中身</li>
  43. </ul>
  44. <!-- ///// #breadCrumb +++++ ///// -->
  45. <!-- ///// +++++ #bread_crumbBloc +++++ ///// -->
  46. </div>
  47. <!-- ▼▼ MAIN CONTENTS __________________________________________________________________________________________________ ▼▼ -->
  48. <main
  49. id="mainContents">
  50. <!-- // == MAIN ================================================================================ // -->
  51. <section
  52. id="Cart" class="section_basic full">
  53. <!-- // ++ ページタイトル ++ /////////////////////////////////////////////////////////////// -->
  54. <div id="section_titleBloc" class="fades">
  55. <h3 class="section_title up">カートの商品</h3>
  56. <!-- ///// #section_titleBloc +++++ ///// -->
  57. </div>
  58. <!-- // ++ カートフロー画像 ++ /////////////////////////////////////////////////////////////// -->
  59. <figure id="cart_flowImage" class="fades"><img src="{{ asset('assets/img/cart/cart-flow01.png') }}"></figure>
  60. <!-- // ++ 納期に関するご注意 ++ /////////////////////////////////////////////////////////////// -->
  61. <aside class="caution_box fades">
  62. <div class="caution_inner">
  63. <h4 class="caution_title up">納期に関するご注意</h4>
  64. <p class="indent up">◯ 納期は全てのデータをアップロードし、データに不備がない時点で確定します。</p>
  65. <!-- ///// .caution_box ***** ///// -->
  66. </div>
  67. </aside>
  68. {% set productStr = app.session.flashbag.get('eccube.front.request.product') %}
  69. {% for error in app.session.flashbag.get('eccube.front.request.error') %}
  70. {% set idx = loop.index0 %}
  71. <div class="ec-cartRole__error">
  72. <div class="ec-alert-warning">
  73. <div class="ec-alert-warning__icon"><img src="{{ asset('assets/icon/exclamation-white.svg') }}"></div>
  74. <div class="ec-alert-warning__text">
  75. {% if productStr[idx] is defined %}
  76. {{ error|trans({'%product%':productStr[idx]})|nl2br }}
  77. {% else %}
  78. {{ error|trans|nl2br }}
  79. {% endif %}
  80. </div>
  81. </div>
  82. </div>
  83. {% endfor %}
  84. {% for error in app.session.flashbag.get('eccube.front.cart.error') %}
  85. <div class="ec-cartRole__error">
  86. <div class="ec-alert-warning">
  87. <div class="ec-alert-warning__icon"><img src="{{ asset('assets/icon/exclamation-white.svg') }}"></div>
  88. <div class="ec-alert-warning__text">
  89. {{ error|trans|nl2br }}
  90. </div>
  91. </div>
  92. </div>
  93. {% endfor %}
  94. {% for CartIndex,Cart in Carts %}
  95. <!-- // ++ 購入内容 ++ /////////////////////////////////////////////////////////////// -->
  96. <form name="form" id="form_cart" class="ec-cartRole" method="post" action="{{ url('cart') }}">
  97. <div id="cart_tableBox" class="fades">
  98. <table id="cart_indexTable" cellpadding="0" cellspacing="0">
  99. <tbody>
  100. <tr>
  101. <th class="delete">削除</th>
  102. <th class="detail" colspan="3">商品内容</th>
  103. <th class="subtotal">小計</th>
  104. </tr>
  105. <!-- // *** 商品情報 ****************************************************** // -->
  106. {% for CartItem in Cart.CartItems %}
  107. {% set ProductClass = CartItem.ProductClass %}
  108. {% set Product = ProductClass.Product %}
  109. <tr
  110. class="cart_detail">
  111. <!-- ■■ ++ 削除ボタン ++ ■■ -->
  112. <td class="cart_delete">
  113. <button class="btn_delete" onclick="removeCartItem(this, {{ CartItem.id }})" {{ csrf_token_for_anchor() }} type="button"><img src="{{ asset('assets/img/btn_delete.png') }}"></button>
  114. </td>
  115. <!-- /// *** .cart_delete *** /// -->
  116. <!-- ■■ ++ サムネイル ++ ■■ -->
  117. <td class="cart_thumb">
  118. <figure class="item_thumb"><img src="{{ asset(Product.MainListImage|no_image_product, 'save_image') }}"></figure>
  119. </td>
  120. <!-- /// *** .cart_thumb *** /// -->
  121. <!-- ■■ ++ 商品詳細 ++ ■■ -->
  122. <td class="cart_itemdata">
  123. <h5 class="item_name">{{ Product.name }}</h5>
  124. <p>総発注数量<span>{{ CartItem.quantity|number_format }}枚</span>
  125. </p>
  126. {% set n = CartItem.total_day_delivery ?? 0 %}
  127. <p>弊社発送日<span id="delivery_date_{{ CartItem.id }}"></span></p>
  128. <script>
  129. document.addEventListener("DOMContentLoaded", function () {
  130. const deliveryDays = {{ n }};
  131. const formattedDate = formatTimeDelivery(deliveryDays);
  132. document.getElementById("delivery_date_{{ CartItem.id }}").textContent = formattedDate + " 予定";
  133. });
  134. </script>
  135. </td>
  136. <!-- /// *** .cart_itemdata *** /// -->
  137. <!-- ■■ ++ 詳細を見るボタン ++ ■■ -->
  138. <td class="cart_item_detail">
  139. {% if Product.is_sample == false %}
  140. <p class="btn_itemdetail">
  141. <a href="/detail/{{ CartItem.id }}/cart"><img src="{{ asset('assets/img/btn_detail.png') }}" alt="商品詳細を見る"></a>
  142. </p>
  143. {% endif %}
  144. </td>
  145. <!-- /// *** .cart_item_detail *** /// -->
  146. <!-- ■■ ++ 商品価格 ++ ■■ -->
  147. <td class="cart_price">
  148. <p>{{ CartItem.total_price_with_send_data|price }}
  149. <span>(税込)</span>
  150. </p>
  151. </td>
  152. <!-- /// *** .cart_price *** /// -->
  153. <!-- //// .cart_delete **** //// -->
  154. </tr>
  155. {% endfor %}
  156. </tbody>
  157. </table>
  158. <!-- //// ++++ #cart_indexTable ++++ //// -->
  159. <!-- ///// #cart_tableBox +++++ ///// -->
  160. </div>
  161. <!-- // ++ 合計金額 & 購入ボタン ++ /////////////////////////////////////////////////////////////// -->
  162. <div id="index_cart_totalBox">
  163. <p id="totalPrice" class="fades">
  164. <span>合計</span>
  165. {{ Cart.totalPrice|price }}<font>(税込)</font>
  166. </p>
  167. <ul id="cart_btnList" class="fades">
  168. <li class="fades">
  169. <div id="cartBack" class="btn_basic">
  170. <a href="/">お買い物を続ける</a>
  171. </div>
  172. </li>
  173. <li class="fades">
  174. <div id="Checkout" class="btn_basic cart">
  175. <a href="/cart_input">
  176. <span>レジに進む</span>
  177. </a>
  178. </div>
  179. </li>
  180. {% if app.user %}
  181. <li class="fades">
  182. <div class="btn_basic" style="padding-top: 20px;">
  183. <p style="height: 62px;" id="AmazonPayButton{{ Cart.cartKey }}"></p>
  184. </div>
  185. </li>
  186. {% else %}
  187. <li class="fades fadeIn">
  188. <a href="{{ url('cart_login_amazon') }}" class="btn_basic" style="padding-top: 20px;" id="redirect-login-amazon">
  189. <div style="height: 62px; position: relative;" role="button" aria-label="Amazon Pay - Amazon Payテストアカウントをお使いください" title="Amazonアカウントに登録されている情報を利用してお支払い">
  190. <div class="amazonpay-button-container amazonpay-button-enabled amazonpay-button-container-rows">
  191. <div class="amazonpay-button-view1 amazonpay-button-view1-gold" tabindex="0">
  192. <picture class="amazonpay-button-logo"><img src="https://m.media-amazon.com/images/G/09/AmazonPay/Maxo/logo._CB452516594_.svg"></picture>
  193. <picture class="amazonpay-button-sandbox-logo"><img src="https://m.media-amazon.com/images/G/09/AmazonPay/Maxo/sandbox_icon._CB452516595_.svg"></picture>
  194. <picture class="amazonpay-button-chevrons"><img src="https://m.media-amazon.com/images/G/09/AmazonPay/Maxo/AmazonPay_button_chevron._CB1558391205_.svg"></picture>
  195. </div>
  196. <div class="amazonpay-button-view2"></div>
  197. <div class="amazonpay-button-view3">
  198. <picture class="amazonpay-button-microtext"><img src="https://m.media-amazon.com/images/G/09/AmazonPay/Maxo/mt-ja_jp._CB1568869902_.svg"></picture>
  199. </div>
  200. </div>
  201. </div>
  202. </a>
  203. </li>
  204. {% endif %}
  205. </ul>
  206. <!-- //// ++++ #cart_btnList ++++ //// -->
  207. <!-- ///// #index_cart_totalBox +++++ ///// -->
  208. </div>
  209. </form>
  210. {% endfor %}
  211. {% set totalQuantity = get_carts_total_quantity() %}
  212. {% if totalQuantity == 0 %}
  213. <div style="width: 100%;
  214. padding: 10px;
  215. text-align: center;
  216. font-weigth: bold;
  217. color: white;
  218. background: #ff7900;
  219. margin-bottom: 20px;">
  220. <div>
  221. <p>{{ 'front.block.cart.no_item'|trans }}</p>
  222. </div>
  223. </div>
  224. {% endif %}
  225. </section>
  226. <!-- ///// +++++ #Cart +++++ ///// -->
  227. <!-- ///// +++++ #mainContents +++++ ///// -->
  228. </main>
  229. <!-- // ++ パンクズ ++ //////////////////////////////////////////////////////////// // -->
  230. <div id="bread_crumbBloc" class="fades">
  231. <ul id="breadCrumb" class="fades">
  232. <li class="up">
  233. <a href="/"><img src="{{ asset('assets/img/icon_home.png') }}" alt="ホーム"></a>
  234. </li>
  235. <li class="up">カートの中身</li>
  236. </ul>
  237. <!-- ///// #breadCrumb +++++ ///// -->
  238. <!-- ///// +++++ #bread_crumbBloc +++++ ///// -->
  239. </div>
  240. {% endblock %}