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.             <p class="product-detail-price{% if listPrice.percentage > 0 %} with-list-price{% endif %}">
  82.                 {{ price.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }}
  83.             </p>
  84.             {% if listPrice.percentage > 0 %}
  85.                 {% block buy_widget_was_price %}
  86.                     {% block buy_widget_was_price_badge %}
  87.                         <span class="list-price-badge">&#37;</span>
  88.                     {% endblock %}
  89.                     {% set afterListPriceSnippetExists = "listing.afterListPrice"|trans|length > 0 %}
  90.                     {% set beforeListPriceSnippetExists = "listing.beforeListPrice"|trans|length > 0 %}
  91.                     {% block buy_widget_was_price_wrapper %}
  92.                         <span class="product-detail-list-price-wrapper">
  93.                             {% if beforeListPriceSnippetExists %}{{"listing.beforeListPrice"|trans|trim}}{% endif %}
  94.                             <span{% if not (afterListPriceSnippetExists or beforeListPriceSnippetExists) %} class="list-price-price"{% endif %}>{{ listPrice.price|currency }}{{ "general.star"|trans|sw_sanitize }}</span>
  95.                             {% if afterListPriceSnippetExists %}
  96.                                 {{"listing.afterListPrice"|trans|trim}}
  97.                             {% endif %}
  98.                             <span class="list-price-percentage">{{ "detail.listPricePercentage"|trans({'%price%': listPrice.percentage })|sw_sanitize }}</span>
  99.                         </span>
  100.                     {% endblock %}
  101.                 {% endblock %}
  102.             {% endif %}
  103.         {% endblock %}
  104.         {% if product.purchaseUnit %}
  105.             {% block buy_widget_price_unit %}
  106.                 <div class="product-detail-price-unit">
  107.                     {% block buy_widget_price_unit_label %}
  108.                         <span class="price-unit-label">
  109.                             {{ "detail.priceUnitName"|trans|sw_sanitize }}
  110.                         </span>
  111.                     {% endblock %}
  112.                     {% block buy_widget_price_unit_content %}
  113.                         <span class="price-unit-content">
  114.                             {{ product.purchaseUnit }} {{ product.unit.name }}
  115.                         </span>
  116.                     {% endblock %}
  117.                     {% if price.referencePrice is not null %}
  118.                         {% block buy_widget_price_unit_reference_content %}
  119.                             <span class="price-unit-reference-content">
  120.                                 ({{ price.referencePrice.price|currency }}{{ "general.star"|trans|sw_sanitize }} / {{ price.referencePrice.referenceUnit }} {{ price.referencePrice.unitName }})
  121.                             </span>
  122.                         {% endblock %}
  123.                     {% endif %}
  124.                 </div>
  125.             {% endblock %}
  126.         {% endif %}
  127.     {% endif %}
  128. {% endblock %}