custom/plugins/SwpSampleOrderSix/src/Resources/views/storefront/component/product/card/price-unit.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/component/product/card/price-unit.html.twig' %}
  2. {% set SwpSampleOrderSixConfig = config('SwpSampleOrderSix.config') %}
  3. {% block component_product_box_price %}
  4.     {% if SwpSampleOrderSixConfig.channelActive is same as(true)
  5.         and product.customFields.sample_order_six_flag == true %}
  6.         <div class="product-price-wrapper">
  7.             {% set price = real %}
  8.             {% set isListPrice = price.listPrice.percentage > 0 %}
  9.             {% set isRegulationPrice = price.regulationPrice != null %}
  10.             <div class="product-cheapest-price{% if isListPrice and isRegulationPrice and not displayFrom and not displayFromVariants %} with-list-price{% endif %}{% if isRegulationPrice and not displayFrom and displayFromVariants %} with-regulation-price{% endif %}{% if displayFrom and isRegulationPrice %} with-from-price{% endif %}">
  11.                 {% if cheapest.unitPrice != real.unitPrice %}
  12.                     <div>{{ "listing.cheapestPriceLabel"|trans|sw_sanitize }}<span class="product-cheapest-price-price"> {{ cheapest.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }}</span></div>
  13.                 {% endif %}
  14.                 {% if product.extensions.calculatedSamplePrice.unitPrice is empty %}
  15.                     <div class="product-detail-sample-price">
  16.                         <span class="product-detail-sample-price-label">
  17.                             {{ "swp-sampleorder.detail.SamplePriceFree"|trans|sw_sanitize }}
  18.                         </span>
  19.                     </div>
  20.                 {% else %}
  21.                     <div class="product-detail-sample-price">
  22.                         <span class="product-detail-sample-price-label">
  23.                             {{ "swp-sampleorder.detail.SamplePrice"|trans|sw_sanitize }}:
  24.                         </span>
  25.                             <span class="product-detail-sample-price-price">
  26.                             {{ product.extensions.calculatedSamplePrice.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }}
  27.                         </span>
  28.                     </div>
  29.                 {% endif %}
  30.             </div>
  31.             {% if displayFrom or (displayParent and displayFromVariants) %}
  32.                 {{ "listing.listingTextFrom"|trans|sw_sanitize }}
  33.             {% endif %}
  34.             <span class="product-price{% if isListPrice and not displayFrom and not displayFromVariants %} with-list-price{% endif %}">
  35.                     {{ price.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }}
  36.                 {% if isListPrice and not displayFrom and not displayFromVariants %}
  37.                     {% set afterListPriceSnippetExists = "listing.afterListPrice"|trans|length > 0 %}
  38.                     {% set beforeListPriceSnippetExists = "listing.beforeListPrice"|trans|length > 0 %}
  39.                     {% set hideStrikeTrough = beforeListPriceSnippetExists or afterListPriceSnippetExists %}
  40.                     <span class="list-price{% if hideStrikeTrough %} list-price-no-line-through{% endif %}">
  41.                             {% if beforeListPriceSnippetExists %}{{ "listing.beforeListPrice"|trans|trim|sw_sanitize }}{% endif %}
  42.                             <span class="list-price-price">{{ price.listPrice.price|currency }}{{ "general.star"|trans|sw_sanitize }}</span>
  43.                             {% if afterListPriceSnippetExists %}{{ "listing.afterListPrice"|trans|trim|sw_sanitize }}{% endif %}
  44.                             <span class="list-price-percentage">{{ "detail.listPricePercentage"|trans({'%price%': price.listPrice.percentage })|sw_sanitize }}</span>
  45.                         </span>
  46.                 {% endif %}
  47.                 </span>
  48.             {% if isRegulationPrice %}
  49.                 <span class="product-price with-regulation-price">
  50.                         {% if isListPrice %}<br/>{% endif %}<span class="regulation-price">{{ "general.listPricePreviously"|trans({'%price%': price.regulationPrice.price|currency }) }}{{ "general.star"|trans|sw_sanitize }}</span>
  51.                     </span>
  52.             {% endif %}
  53.         </div>
  54. {#        <div class="product-price-wrapper">#}
  55. {#            <div class="product-cheapest-price"></div>#}
  56. {#            {% if product.extensions.calculatedSamplePrice.unitPrice is empty %}#}
  57. {#                <span class="product-price">#}
  58. {#                        {{ "swp-sampleorder.detail.SamplePriceFree"|trans|sw_sanitize }}#}
  59. {#                    </span>#}
  60. {#            {% else %}#}
  61. {#                {{ "swp-sampleorder.detail.SamplePrice"|trans|sw_sanitize }}:#}
  62. {#                <span class="product-price">#}
  63. {#                        {{ product.extensions.calculatedSamplePrice.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }}#}
  64. {#                    </span>#}
  65. {#            {% endif %}#}
  66. {#        </div>#}
  67.     {% else %}
  68.         {{ parent() }}
  69.     {% endif %}
  70. {% endblock %}