custom/plugins/FourtwosixThemeExtension/src/Resources/views/storefront/page/checkout/checkout-item-fourtwosixBuyByQmUnit.html.twig line 124

Open in your IDE?
  1. {# @deprecated tag:v6.5.0 - Template `checkout-item.html.twig` is deprecated. Use `storefront/component/line-item/line-item.html.twig` instead. #}
  2. {% block page_checkout_item %}
  3.     {% set PRODUCT_LINE_ITEM_TYPE = constant('Shopware\\Core\\Checkout\\Cart\\LineItem\\LineItem::PRODUCT_LINE_ITEM_TYPE') %}
  4.     {% set deliveryPosition = null %}
  5.     {% if page.cart.deliveries.count > 0 %}
  6.         {% set delivery = page.cart.deliveries.first %}
  7.         {% set deliveryPosition = delivery.positions.get(lineItem.id) %}
  8.     {% endif %}
  9.     {% set label = lineItem.label %}
  10.     {% set appliedDiscount = lineItem.extensions.fourtwosixThemeExtension.appliedDiscount %}
  11.     {% block page_checkout_item_container %}
  12.         <div class="cart-item cart-item-{{ lineItem.type }} fourtwosix-qm-unit" data-buybyqmunit-plugin="true">
  13.             <div class="row cart-item-row">
  14.                 {{ block("page_checkout_item_info", "@Storefront/storefront/page/checkout/checkout-item.html.twig") }}
  15.                 {% if controllerAction != "finishPage" %}
  16.                     <div class="col-12 col-sm-8 col-md-4 cart-item-quantity">
  17.                         {% if lineItem.quantityInformation and lineItem.stackable and not isChild %}
  18.                             <form action="{{ path('frontend.checkout.line-item.change-quantity', {'id': lineItem.id}) }}"
  19.                                 class="cart-item-quantity-container cartForm"
  20.                                 method="post"
  21.                                 data-form-auto-submit="true">
  22.                                 {{ sw_csrf('frontend.checkout.line-item.change-quantity') }}
  23.                                 {% if activeRoute == "frontend.checkout.cart.page" %}
  24.                                     <input type="hidden" name="redirectTo" value="frontend.checkout.cart.page">
  25.                                 {% elseif activeRoute == "frontend.checkout.confirm.page" %}
  26.                                     <input type="hidden" name="redirectTo" value="frontend.checkout.confirm.page">
  27.                                 {% endif %}
  28.                                 {% set quantityUnit = page.cart.data.elements["product-"~ lineItem.id].purchaseUnit %}
  29.                                 {% set quantityPack = page.cart.data.elements["product-"~ lineItem.id].referenceUnit %}
  30.                                 {% set minPurchase = page.cart.data.elements["product-"~ lineItem.id].minPurchase %}
  31.                                 {% set purchaseSteps = page.cart.data.elements["product-"~ lineItem.id].purchaseSteps %}
  32.                                 {% set availableStock = lineItem.payload.isCloseout ? lineItem.quantityInformation.maxPurchase : config('core.cart.maxQuantity') %}
  33.                                 {% sw_include '@Storefront/storefront/component/product/card/price-qm-unit.html.twig' with {
  34.                                     'isCloseout': lineItem.payload.isCloseout,
  35.                                     'stock': availableStock,
  36.                                     'priceUnit': lineItem.price.unitPrice,
  37.                                     'sellingUnit': quantityUnit * lineItem.quantity,
  38.                                     'packUnit': lineItem.quantity,
  39.                                     'quantityInputName': "quantity",
  40.                                     'quantityInputClasses': 'quantity-select',
  41.                                     'translatedUnitName' : lineItem.price.referencePrice.unitName,
  42.                                     'minPurchase': minPurchase,
  43.                                     "purchaseSteps": purchaseSteps,
  44.                                     "sellingStep":  quantityUnit * lineItem.quantity,
  45.                                 } %}
  46.                             </form>
  47.                         {% endif %}
  48.                     </div>
  49.                 {% else %}
  50.                     <div class="col-12 col-sm-2 col-md-2 cart-item-quantity justify-content-end">
  51.                         <div>
  52.                             <div class="font-weight-bold">
  53.                                 {{ lineItem.price.referencePrice.unitName }}
  54.                             </div>
  55.                             {{ lineItem.price.referencePrice.purchaseUnit * lineItem.quantity }}
  56.                         </div>
  57.                     </div>
  58.                     <div class="col-12 col-sm-2 col-md-2 cart-item-quantity justify-content-end">
  59.                         <div>
  60.                             <div class="font-weight-bold">
  61.                                 {{ "checkout.cartHeaderQuantity"|trans|sw_sanitize }}
  62.                             </div>
  63.                             {{ lineItem.quantity }}
  64.                         </div>
  65.                     </div>
  66.                 {% endif %}
  67.                 {% block page_checkout_item_total_price_qm %}
  68.                     <div class="col-12 col-sm-4 col-md-2 cart-item-price text-right">
  69.                         <div class="cart-item-unit-price">
  70.                             <div class="cart-item-unit-price-label font-weight-bold">
  71.                                 {{ "checkout.cartHeaderUnitPrice"|trans|sw_sanitize }}
  72.                             </div>
  73.                             <div>
  74.                                 {% if appliedDiscount %}
  75.                                     {% set discountProQuantity = (appliedDiscount / lineItem.quantity) %}
  76.                                     <div class="font-weight-bold">
  77.                                         <span class="text-decoration-line-through">
  78.                                             {{ lineItem.price.unitPrice|currency }}
  79.                                         </span>
  80.                                         <span class="text-danger">
  81.                                             {{ (lineItem.price.unitPrice - discountProQuantity)|currency }}
  82.                                         </span>
  83.                                     </div>
  84.                                     <div>
  85.                                         ({{ (lineItem.price.referencePrice.price -
  86.                                         (discountProQuantity / lineItem.price.referencePrice.purchaseUnit)
  87.                                         )|currency }}/{{ lineItem.price.referencePrice.referenceUnit }}{{ lineItem.price.referencePrice.unitName }})
  88.                                     </div>
  89.                                 {% else %}
  90.                                     <span>
  91.                                         {{ lineItem.price.unitPrice|currency }}
  92.                                     </span>
  93.                                     <div>
  94.                                         ({{ lineItem.price.referencePrice.price|currency }}/{{ lineItem.price.referencePrice.referenceUnit }}{{ lineItem.price.referencePrice.unitName }})
  95.                                     </div>
  96.                                 {% endif %}
  97.                             </div>
  98.                         </div>
  99.                         <div class="cart-item-unit-price mt-md-2">
  100.                             <div class="cart-item-total-price-label fts-qm">
  101.                                 {{ "checkout.cartHeaderTotalPrice"|trans|sw_sanitize }}
  102.                             </div>
  103.                             <div class="font-weight-bold totalPrice {% if appliedDiscount %}text-danger{% endif %}">
  104.                                 {{ (lineItem.price.totalPrice - appliedDiscount)|currency }}
  105.                                 {{ "general.star"|trans|sw_sanitize }}
  106.                             </div>
  107.                         </div>
  108.                     </div>
  109.                 {% endblock %}
  110.                 {% if controllerAction != "finishPage" %}
  111.                     {{ block("page_checkout_item_remove", "@Storefront/storefront/page/checkout/checkout-item.html.twig") }}
  112.                 {% endif %}
  113.             </div>
  114.         </div>
  115.     {% endblock %}
  116. {% endblock %}