templates/cart/cart_listing.html.twig line 78

Open in your IDE?
  1. {# @var cart \Pimcore\Bundle\EcommerceFrameworkBundle\CartManager\CartInterface #}
  2. {# @var product \App\Model\Product\AbstractProduct #}
  3. {% extends 'layouts/layout.html.twig' %}
  4. {% block content %}
  5.     <div class="py-5 bg-light">
  6.         <div class="container">
  7.             <div class="row">
  8.                 <div class="col-md-4 order-md-2 mb-4">
  9.                     {% include 'cart/shared/order_summary.html.twig' %}
  10.                     <form method="post" action="{{ path('shop-cart-apply-voucher') }}" class="card p-2 mb-4">
  11.                         {% if(cart.pricingManagerTokenInformationDetails | length > 0) %}
  12.                             <ul class="list-group pb-3">
  13.                             {% for codeInfo in cart.pricingManagerTokenInformationDetails %}
  14.                                 <li class="list-group-item">
  15.                                     <div class="row">
  16.                                         <div class="col-10" style="padding-top: 4px">
  17.                                             <div>{{ codeInfo.tokenCode }}</div>
  18.                                             {% if (codeInfo.errorMessages | length) > 0 %}
  19.                                                 <small class="text-muted"><i class="fas fa-exclamation-triangle"></i> {{ codeInfo.errorMessages | join(', ') }}</small>
  20.                                             {% endif %}
  21.                                             {% if (codeInfo.noValidRule) %}
  22.                                                 <small class="text-muted"><i class="fas fa-exclamation-triangle"></i> {{ 'cart.voucher-no-rule' | trans }}</small>
  23.                                             {% endif %}
  24.                                         </div>
  25.                                         <div class="col-2">
  26.                                             <a href="{{ path('shop-cart-remove-voucher', {'voucher-code': codeInfo.tokenCode}) }}" class="btn btn-outline-danger btn-sm">
  27.                                                 <i class="fa fa-trash" aria-hidden="true"></i>
  28.                                             </a>
  29.                                         </div>
  30.                                     </div>
  31.                                 </li>
  32.                             {% endfor %}
  33.                             </ul>
  34.                         {% endif %}
  35.                         <div class="input-group">
  36.                             <input name="voucher-code" type="text" class="form-control" placeholder="{{ 'cart.voucher-code' | trans }}">
  37.                             <div class="input-group-append">
  38.                                 <button type="submit" class="btn btn-secondary">{{ 'cart.apply-voucher-code' | trans }}</button>
  39.                             </div>
  40.                         </div>
  41.                     </form>
  42.                     <div class="card p-2">
  43.                         <a href="{{ path('shop-checkout-address') }}" class="btn btn-success btn-lg">{{ 'cart.start-checkout' | trans }}</a>
  44.                     </div>
  45.                 </div>
  46.                 <div class="col-md-8 order-md-1">
  47.                     <h4 class="mb-3">{{ 'cart.title' | trans }}</h4>
  48.                     <div class="card shopping-cart">
  49.                         <form method="post">
  50.                             <input type="hidden" name="_csrf_token" value="{{ csrf_token('cartListing') }}">
  51.                             <div class="card-body">
  52.                                 {% for item in cart.items %}
  53.                                     {% set product = item.product %}
  54.                                     <div class="row">
  55.                                         <div class="col-4 col-sm-4 col-md-2 text-md-center text-sm-left ">
  56.                                             {% if(product.mainImage is not empty) %}
  57.                                                 {{ product.mainImage.thumbnail('cart').html({imgAttributes: {class: 'img-responsive', style: 'width:100%; height: auto'}}) | raw }}
  58.                                             {% endif %}
  59.                                         </div>
  60.                                         <div class="col-8 text-sm-left col-md-5 text-md-left col-md-4">
  61.                                             <h6 style="padding-top: 3px" class="product-name">{{ product.oSName }}</h6>
  62.                                             {% if( product is instanceof('App\\Model\\Product\\Car')) %}
  63.                                                 <p class="text-muted small">{{ product.subText | raw }}</p>
  64.                                             {% elseif(product.saleInformation is not empty and product.saleInformation.saleInformation)  %}
  65.                                                 <p class="text-muted small">{{ 'general.condition' | trans }}: {{ ('attribute.' ~ product.saleInformation.saleInformation.condition) | trans }}</p>
  66.                                             {% endif %}
  67.                                             {% set priceInfo = item.priceInfo %}
  68.                                             {% if(priceInfo.rules) %}
  69.                                                 <div class="alert alert-success mb-1" role="alert">
  70.                                                     <p class="extra-small small mb-2"><strong>{{ 'general.your-benefits' | trans }}</strong></p>
  71.                                                     <ul class="list-unstyled mb-0 extra-small">
  72.                                                         {% for rule in priceInfo.rules %}
  73.                                                             <li>{{ rule.label }}</li>
  74.                                                         {% endfor %}
  75.                                                     </ul>
  76.                                                 </div>
  77.                                             {% endif %}
  78.                                         </div>
  79.                                         <div class="col-12 col-sm-12 text-sm-center col-md-5 text-md-right row pt-md-0 pt-2 ml-0 ml-md-n1">
  80.                                             <div class="col-7 col-sm-7 col-md-8 text-right pr-0" style="padding-top: 3px">
  81.                                                 <h6>{{ item.price }}  <span class="text-muted">x</span></h6>
  82.                                             </div>
  83.                                             <div class="col-3 col-sm-3 col-md-3">
  84.                                                 <div class="quantity">
  85.                                                     <input name="items[{{ item.itemKey }}]" type="number" step="1" max="99" min="1" value="{{ item.count }}" title="Qty" class="qty w-100" size="4">
  86.                                                 </div>
  87.                                             </div>
  88.                                             <div class="col-2 col-sm-2 col-md-1 text-right px-md-0">
  89.                                                 <a href="{{ path('shop-remove-from-cart', {id: item.itemKey}) }}" class="btn btn-outline-danger btn-sm">
  90.                                                     <i class="fa fa-trash" aria-hidden="true"></i>
  91.                                                 </a>
  92.                                             </div>
  93.                                         </div>
  94.                                     </div>
  95.                                     <hr>
  96.                                 {% endfor %}
  97.                                 <div class="text-right">
  98.                                     <button type="submit" class="btn btn-outline-secondary text-right">
  99.                                         {{ 'cart.update-cart' | trans }}
  100.                                     </button>
  101.                                 </div>
  102.                             </div>
  103.                         </form>
  104.                     </div>
  105.                     {% if(cart.giftItems) %}
  106.                         <h6 class="mt-5 mb-0">Gifts</h6>
  107.                         <div class="card shopping-cart">
  108.                             <div class="card-body">
  109.                                 {% for item in cart.giftItems %}
  110.                                     {% set product = item.product %}
  111.                                     <div class="row">
  112.                                         <div class="col-4 col-sm-4 col-md-2 text-md-center text-sm-left ">
  113.                                             {% if(product.mainImage is defined) %}
  114.                                                 {{ product.mainImage.thumbnail('cart').html({imgAttributes: {class: 'img-responsive', style: 'width:100%; height: auto'}}) | raw }}
  115.                                             {% endif %}
  116.                                         </div>
  117.                                         <div class="col-8 text-sm-left text-md-left">
  118.                                             <h6 style="padding-top: 3px" class="product-name">{{ product.oSName }}</h6>
  119.                                             {% if( product is instanceof('App\\Model\\Product\\Car')) %}
  120.                                                 <p class="text-muted small">{{ product.subText | raw }}</p>
  121.                                             {% elseif(product.saleInformation.saleInformation)  %}
  122.                                                 <p class="text-muted small">{{ 'general.condition' | trans }}: {{ ('attribute.' ~ product.saleInformation.saleInformation.condition) | trans }}</p>
  123.                                             {% endif %}
  124.                                         </div>
  125.                                     </div>
  126.                                 {% endfor %}
  127.                             </div>
  128.                         </div>
  129.                     {% endif %}
  130.                 </div>
  131.             </div>
  132.         </div>
  133.     </div>
  134. {% endblock %}