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

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/page/checkout/checkout-item.html.twig' %}
  2. {% block page_checkout_item %}
  3.     {% if controllerAction != "finishPage" %}
  4.         {# @fourtwosix-edit: if usePluginQmUnit is true we use code copied from fourtwosixBuyByQmUnit otherwise from fourtwosixAddPurchaseUnit #}
  5.         {% set productUnitAkeneoKey = page.cart.data.elements["product-"~ lineItem.id].unit.translated.customFields["akeneo_key"] %}
  6.         {% set productPurchaseUnit =  page.cart.data.elements["product-"~ lineItem.id].purchaseUnit %}
  7.         {# @fourtwosix-edit: Added productPurchaseUnit !== 1.0 to avoid showing it for every stuck with packboxstk = 1  #}
  8.     {% else %}
  9.         {% set productUnitAkeneoKey = lineItem.price.referencePrice.unitName %}
  10.         {% set productPurchaseUnit =  lineItem.price.referencePrice.purchaseUnit %}
  11.     {% endif %}
  12.     {% set enableUnitConversion =
  13.         productUnitAkeneoKey !== "set" and
  14.         productUnitAkeneoKey !== "box" and
  15.         (productPurchaseUnit !== null and productPurchaseUnit !== 1.0) %}
  16.     {% if lineItem.type == "product" %}
  17.         {% if enableUnitConversion %}
  18.             {% sw_include "storefront/page/checkout/checkout-item-fourtwosixBuyByQmUnit.html.twig" %}
  19.         {% else %}
  20.             {% sw_include "storefront/page/checkout/checkout-item-storefront.html.twig" %}
  21.         {% endif %}
  22.     {% elseif lineItem.type == "payment_cost" %}
  23.         {# @fourtwosix-edit: if is a surcharge use the plugins template #}
  24.         {{ block("page_checkout_item", "@FourtwosixPaymentSurcharge/storefront/page/checkout/checkout-item.html.twig") }}
  25.     {% elseif lineItem.type == "promotion" %}
  26.         {% if  lineItem.extensions.fourtwosixThemeExtension.deliveryDiscount %}
  27.             {%  sw_include "@FourtwosixPaymentSurcharge/storefront/page/checkout/fts-checkout-item.html.twig" %}
  28.         {% elseif not lineItem.extensions.fourtwosixThemeExtension.isApplied %}
  29.             {{ block("page_checkout_item", "@Storefront/storefront/page/checkout/checkout-item.html.twig") }}
  30.         {% endif %}
  31.     {% else %}
  32.         {{ block("page_checkout_item", "@Storefront/storefront/page/checkout/checkout-item.html.twig") }}
  33.     {% endif %}
  34. {% endblock %}