app/template/uarts/Cart/index.twig line 1

Open in your IDE?
  1. {% extends 'default_frame.twig' %}
  2. {% set body_id = 'cart_page' %}
  3. {% block main %}
  4. <section>
  5.     <div class="main_ttl_wrap">
  6.         <h2 class="main_ttl">ショッピングカート</h2>
  7.     </div>
  8. </section>
  9. <div class="ec-cartRole__progress">
  10.     <ul class="ec-progress">
  11.         {% set step = 1 %}
  12.         <li class="ec-progress__item is-complete">
  13.             <div class="ec-progress__number">{{ step }}{% set step = step + 1 %}
  14.             </div>
  15.             <div class="ec-progress__label">{{ 'カートの商品'|trans }}
  16.             </div>
  17.         </li>
  18.         {% if is_granted('ROLE_USER') == false %}
  19.         <li class="ec-progress__item">
  20.             <div class="ec-progress__number">{{ step }}{% set step = step + 1 %}
  21.             </div>
  22.             <div class="ec-progress__label">{{ 'お客様情報'|trans }}
  23.             </div>
  24.         </li>
  25.         {% endif %}
  26.         <li class="ec-progress__item">
  27.             <div class="ec-progress__number">{{ step }}{% set step = step + 1 %}
  28.             </div>
  29.             <div class="ec-progress__label">{{ 'ご注文手続き'|trans }}
  30.             </div>
  31.         </li>
  32.         <li class="ec-progress__item">
  33.             <div class="ec-progress__number">{{ step }}{% set step = step + 1 %}
  34.             </div>
  35.             <div class="ec-progress__label">{{ 'ご注文内容確認'|trans }}
  36.             </div>
  37.         </li>
  38.         <li class="ec-progress__item">
  39.             <div class="ec-progress__number">{{ step }}{% set step = step + 1 %}
  40.             </div>
  41.             <div class="ec-progress__label">{{ '完了'|trans }}
  42.             </div>
  43.         </li>
  44.     </ul>
  45. </div>
  46. {% set productStr = app.session.flashbag.get('eccube.front.request.product') %}
  47. {% for error in app.session.flashbag.get('eccube.front.request.error') %}
  48. {% set idx = loop.index0 %}
  49. <div class="ec-cartRole__error">
  50.     <div class="ec-alert-warning">
  51.         <div class="ec-alert-warning__icon"><img src="{{ asset('assets/icon/exclamation-white.svg') }}"></div>
  52.         <div class="ec-alert-warning__text">
  53.             {% if productStr[idx] is defined %}
  54.             {{ error|trans({'%product%':productStr[idx]})|nl2br }}
  55.             {% else %}
  56.             {{ error|trans|nl2br }}
  57.             {% endif %}
  58.         </div>
  59.     </div>
  60. </div>
  61. {% endfor %}
  62. {% for error in app.session.flashbag.get('eccube.front.cart.error') %}
  63. <div class="ec-cartRole__error">
  64.     <div class="ec-alert-warning">
  65.         <div class="ec-alert-warning__icon"><img src="{{ asset('assets/icon/exclamation-white.svg') }}"></div>
  66.         <div class="ec-alert-warning__text">
  67.             {{ error|trans|nl2br }}
  68.         </div>
  69.     </div>
  70. </div>
  71. {% endfor %}
  72. {% if totalQuantity > 0 %}
  73. <div class="totalText center mb30">
  74.     <p>
  75.         {{ '商品の合計金額は「<strong>%price%</strong>」です。'|trans({ '%price%': totalPrice|price })|raw }}
  76.     </p>
  77. </div>
  78. {% if Carts|length > 1 %}
  79. <div class="ec-cartRole__error">
  80.     <div class="ec-alert-warning">
  81.         <div class="ec-alert-warning__text">
  82.             {{ '同時購入できない商品がカートに含まれています。'|trans|nl2br }}
  83.         </div>
  84.     </div>
  85. </div>
  86. {% endif %}
  87. <form name="form" id="form_cart" class="ec-cartRole" method="post" action="{{ url('cart') }}">
  88.     {% for CartIndex,Cart in Carts %}
  89.     {% set cartKey = Cart.cart_key %}
  90.     {% for error in app.session.flashbag.get('eccube.front.cart.' ~ cartKey ~ '.request.error') %}
  91.     <div class="ec-cartRole__error">
  92.         <div class="ec-alert-warning">
  93.             <div class="ec-alert-warning__icon"><img src="{{ asset('assets/icon/exclamation-white.svg') }}"></div>
  94.             <div class="ec-alert-warning__text">
  95.                 {{ error|trans|nl2br }}
  96.             </div>
  97.         </div>
  98.     </div>
  99.     {% endfor %}
  100.     <div class="form_area cart_area sp_ml5 sp_mr5">
  101.         <table class="cart_table">
  102.             <tr>
  103.                 <th>商品情報</th>
  104.                 <th>数量</th>
  105.                 <th>価格</th>
  106.                 <th>削除</th>
  107.             </tr>
  108.             {% for CartItem in Cart.CartItems %}
  109.             {% set ProductClass = CartItem.ProductClass %}
  110.             {% set Product = ProductClass.Product %}
  111.             <tr>
  112.                 <td>
  113.                     <div class="cartform_img">
  114.                         <a target="_blank" href="{{ url('product_detail', {id : Product.id} ) }}">
  115.                             <img src="{{ asset(Product.MainListImage|no_image_product, 'save_image') }}"
  116.                                 alt="{{ Product.name }}" />
  117.                         </a>
  118.                     </div>
  119.                     <div class="cartform_name">
  120.                         <a target="_blank" href="{{ url('product_detail', {id : Product.id} ) }}">{{ Product.name }}</a>
  121.                         {% if ProductClass.ClassCategory1 and ProductClass.ClassCategory1.id %}
  122.                         <br>{{ ProductClass.ClassCategory1.ClassName.name }}:{{ ProductClass.ClassCategory1 }}
  123.                         {% endif %}
  124.                         {% if ProductClass.ClassCategory2 and ProductClass.ClassCategory2.id %}
  125.                         <br>{{ ProductClass.ClassCategory2.ClassName.name }}:{{ ProductClass.ClassCategory2 }}
  126.                         {% endif %}
  127.                         {% if CartItem.CustomCartItemPrice is not empty %}
  128.                         <div class="">
  129.                             ヨコ幅:{{CartItem.CustomCartItemPrice.width}}mm
  130.                         </div>
  131.                         <div class="">
  132.                             タテ長:{{CartItem.CustomCartItemPrice.height}}mm
  133.                         </div>
  134.                         
  135.                         <div class="">
  136.                             本体価格:{{CartItem.CustomCartItemPrice.price|price}}
  137.                         </div>
  138.                         <div class="">
  139.                             面取り加工:{{getChamfer(CartItem.CustomCartItemPrice.chamfer)}} {{CartItem.CustomCartItemPrice.chamfer_price|price}}
  140.                         </div>
  141.                         
  142.                         <div class="">
  143.                             取付金具:{{getMounting(CartItem.CustomCartItemPrice.mounting)}} {{CartItem.CustomCartItemPrice.mounting_price|price}}
  144.                         </div>
  145.                         
  146.                         {# <div class="">
  147.                             吊り金具・ヒモ(無料):{{getHanging(CartItem.CustomCartItemPrice.hanging)}}
  148.                         </div>
  149.                         <div class="">
  150.                             ゴム足(無料):{{getRubber(CartItem.CustomCartItemPrice.rubber)}}
  151.                         </div> #}
  152.                         {% endif %}
  153.                     </div>
  154.                 </td>
  155.                 <td>
  156.                     <div class="cart_amount_updown">
  157.                         {% if CartItem.quantity > 1 %}
  158.                         <a href="{{ url('cart_handle_item', {'operation': 'down', 'productClassId': ProductClass.id}) }}"
  159.                             {{ csrf_token_for_anchor() }} class="ec-cartRow__amountDownButton load-overlay"
  160.                             data-method="put" data-confirm="false">
  161.                             <img src="{{ asset('assets/img/icon/cart_minus.svg') }}" alt="マイナス">
  162.                         </a>
  163.                         {% else %}
  164.                         <a href="javascript:;" style="opacity: 0.5;">
  165.                             <img src="{{ asset('assets/img/icon/cart_minus.svg') }}" alt="マイナス">
  166.                         </a>
  167.                         {% endif %}
  168.                         <p class="cart_amount">{{ CartItem.quantity|number_format }}</p>
  169.                         <a href="{{ url('cart_handle_item', {'operation': 'up', 'productClassId': ProductClass.id}) }}"
  170.                             {{ csrf_token_for_anchor() }} class="ec-cartRow__amountUpButton load-overlay"
  171.                             data-method="put" data-confirm="false">
  172.                             <img src="{{ asset('assets/img/icon/cart_plus.svg') }}" alt="プラス">
  173.                         </a>
  174.                     </div>
  175.                 </td>
  176.                 <td>
  177.                     <div class="cart_price">{{ CartItem.price|price }}</div>
  178.                 </td>
  179.                 <td>
  180.                     <div class="cart_delate">
  181.                         <a href="{{ url('cart_handle_item', {'operation': 'remove', 'productClassId': ProductClass.id }) }}"
  182.                             {{ csrf_token_for_anchor() }} class="ec-icon" data-method="put"
  183.                             data-message="カートから商品を削除してもよろしいですか?">
  184.                             <img src="{{ asset('assets/img/icon/cart_delate.svg') }}" alt="delete" class="pc">
  185.                             <span class="sp">削除</span>
  186.                         </a>
  187.                     </div>
  188.                 </td>
  189.             </tr>
  190.             {% endfor %}
  191.         </table>
  192.         <div class="cart_total">
  193.             <p class="txt_total">合計金額<strong>{{ Cart.totalPrice|price }}</strong><span>円(税込)</span></p>
  194.             {% if BaseInfo.isOptionPoint and is_granted('ROLE_USER') %}
  195.             <p class="txt_point">{{Cart.add_point}}ポイント獲得できます</p>
  196.             {% endif %}
  197.            
  198.             <div class="">
  199.                 <p>送料:全国一律 1,320円(税込)</p>
  200.                 
  201.                 {% if BaseInfo.delivery_free_amount and BaseInfo.delivery_free_quantity %}
  202.                    
  203.                     {% if is_delivery_free[cartKey] %}
  204.                         {{ '送料:無料'|trans }}
  205.                     {% else %}
  206.                         {{ 'あと「<strong>%price%</strong>」または「<strong>%quantity%個</strong>」のお買い上げで<strong class="ec-color-red">送料無料</strong>になります。'|trans({ '%price%': least[cartKey]|price, '%quantity%': quantity[cartKey]|number_format })|raw }}
  207.                     {% endif %}
  208.                 {% elseif BaseInfo.delivery_free_amount %}
  209.                   
  210.                     {% if is_delivery_free[cartKey] %}
  211.                         {{ '送料:無料'|trans }}
  212.                     {% else %}
  213.                         {{ 'あと「<strong>%price%</strong>」のお買い上げで<strong class="ec-color-red">送料無料</strong>になります。'|trans({ '%price%': least[cartKey]|price })|raw }}
  214.                     {% endif %}
  215.                 {% elseif BaseInfo.delivery_free_quantity %}
  216.                     
  217.                     {% if is_delivery_free[cartKey] %}
  218.                         {{ '送料:無料'|trans }}
  219.                     {% else %}
  220.                         {{ 'あと「<strong>%quantity%個</strong>」のお買い上げで<strong class="ec-color-red">送料無料</strong>になります。'|trans({ '%quantity%': quantity[cartKey]|number_format })|raw }}
  221.                     {% endif %}
  222.                 {% endif %}
  223.             </div>
  224.         </div>
  225.         <div class="flex_btn between">
  226.             {% if loop.last %}
  227.             <a class="cart_back_btn btn" href="{{ path('homepage') }}">買い物を続ける</a>
  228.             {% endif %}
  229.             <a href="{{ path('cart_buystep', {'cart_key':cartKey}) }}"
  230.                 class="cart_btn btn no_arrow"><span>ご購入手続きへ進む</span></a>
  231.         </div>
  232.     </div>
  233.     {% endfor %}
  234. </form>
  235. {% else %}
  236. {% for CartIndex,Cart in Carts %}
  237. {% set cartKey = Cart.cart_key %}
  238. {% for error in app.session.flashbag.get('eccube.front.cart.' ~ cartKey ~ '.request.error') %}
  239. <div class="ec-cartRole__error">
  240.     <div class="ec-alert-warning">
  241.         <div class="ec-alert-warning__icon"><img src="{{ asset('assets/icon/exclamation-white.svg') }}"></div>
  242.         <div class="ec-alert-warning__text">
  243.             {{ error|trans|nl2br }}
  244.         </div>
  245.     </div>
  246. </div>
  247. {% endfor %}
  248. {% endfor %}
  249. <div class="ec-role">
  250.     <div class="ec-off3Grid">
  251.         <div class="ec-off3Grid__cell">
  252.             <div class="ec-alert-warning">
  253.                 <div class="ec-alert-warning__icon"><img src="{{ asset('assets/icon/exclamation-white.svg') }}"></div>
  254.                 <div class="ec-alert-warning__text">{{ '現在カート内に商品はございません。'|trans }}</div>
  255.             </div>
  256.         </div>
  257.     </div>
  258. </div>
  259. {% endif %}
  260. <style>
  261.     .ec-cartRole {
  262.         display: block;
  263.         padding: 0;
  264.     }
  265. </style>
  266. {% endblock %}