templates/bundles/SyliusShopBundle/Product/Show/Tabs/_attributewithcode.html.twig line 1

Open in your IDE?
  1. {{ sonata_block_render_event('sylius.shop.product.show.tab_attributes', {'product': product}) }}
  2. {#
  3. <h5 class="ui horizontal divider header">
  4. {{ 'Specifications'|trans }}
  5. <i class="box icon"></i>
  6. </h5>
  7. #}
  8. <table id="sylius-product-attributes" class="ui definition table">
  9. <tbody>
  10. {% if product.variants is defined %}
  11. {% set variant = product|sylius_resolve_variant %}
  12. {% if variant is not null and variant.depth is not null and variant.width is not null and variant.height is not null %}
  13. {% set sizestring = formatsize(variant.depth, variant.width, variant.height) %}
  14. {% else %}
  15. {% set sizestring = 'N/A' %}
  16. {% endif %}
  17. {% if sizestring is not null and sizestring is not empty %}
  18. <tr>
  19. <td class="sylius-product-attribute-name">
  20. {{ "dimensions"|trans }}</td>
  21. <td class="sylius-product-attribute-value">
  22. {{ sizestring }}
  23. </td>
  24. </tr>
  25. {% endif %}
  26. {% if variant is not null and variant.weight is not null %}
  27. {% set poid = formatweight(variant.weight) %}
  28. {% else %}
  29. {% set poid = 'N/A' %}
  30. {% endif %}
  31. {% if poid is not null and poid is not empty %}
  32. <tr>
  33. <td class="sylius-product-attribute-name">
  34. {{ "weight"|trans }}</td>
  35. <td class="sylius-product-attribute-value">
  36. {{ poid }}
  37. </td>
  38. </tr>
  39. {% endif %}
  40. {% endif %}
  41. {% for attribute in product.getAttributesByLocale(configuration.request.locale, configuration.request.defaultLocale, sylius_base_locale)|sort_by('attribute.position') %}
  42. <tr>
  43. <td class="sylius-product-attribute-name">{{ attribute.name }}</td>
  44. <td class="sylius-product-attribute-value">
  45. {% include [('@SyliusAttribute/Types/'~attribute.attribute.type~'.html.twig'), '@SyliusAttribute/Types/default.html.twig'] with {'attribute': attribute, 'locale': configuration.request.locale, 'fallbackLocale': configuration.request.defaultLocale} %}
  46. </td>
  47. </tr>
  48. {% endfor %}
  49. </tbody>
  50. </table>