vendor/shopware/storefront/Resources/views/storefront/component/buy-widget/buy-widget-price.html.twig line 1

Open in your IDE?
  1. {% block buy_widget_price_inner %}
  2.     {% if product.calculatedPrices|length > 1 %}
  3.         {% block buy_widget_price_block %}
  4.             <div class="product-block-prices">
  5.                 {% block buy_widget_price_block_table %}
  6.                     <table class="table product-block-prices-grid">
  7.                         {% block buy_widget_price_block_table_head %}
  8.                             <thead class="product-block-prices-head">
  9.                             {% block buy_widget_price_block_table_head_inner %}
  10.                                 <tr class="product-block-prices-row">
  11.                                     <th scope="col" class="product-block-prices-cell">
  12.                                         {{ "detail.dataColumnQuantity"|trans|sw_sanitize }}
  13.                                     </th>
  14.                                     <th scope="col" class="product-block-prices-cell">
  15.                                         {{ "detail.dataColumnPrice"|trans|sw_sanitize }}
  16.                                     </th>
  17.                                     {% if product.calculatedPrice.referencePrice %}
  18.                                         <th scope="col" class="product-block-prices-cell">
  19.                                             {{ "detail.dataColumnReferencePrice"|trans|sw_sanitize }}
  20.                                         </th>
  21.                                     {% endif %}
  22.                                 </tr>
  23.                             {% endblock %}
  24.                             </thead>
  25.                         {% endblock %}
  26.                         {% block buy_widget_price_block_table_body %}
  27.                             <tbody class="product-block-prices-body">
  28.                             {% block buy_widget_price_block_table_body_inner %}
  29.                                 {% for price in product.calculatedPrices %}
  30.                                     {% block buy_widget_price_block_table_body_row %}
  31.                                         <tr class="product-block-prices-row"
  32.                                             itemprop="offers" itemscope
  33.                                             itemtype="https://schema.org/Offer">
  34.                                             {% block buy_widget_price_block_table_body_cell_quantity %}
  35.                                                 <th scope="row" class="product-block-prices-cell product-block-prices-cell-thin">
  36.                                                     <meta itemprop="priceCurrency" content="{{ page.header.activeCurrency.translated.shortName }}" />
  37.                                                     <meta itemprop="price" content="{{ price.unitPrice }}" />
  38.                                                     <link itemprop="availability" href="https://schema.org/InStock" />
  39.                                                     {% if loop.last %}
  40.                                                         {{ "detail.priceDataInfoFrom"|trans|sw_sanitize }}
  41.                                                         <span class="product-block-prices-quantity">{{ price.quantity }}</span>
  42.                                                     {% else %}
  43.                                                         {{ "detail.priceDataInfoUntil"|trans|sw_sanitize }}
  44.                                                         <span class="product-block-prices-quantity">{{ price.quantity }}</span>
  45.                                                     {% endif %}
  46.                                                 </th>
  47.                                             {% endblock %}
  48.                                             {% block buy_widget_price_block_table_body_cell_price %}
  49.                                                 <td class="product-block-prices-cell">
  50.                                                     {% sw_include '@Storefront/storefront/component/product/block-price.html.twig' with {
  51.                                                         price: price
  52.                                                     } only %}
  53.                                                 </td>
  54.                                             {% endblock %}
  55.                                             {% block buy_widget_price_block_table_body_cell_reference_price %}
  56.                                                 {% if price.referencePrice is not null %}
  57.                                                     <td class="product-block-prices-cell product-block-prices-cell-thin">
  58.                                                         {{ price.referencePrice.price|currency }}{{ "general.star"|trans|sw_sanitize }} / {{ price.referencePrice.referenceUnit }} {{ price.referencePrice.unitName }}
  59.                                                     </td>
  60.                                                 {% endif %}
  61.                                             {% endblock %}
  62.                                         </tr>
  63.                                     {% endblock %}
  64.                                 {% endfor %}
  65.                             {% endblock %}
  66.                             </tbody>
  67.                         {% endblock %}
  68.                     </table>
  69.                 {% endblock %}
  70.             </div>
  71.         {% endblock %}
  72.     {% else %}
  73.         {% set price = product.calculatedPrice %}
  74.         {% if product.calculatedPrices|length == 1 %}
  75.             {% set price = product.calculatedPrices.first %}
  76.         {% endif %}
  77.         <meta itemprop="price"
  78.               content="{{ price.unitPrice }}">
  79.         {% block buy_widget_price_content %}
  80.             {% set listPrice = price.listPrice %}
  81.             {% set isListPrice = price.listPrice.percentage > 0 %}
  82.             {% set isRegulationPrice = price.regulationPrice != null %}
  83.             <p class="product-detail-price{% if isListPrice %} with-list-price{% endif %}{% if isRegulationPrice %} with-regulation-price{% endif %}">
  84.                 {{ price.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }}
  85.             </p>
  86.             {% if isListPrice %}
  87.                 {% block buy_widget_was_price %}
  88.                     {% block buy_widget_was_price_badge %}
  89.                         <span class="list-price-badge">&#37;</span>
  90.                     {% endblock %}
  91.                     {% set afterListPriceSnippetExists = "listing.afterListPrice"|trans|length > 0 %}
  92.                     {% set beforeListPriceSnippetExists = "listing.beforeListPrice"|trans|length > 0 %}
  93.                     {% block buy_widget_was_price_wrapper %}
  94.                         <span class="product-detail-list-price-wrapper">
  95.                             {% if beforeListPriceSnippetExists %}{{"listing.beforeListPrice"|trans|trim}}{% endif %}
  96.                             <span{% if not (afterListPriceSnippetExists or beforeListPriceSnippetExists) %} class="list-price-price"{% endif %}>{{ listPrice.price|currency }}{{ "general.star"|trans|sw_sanitize }}</span>
  97.                             {% if afterListPriceSnippetExists %}
  98.                                 {{"listing.afterListPrice"|trans|trim}}
  99.                             {% endif %}
  100.                             <span class="list-price-percentage">{{ "detail.listPricePercentage"|trans({'%price%': listPrice.percentage })|sw_sanitize }}</span>
  101.                         </span>
  102.                     {% endblock %}
  103.                 {% endblock %}
  104.             {% endif %}
  105.             {% if isRegulationPrice %}
  106.                 <span class="product-detail-list-price-wrapper">
  107.                     <span class="regulation-price">{{ "general.listPricePreviously"|trans({'%price%': price.regulationPrice.price|currency }) }}{{ "general.star"|trans|sw_sanitize }}</span>
  108.                 </span>
  109.             {% endif %}
  110.         {% endblock %}
  111.         {% if product.purchaseUnit %}
  112.             {% block buy_widget_price_unit %}
  113.                 <div class="product-detail-price-unit">
  114.                     {% block buy_widget_price_unit_label %}
  115.                         <span class="price-unit-label">
  116.                             {{ "detail.priceUnitName"|trans|sw_sanitize }}
  117.                         </span>
  118.                     {% endblock %}
  119.                     {% block buy_widget_price_unit_content %}
  120.                         <span class="price-unit-content">
  121.                             {{ product.purchaseUnit }} {{ product.unit.name }}
  122.                         </span>
  123.                     {% endblock %}
  124.                     {% if price.referencePrice is not null %}
  125.                         {% block buy_widget_price_unit_reference_content %}
  126.                             <span class="price-unit-reference-content">
  127.                                 ({{ price.referencePrice.price|currency }}{{ "general.star"|trans|sw_sanitize }} / {{ price.referencePrice.referenceUnit }} {{ price.referencePrice.unitName }})
  128.                             </span>
  129.                         {% endblock %}
  130.                     {% endif %}
  131.                 </div>
  132.             {% endblock %}
  133.         {% endif %}
  134.     {% endif %}
  135. {% endblock %}