custom/static-plugins/CytexTheme/src/Resources/views/storefront/page/product-detail/buy-widget-price.html.twig line 1

Open in your IDE?
  1. {% sw_extends "@Storefront/storefront/page/product-detail/buy-widget-price.html.twig" %}
  2. {% block page_product_detail_price_inner %}
  3.     {% if page.product.calculatedPrices|length > 1 %}
  4.         {% block page_product_detail_price_block %}
  5.             {{ parent() }}
  6.         {% endblock %}
  7.     {% else %}
  8.         {% set price = page.product.calculatedPrice %}
  9.         {% if page.product.calculatedPrices|length == 1 %}
  10.             {% set price = page.product.calculatedPrices.first %}
  11.         {% endif %}
  12.         <meta itemprop="price"
  13.               content="{{ price.unitPrice }}">
  14.         {% if taxText %}
  15.             <p class="product-detail-tax-text m-0">{{ taxText }}</p>
  16.         {% endif %}
  17.         {% block page_product_detail_price_content %}
  18.             {% set listPrice = price.listPrice %}
  19.             <p class="product-detail-price-container d-flex flex-wrap text-right">
  20.                 {% if listPrice.percentage > 0 %}
  21.                     {% block page_product_detail_was_price %}
  22.                         {% set afterListPriceSnippetExists = "listing.afterListPrice"|trans|trim|sw_sanitize %}
  23.                         {% set beforeListPriceSnippetExists = "listing.beforeListPrice"|trans|trim|sw_sanitize %}
  24.                         {% if beforeListPriceSnippetExists is same as("listing.beforeListPrice") %}
  25.                             {% set beforeListPriceSnippetExists = "" %}
  26.                         {% elseif afterListPriceSnippetExists is same as("listing.afterListPrice") %}
  27.                             {% set afterListPriceSnippetExists = "" %}
  28.                         {% endif %}
  29.                         {% block page_product_detail_was_price_wrapper %}
  30.                             <span class="product-detail-price-indicator">
  31.                                 {% if beforeListPriceSnippetExists %}
  32.                                     <strong>{{ beforeListPriceSnippetExists }}</strong>
  33.                                 {% endif %}
  34.                                 <span{% if not (afterListPriceSnippetExists or beforeListPriceSnippetExists) %} class="list-price-price"{% endif %}>{{ listPrice.price|currency }}</span>
  35.                                 {% if afterListPriceSnippetExists %}
  36.                                     <strong>{{ afterListPriceSnippetExists }}</strong>
  37.                                 {% endif %}
  38.                             </span>
  39.                         {% endblock %}
  40.                     {% endblock %}
  41.                 {% endif %}
  42.                 {% set taxBase = price.calculatedTaxes|first %}
  43.                 {% if context.taxState == "gross" %}
  44.                     {% set unitPriceExclVat = (taxBase.price - taxBase.tax) %}
  45.                 {% else %}
  46.                     {% set unitPriceExclVat = price.unitPrice %}
  47.                 {% endif %}
  48.                 <span class="product-detail-price{% if listPrice.percentage > 0 %} with-list-price{% endif %}">
  49.                     {{ unitPriceExclVat|currency }}
  50.                 </span>
  51.             </p>
  52.             {% if page.product.translated.customFields.deposit %}
  53.                 {% set deposit = page.product.translated.customFields.deposit|currency %}
  54.                 {% set depositWithTax = (page.product.translated.customFields.deposit + page.product.translated.customFields.deposit * page.product.tax.taxRate / 100)|currency %}
  55.                 <div class="product-detail-deposit">
  56.                     {{ "cytex-theme.product.detail.deposit.depositWithTax"|trans({
  57.                         '%deposit%': depositWithTax
  58.                     })|sw_sanitize }}
  59.                 </div>
  60.                 <div class="product-detail-deposit">
  61.                     {{ "cytex-theme.product.detail.deposit.depositWithoutTax"|trans({
  62.                         '%deposit%': deposit
  63.                     })|sw_sanitize }}
  64.                 </div>
  65.             {% endif %}
  66.         {% endblock %}
  67.         {% set taxBase = price.calculatedTaxes|first %}
  68.         {% if context.taxState == "gross" %}
  69.             {% set unitPriceInclVat = (taxBase.price) %}
  70.         {% else %}
  71.             {% set unitPriceInclVat = (taxBase.price + taxBase.tax) %}
  72.         {% endif %}
  73.             {% block page_product_detail_price_vat %}
  74.             {% if unitPriceInclVat %}
  75.                 ({{ "listing.moms-pre-text"|trans|sw_sanitize }} {{ unitPriceInclVat|currency }})
  76.             {% endif %}
  77.         {% endblock %}
  78.         {% if page.product.purchaseUnit %}
  79.             {% block page_product_detail_price_unit %}
  80.                 {{ parent() }}
  81.             {% endblock %}
  82.         {% endif %}
  83.     {% endif %}
  84. {% endblock %}