themes/webapicTheme/templates/bundles/SyliusShopBundle/Checkout/_summary.html.twig line 1

Open in your IDE?
  1. {% import "@SyliusShop/Common/Macro/money.html.twig" as money %}
  2. {% set itemsSubtotal = sylius_order_items_subtotal(order) %}
  3. {% set taxIncluded = sylius_order_tax_included(order) %}
  4. {% set taxExcluded = sylius_order_tax_excluded(order) %}
  5.     {# {{ dump(order.items) }} #}
  6. <div class="checkout-right-summary">
  7.     <table class="ui very basic table" id="sylius-checkout-subtotal" {{ sylius_test_html_attribute('checkout-subtotal') }}>
  8.         <thead>
  9.         {# <tr>
  10.             <th class="sylius-table-column-item">{{ 'sylius.ui.item'|trans }}</th>
  11.             <th class="sylius-table-column-qty">{{ 'sylius.ui.qty'|trans }}</th>
  12.             <th class="sylius-table-column-subtotal">{{ 'sylius.ui.subtotal'|trans }}</th>
  13.         </tr> #}
  14.         </thead>
  15.         <tbody>
  16.         {% for item in order.items %}
  17.             <tr>
  18.                 <td>
  19.                 
  20.                      {% include '@SyliusShop/Product/_mainImage.html.twig' with {'product': item.variant, 'filter': 'sylius_shop_product_tiny_thumbnail'} %}
  21.                     <span>{{ item.quantity }}</span>
  22.                 </td>
  23.                 <td>
  24.                     {{ item.getVariant.product.name }}
  25.                     <small>
  26.                         {% for adjustment in item.adjustments %}
  27.                             ({{ adjustment.label }})
  28.                         {% endfor %}
  29.                     <small>
  30.                 </td>                
  31.                 <td class="right aligned" id="sylius-item-{{ item.variant.product.slug }}-subtotal" {{ sylius_test_html_attribute('item-subtotal', item.variant.product.slug) }}>
  32.                     {{ money.convertAndFormat(item.subtotal) }}
  33.                    
  34.                 </td>
  35.             </tr>
  36.         {% endfor %}
  37.         </tbody>
  38.       
  39.             <tfoot>
  40.                
  41.                 <tr>
  42.                     <td colspan="1" style="border-top: 2px solid #ddd;">
  43.                         <strong>{{ 'sylius.ui.items_total'|trans }}:</strong>
  44.                     </td>
  45.                     <td colspan="2" id="sylius-summary-items-subtotal" class="right aligned" style="border-top: 2px solid #ddd;">
  46.                         {{ money.convertAndFormat(itemsSubtotal) }}
  47.                     </td>
  48.                 </tr>
  49.                  {# {% if taxIncluded or taxExcluded %}
  50.                     <tr {% if taxIncluded and not taxExcluded %}{% endif %}>
  51.                         <td colspan="1">
  52.                             <strong>{{ 'sylius.ui.taxes_total'|trans }}:</strong>
  53.                         </td>
  54.                         <td colspan="2" class="right aligned">
  55.                             {% if not taxIncluded and not taxExcluded %}
  56.                                 <div id="sylius-summary-tax-none">{{ money.convertAndFormat(0) }}</div>
  57.                             {% endif %}
  58.                             {% if taxExcluded %}
  59.                                 <div id="sylius-summary-tax-excluded">{{ money.convertAndFormat(taxExcluded) }}</div>
  60.                             {% endif %}
  61.                             {% if taxIncluded %}
  62.                                 <div>
  63.                                     <span id="sylius-summary-tax-included">{{ money.convertAndFormat(taxIncluded) }}</span>
  64.                                    
  65.                                 </div>
  66.                             {% endif %}
  67.                         </td>
  68.                     </tr>
  69.                 {% endif %} #}
  70.            
  71.             {% if order.shipments is not empty %}
  72.                 <tr>
  73.                     <td colspan="1">
  74.                         <strong>{{ 'app.front.commande.estimation'|trans }}:</strong>
  75.                     </td>
  76.                     <td colspan="2" class="right aligned">
  77.                         {% if order.getAdjustmentsTotal('shipping') > order.shippingTotal %}
  78.                             <div class="old-price">{{ money.convertAndFormat(order.getAdjustmentsTotal('shipping')) }}</div>
  79.                         {% endif %}
  80.                         <span id="sylius-summary-shipping-total">{{ money.convertAndFormat(order.shippingTotal) }}</span>
  81.                     </td>
  82.                 </tr>
  83.             {% endif %}
  84.             {% if order.getOrderPromotionTotalWithoutGiftCard != 0 %}
  85.                 <tr class="discount">
  86.                     <td   colspan="1">
  87.                         <strong>Total {{ 'sylius.ui.discount'|trans }}:</strong>
  88.                     </td>
  89.                     <td colspan="2" id="sylius-summary-promotion-total" class="right aligned">
  90.                         {{ money.convertAndFormat(order.getOrderPromotionTotalWithoutGiftCard) }} 
  91.                     </td>
  92.                 </tr>
  93.             {% endif %}
  94.             {% if order.getAlreadyPaid is not empty %}
  95.                 {% for payment in order.getAlreadyPaid %}
  96.                     <tr>
  97.                         <td colspan="1">
  98.                             <strong>{{payment.method}}</strong>
  99.                         </td>
  100.                         <td colspan="2" class="right aligned">
  101.                             <span id="sylius-summary-shipping-total">- {{money.convertAndFormat(payment.amount)}}</span>
  102.                         </td>
  103.                     </tr>
  104.                  {% endfor %}
  105.             {% endif %}
  106.             {# {{order.getAlreadyPaid}}
  107.              #}
  108.             <tr class="ui large">
  109.                 <td colspan="1">
  110.                     <strong>                        {# {{ 'sylius.ui.order_total'|trans }}: #}
  111.                         {{ 'app.front.panier.total'|trans }}                         
  112.                     </strong>
  113.                     {# <small>({{ 'app.front.panier.tvaincluse'|trans }})</small> #}
  114.                 </td>
  115.                 <td colspan="2" id="sylius-summary-grand-total" class="right aligned">
  116.                     {{ money.convertAndFormat(order.total) }}
  117.                     {# {{ order.leftToPay }} #}
  118.                 </td>
  119.             </tr>
  120.         </tfoot>
  121.     </table>
  122. </div>