app/template/ss4002/Block/cart.twig line 1

Open in your IDE?
  1. {#
  2. This file is part of EC-CUBE
  3. Copyright(c) LOCKON CO.,LTD. All Rights Reserved.
  4. http://www.lockon.co.jp/
  5. For the full copyright and license information, please view the LICENSE
  6. file that was distributed with this source code.
  7. #}
  8. {% set Carts = get_all_carts() %}
  9. {% set totalPrice = get_carts_total_price() %}
  10. {% set totalQuantity = get_carts_total_quantity() %}
  11. <div class="b-cart" id="js-cart">
  12.     <div class="b-cart__trigger" id="js-cart-trigger">
  13.         <div class="b-cart__menu">
  14.             <span class="b-cart__menu-badge">{{ totalQuantity|number_format }}</span>
  15.         </div>
  16.     </div>
  17.     <div class="b-cart__overlay js-cart-target" id="js-cart__overlay"></div>
  18.     {% if totalQuantity > 0 %}
  19.         <div class="b-cart__body js-cart-target">
  20.             <div class="b-cart__heading">
  21.                 <div class="b-cart__menu"></div>
  22.                 <div class="b-cart__price">
  23.                     <div class="b-cart__price-number">{{ totalPrice|price }}</div>
  24.                 </div>
  25.             </div>
  26.             {% for Cart in Carts %}
  27.                 {% for CartItem in Cart.CartItems %}
  28.                     {% set ProductClass = CartItem.ProductClass %}
  29.                     {% set Product = ProductClass.Product %}
  30.                     <div class="b-cart__item">
  31.                         <div class="b-cart__item-image">
  32.                             <img class="b-cart__item-image-pic" src="{{ asset(Product.MainListImage|no_image_product, 'save_image') }}" alt="{{ Product.name }}">
  33.                         </div>
  34.                         <div class="b-cart__item-contents">
  35.                             <p class="b-cart__item-name">{{ Product.name }}</p>
  36.                             {% if ProductClass.ClassCategory1 and ProductClass.ClassCategory1.id %}
  37.                                 <p class="b-cart__item-class-category">{{ ProductClass.ClassCategory1.ClassName.name }}:{{ ProductClass.ClassCategory1 }}</p>
  38.                             {% endif %}
  39.                             {% if ProductClass.ClassCategory2 and ProductClass.ClassCategory2.id %}
  40.                                 <p class="b-cart__item-class-category">{{ ProductClass.ClassCategory2.ClassName.name }}:{{ ProductClass.ClassCategory2 }}</p>
  41.                             {% endif %}
  42.                             <p class="b-cart__item-price">
  43.                                 <span class="b-cart__item-price--main">{{ CartItem.price|price }}</span>
  44.                                 <span class="b-cart__item-price--sub">{{ '税込'|trans }}</span>
  45.                             </p>
  46.                             <p class="b-cart__item-number">{{ '数量'|trans }} {{ CartItem.quantity|number_format }}</p>
  47.                         </div>
  48.                     </div>
  49.                 {% endfor %}
  50.             {% endfor %}
  51.             <div class="b-cart__actions">
  52.                 <div class="b-cart__actions-item">
  53.                     <a class="b-cart__button c-button is-secondary c-button--unelevated mdc-button mdc-button--unelevated" href="{{ url('cart') }}">
  54.                         <span class="c-button__label mdc-button__label">{{ 'カートへ進む'|trans }}</span>
  55.                     </a>
  56.                 </div>
  57.                 <div class="b-cart__actions-item">
  58.                     <a class="b-cart__button c-button c-button--unelevated is-primary mdc-button mdc-button--unelevated" id="js-cart-cancel">
  59.                         <span class="c-button__label mdc-button__label">{{ 'お買い物を続ける'|trans }}</span>
  60.                     </a>
  61.                 </div>
  62.             </div>
  63.         </div>
  64.     {% else %}
  65.         <div class="b-cart__body js-cart-target">
  66.             <div class="b-cart__heading">
  67.                 <div class="b-cart__menu"></div>
  68.                 <div class="b-cart__price">
  69.                     <div class="b-cart__price-number">{{ totalPrice|price }}</div>
  70.                 </div>
  71.             </div>
  72.             <div class="b-cart__message">
  73.                 <p>{{ '現在カート内に商品はございません。'|trans }}</p>
  74.             </div>
  75.             <div class="b-cart__actions">
  76.                 <div class="b-cart__actions-item">
  77.                     <a class="b-cart__button c-button c-button--unelevated is-primary mdc-button mdc-button--unelevated" id="js-cart-cancel">
  78.                         <span class="c-button__label mdc-button__label">{{ 'お買い物を続ける'|trans }}</span>
  79.                     </a>
  80.                 </div>
  81.             </div>
  82.         </div>
  83.     {% endif %}
  84. </div>