templates/ECommerce/App/Product/show.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% trans_default_domain 'ECommerceBundle' %}
  3. {% block title %}{{ product.originalTitle }} {{ product.origin }}{% endblock %}
  4. {%- import 'ECommerce/App/Product/macros.html.twig' as macros -%}
  5. {% block content %}
  6. <div class="container-fluid">
  7. <div class="container">
  8. <div class="content">
  9. <div class="row product-path">
  10. <p class="m-0">
  11. {% for crumb in breadcrumbs %}
  12. {% if crumb.url is defined %}
  13. <a href="{{ crumb.url }}">{{ crumb.label|trans }}</a> <span>/</span>
  14. {% else %}<span>{{ crumb.label }}</span>{% endif %}
  15. {% endfor %}
  16. </p>
  17. </div>
  18. <div class="row grid-1-3">
  19. <div class="product-photo w-100 h-100">
  20. {%- set photo = product.photos|first -%}
  21. {%- if photo is not empty and photo.url is not empty -%}
  22. <img src="{{ asset(photo.url)|imagine_filter('product_thumbnail') }}"
  23. class="img-fluid mx-auto d-block w-100 h-100"
  24. alt="{{ product.title }}" data-lity
  25. data-lity-target="{{ asset(photo.url)|imagine_filter('product_small') }}">
  26. {%- else -%}
  27. <img src="{{ preload(asset('/assets/static/no-photo.jpg')) }}" class="img-fluid mx-auto d-block"
  28. alt="{{ product.title }}">
  29. {%- endif -%}
  30. </div>
  31. {%- set firstDepot = product.quantities|first -%}
  32. {%- set restDepots = product.quantities[1:] -%}
  33. {% set hasActiveDepot = false %}
  34. {% for depot in product.quantities %}
  35. {% if depot.quantity > 0 %}
  36. {% set hasActiveDepot = true %}
  37. {% endif %}
  38. {% endfor %}
  39. <div class="product-info d-flex flex-column">
  40. <h2 class="text-left line-height-95 font-weight-bold font-45">{{ product.title }}</h2>
  41. <p class="line-height-95 font-weight-medium font-28 mb-40">{{ product.manufacturer }}</p>
  42. <div class="dimensions-wrapper">
  43. <div class="dimensions d-inline-flex align-items-center">
  44. <img src="{{ preload(asset('assets/static/inner-diameter.svg')) }}" alt="Inner Diameter">
  45. <p class="m-0 font-26 ml-3">{{ product.innerDiameter|number_format(2) }} mm</p>
  46. </div>
  47. <div class="dimensions d-inline-flex align-items-center">
  48. <img src="{{ preload(asset('assets/static/outer-diameter.svg')) }}" alt="Outer Diameter">
  49. <p class="m-0 font-26 ml-3">{{ product.outerDiameter|number_format(2) }} mm</p>
  50. </div>
  51. <div class="dimensions d-inline-flex align-items-center last mb-4">
  52. <img src="{{ preload(asset('assets/static/width.svg')) }}" alt="Width">
  53. <p class="m-0 font-26 ml-3">{{ product.width|number_format(2) }} mm</p>
  54. </div>
  55. </div>
  56. <div class="price d-inline-flex align-items-center mt-5">
  57. <p class="line-height-95 m-0 font-weight-medium font-28 text-uppercase">{{ 'product.price'|trans }}</p>
  58. <p class="line-height-95 mb-0 ml-auto font-weight-medium font-28">{{ firstDepot|depot_product_price(app.user)|number_format(2) }} {{ currency_code(app.user) }}</p>
  59. </div>
  60. {# <div class="price d-inline-flex align-items-end">#}
  61. {# <p class="line-height-95 m-0 mt-3 font-weight-medium font-28 color-blue text-uppercase mw-10">{{ 'product.label_discount_price'|trans }}</p>#}
  62. {# {% if is_granted('ROLE_CLIENT') %}#}
  63. {# <p class="line-height-95 mb-0 ml-auto font-weight-medium font-28 color-blue">{{ firstDepot|depot_product_price(app.user, true)|number_format(2) }} {{ currency_code(app.user) }}</p>#}
  64. {# {% else %}#}
  65. {# <p class="line-height-95 mb-0 ml-auto font-weight-medium font-28 color-blue">{{ 'product.log-in'|trans }}</p>#}
  66. {# {% endif %}#}
  67. {# </div>#}
  68. </div>
  69. <div class="border-rounded w-100 h-100 d-flex flex-column text-center">
  70. <h4 class="m-0">{{ 'availability'|trans }}</h4>
  71. <div class="col-depot-info{{ hasActiveDepot ? ' has-active-depot' : '' }} w-100 text-left">
  72. {% if firstDepot %}
  73. {% if not hasActiveDepot or firstDepot.quantity > 0 %}
  74. {% set depotProduct = firstDepot %}
  75. {% include 'ECommerce/App/Product/partials/product_amount.html.twig' %}
  76. {% endif %}
  77. {% endif %}
  78. {% for depot in restDepots %}
  79. {% if not hasActiveDepot or depot.quantity > 0 %}
  80. {% set depotProduct = depot %}
  81. {% include 'ECommerce/App/Product/partials/product_amount.html.twig' %}
  82. {% endif %}
  83. {% endfor %}
  84. </div>
  85. </div>
  86. </div>
  87. <div class="row single-product-description">
  88. <a class="mt-3" href="{{ product.link }}" target="_blank" rel="nofollow">
  89. <h3 class="text-uppercase line-height-95 font-weight-normal font-28">{{ 'product.more_info'|trans }}</h3>
  90. </a>
  91. {% if product.infoCodes is not empty %}
  92. <h4 class="font-21 line-height-95 font-weight-normal text-uppercase mt-3">{{ 'product.description'|trans }}</h4>
  93. <p class="line-height-113 text-color-grey mt-4 font-weight-normal font-26">{{ product.infoCodes.first.translate.description }}</p>
  94. {% endif %}
  95. </div>
  96. <div class="row justify-content-center">
  97. <div class="synonym-products">
  98. <div id="interchange-wrapper" class="mt-3 mb-5">
  99. <div class="row justify-content-center">
  100. <div class="col-12 mb-5 text-center">
  101. <h1>{{ 'general.interchange_button_title'|trans }}</h1>
  102. <a class="btn btn-primary mt-4"
  103. href="{{ path('mdl_app_synonym_product_find', { 'title': (product.title|trim('*', 'left')) }) }}"
  104. data-intro="{{ ('intro.interchange'|trans) }}"
  105. data-toggle="replace"
  106. data-trigger="#interchange-wrapper">
  107. <span class="text-capitalize font-21 font-weight-normal">{{ 'general.interchange_button_search'|trans }}</span>
  108. <img src="{{ asset('assets/static/arrows-both-way.svg') }}" class="img-fluid ml-5"
  109. alt="found in interchange catalogue">
  110. </a>
  111. </div>
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. <div class="row catalog">
  117. {% set routeParams = {'slug': 'media'} %}
  118. {% if product.manufacturer is not null %}
  119. {% set routeParams = routeParams|merge({'category': product.manufacturer.name}) %}
  120. {% endif %}
  121. <a class="w-100" href="{{ path('mdl_public_page_show', routeParams) }}">
  122. <img class="w-100" src="{{ asset('assets/static/catalog-background.png') }}" aria-label="Catalog background" alt="Catalog background"/>
  123. <h1 class="font-72 text-capitalize text-decoration-none text-white">{{ 'look-catalogue'|trans }}</h1>
  124. <p class="font-26 text-white pb-3">{{ 'find-out-more'|trans }}<img src="{{ asset('assets/static/arrow-button.svg') }}" alt="Arrow button"/></p>
  125. </a>
  126. </div>
  127. </div>
  128. </div>
  129. </div>
  130. {% endblock %}