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