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

Open in your IDE?
  1. {#
  2. This file is part of EC-CUBE
  3. Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  4. http://www.ec-cube.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. <style>
  9. /*全てに適用*/    
  10. /*ウィンドウ幅が767px以上の場合に適用*/
  11. @media screen and (min-width: 767px) { 
  12. }    
  13.     
  14.     
  15.     }
  16. /*ウィンドウ幅が最大767pxまでの場合に適用*/
  17. @media screen and (max-width: 767px) { 
  18.     }
  19.     
  20. </style>
  21. {% set Carts = get_all_carts() %}
  22. {% set totalPrice = get_carts_total_price() %}
  23. {% set totalQuantity = get_carts_total_quantity() %}
  24. <div class="ec-cartNaviWrap">
  25.     <div class="ec-cartNavi">
  26.         <i class="ec-cartNavi__icon fas fa-shopping-cart">
  27.             <span class="ec-cartNavi__badge">{{ totalQuantity|number_format }}</span>
  28.         </i>
  29.         <div class="ec-cartNavi__label">
  30.             <div class="ec-cartNavi__price">{{ totalPrice|price }}</div>
  31.         </div>
  32.     </div>
  33.     
  34.     {#{% if totalQuantity > 0 %}#}
  35.     {#    <div class="ec-cartNaviIsset">#}
  36.     {#        {% for Cart in Carts %}#}
  37.     {#            {% for CartItem in Cart.CartItems %}#}
  38.     {#                {% set ProductClass = CartItem.ProductClass %}#}
  39.     {#                {% set Product = ProductClass.Product %}#}
  40.     {#                <div class="ec-cartNaviIsset__cart">#}
  41.     {#                    <div class="ec-cartNaviIsset__cartImage">#}
  42.     {#                        <img src="{{ asset(Product.MainListImage|no_image_product, 'save_image') }}" alt="{{ Product.name }}">#}
  43.     {#                    </div>#}
  44.     {#                    <div class="ec-cartNaviIsset__cartContent">#}
  45.     {#                        <div class="ec-cartNaviIsset__cartContentTitle">{{ Product.name }}#}
  46.     {#                            <div class="ec-font-size-1">#}
  47.     {#                                {% if ProductClass.ClassCategory1 and ProductClass.ClassCategory1.id %}#}
  48.     {#                                    {{ ProductClass.ClassCategory1.ClassName.name }}:{{ ProductClass.ClassCategory1 }}#}
  49.     {#                                {% endif %}#}
  50.     {#                                {% if ProductClass.ClassCategory2 and ProductClass.ClassCategory2.id %}#}
  51.     {#                                    <br>{{ ProductClass.ClassCategory2.ClassName.name }}:{{ ProductClass.ClassCategory2 }}#}
  52.     {#                                {% endif %}#}
  53.     {#                            </div>#}
  54.     {#                        </div>#}
  55.     {#                        <div class="ec-cartNaviIsset__cartContentPrice">#}
  56.     {#                            {{ CartItem.price|price }}#}
  57.     {#                            <div class="ec-cartNaviIsset__cartContentTax">{{ '税込'|trans }}</div>#}
  58.     {#                        </div>#}
  59.     {#                        <div class="ec-cartNaviIsset__cartContentNumber">{{ '数量'|trans }} {{ CartItem.quantity|number_format }}</div>#}
  60.     {#                    </div>#}
  61.     {#                </div>#}
  62.     {#            {% endfor %}#}
  63.     {#        {% endfor %}#}
  64.     {#        <div class="ec-cartNaviIsset__action">#}
  65.     {#            <a class="ec-blockBtn--action" href="{{ url('cart') }}">{{ 'カートへ進む'|trans }}</a>#}
  66.     {#            <a class="ec-blockBtn ec-cartNavi--cancel">{{ 'キャンセル'|trans }}</a>#}
  67.     {#        </div>#}
  68.     {#    </div>#}
  69.     {#{% else %}#}
  70.     {#    <div class="ec-cartNaviNull">#}
  71.     {#        <div class="ec-cartNaviNull__message">#}
  72.     {#            <p>{{ '現在カート内に商品はございません。'|trans }}</p>#}
  73.     {#        </div>#}
  74.     {#    </div>#}
  75.     {#{% endif %}#}
  76. </div>