templates/cart/cart_listing.html.twig line 1

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.                             <div class="card-body">
  51.                                 {% for item in cart.items %}
  52.                                     {% set product = item.product %}
  53.                                     <div class="row">
  54.                                         <div class="col-4 col-sm-4 col-md-2 text-md-center text-sm-left ">
  55.                                             {% if(product.mainImage is defined) %}
  56.                                                 {{ product.mainImage.thumbnail('cart').html({imgAttributes: {class: 'img-responsive', style: 'width:100%; height: auto'}}) | raw }}
  57.                                             {% endif %}
  58.                                         </div>
  59.                                         <div class="col-8 text-sm-left col-md-5 text-md-left col-md-4">
  60.                                             <h6 style="padding-top: 3px" class="product-name">{{ product.oSName }}</h6>
  61.                                             {% if( product is instanceof('App\\Model\\Product\\Car')) %}
  62.                                                 <p class="text-muted small">{{ product.subText | raw }}</p>
  63.                                             {% elseif(product.saleInformation.saleInformation)  %}
  64.                                                 <p class="text-muted small">{{ 'general.condition' | trans }}: {{ ('attribute.' ~ product.saleInformation.saleInformation.condition) | trans }}</p>
  65.                                             {% endif %}
  66.                                             {% set priceInfo = item.priceInfo %}
  67.                                             {% if(priceInfo.rules) %}
  68.                                                 <div class="alert alert-success mb-1" role="alert">
  69.                                                     <p class="extra-small small mb-2"><strong>{{ 'general.your-benefits' | trans }}</strong></p>
  70.                                                     <ul class="list-unstyled mb-0 extra-small">
  71.                                                         {% for rule in priceInfo.rules %}
  72.                                                             <li>{{ rule.label }}</li>
  73.                                                         {% endfor %}
  74.                                                     </ul>
  75.                                                 </div>
  76.                                             {% endif %}
  77.                                         </div>
  78.                                         <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">
  79.                                             <div class="col-7 col-sm-7 col-md-8 text-right pr-0" style="padding-top: 3px">
  80.                                                 <h6>{{ item.price }}  <span class="text-muted">x</span></h6>
  81.                                             </div>
  82.                                             <div class="col-3 col-sm-3 col-md-3">
  83.                                                 <div class="quantity">
  84.                                                     <input name="items[{{ item.itemKey }}]" type="number" step="1" max="99" min="1" value="{{ item.count }}" title="Qty" class="qty w-100" size="4">
  85.                                                 </div>
  86.                                             </div>
  87.                                             <div class="col-2 col-sm-2 col-md-1 text-right px-md-0">
  88.                                                 <a href="{{ path('shop-remove-from-cart', {id: item.itemKey}) }}" class="btn btn-outline-danger btn-sm">
  89.                                                     <i class="fa fa-trash" aria-hidden="true"></i>
  90.                                                 </a>
  91.                                             </div>
  92.                                         </div>
  93.                                     </div>
  94.                                     <hr>
  95.                                 {% endfor %}
  96.                                 <div class="text-right">
  97.                                     <button type="submit" class="btn btn-outline-secondary text-right">
  98.                                         {{ 'cart.update-cart' | trans }}
  99.                                     </button>
  100.                                 </div>
  101.                             </div>
  102.                         </form>
  103.                     </div>
  104.                     {% if(cart.giftItems) %}
  105.                         <h6 class="mt-5 mb-0">Gifts</h6>
  106.                         <div class="card shopping-cart">
  107.                             <div class="card-body">
  108.                                 {% for item in cart.giftItems %}
  109.                                     {% set product = item.product %}
  110.                                     <div class="row">
  111.                                         <div class="col-4 col-sm-4 col-md-2 text-md-center text-sm-left ">
  112.                                             {% if(product.mainImage is defined) %}
  113.                                                 {{ product.mainImage.thumbnail('cart').html({imgAttributes: {class: 'img-responsive', style: 'width:100%; height: auto'}}) | raw }}
  114.                                             {% endif %}
  115.                                         </div>
  116.                                         <div class="col-8 text-sm-left text-md-left">
  117.                                             <h6 style="padding-top: 3px" class="product-name">{{ product.oSName }}</h6>
  118.                                             {% if( product is instanceof('App\\Model\\Product\\Car')) %}
  119.                                                 <p class="text-muted small">{{ product.subText | raw }}</p>
  120.                                             {% elseif(product.saleInformation.saleInformation)  %}
  121.                                                 <p class="text-muted small">{{ 'general.condition' | trans }}: {{ ('attribute.' ~ product.saleInformation.saleInformation.condition) | trans }}</p>
  122.                                             {% endif %}
  123.                                         </div>
  124.                                     </div>
  125.                                 {% endfor %}
  126.                             </div>
  127.                         </div>
  128.                     {% endif %}
  129.                 </div>
  130.             </div>
  131.         </div>
  132.     </div>
  133. {% endblock %}