themes/BootstrapChildTheme/SyliusShopBundle/views/Product/Show/_attributes.html.twig line 1

Open in your IDE?
  1. {% import "@SyliusShop/Common/Macro/icons.html.twig" as icons %}
  2. {% macro renderIcon(type) %}
  3.     {% if 'minimum_order' == type %}
  4.         {{ icons.minimumOrder() }}
  5.     {% elseif 'material' == type %}
  6.         {{ icons.material() }}
  7.     {% elseif 'size' == type %}
  8.         {{ icons.size() }}
  9.     {% endif %}
  10. {% endmacro %}
  11. {% set attributes = product.getAttributesByLocale(configuration.request.locale, configuration.request.defaultLocale, sylius_base_locale)|filter(attribute => attribute.code not in ['tag1', 'tag2'])|sort_by('attribute.position') %}
  12. {#{{ dump(icons) }}#}
  13. {% if attributes %}
  14.     {#<h3>{{ 'product_view.product_specification_header'|trans }}</h3>#}
  15.     <div class="product-attributes">
  16.         {% for attribute in attributes %}
  17.             <div class="product-attribute product-attribute-{{ attribute.code }} d-flex align-items-center mb-3">
  18.                 <span class="sylius-product-atlootribute-name d-inline-flex pe-3 custom-display-7 disable-rfs" {{ sylius_test_html_attribute('product-attribute-name', attribute.name) }} data-bs-toggle="tooltip" data-bs-title="{{ attribute.name }}">
  19.                     {{ _self.renderIcon(attribute.code) }}
  20.                     <span class="visually-hidden">{{ attribute.name }}</span>
  21.                 </span>
  22.                 <span class="sylius-product-attribute-value" {{ sylius_test_html_attribute('product-attribute-value', attribute.name) }}>
  23.                     {% include [
  24.                         '@SyliusShop/Product/Show/Types/'~attribute.attribute.type~'.html.twig',
  25.                         '@SyliusAttribute/Types/'~attribute.attribute.type~'.html.twig',
  26.                         '@SyliusShop/Product/Show/Types/default.html.twig'
  27.                     ] with {
  28.                         'attribute': attribute,
  29.                         'locale': configuration.request.locale,
  30.                         'fallbackLocale': configuration.request.defaultLocale
  31.                     } %}
  32.                 </span>
  33.             </div>
  34.         {% endfor %}
  35.     </div>
  36. {% endif %}