templates/front/catalog/model/view.html.twig line 1

Open in your IDE?
  1. {% extends 'front/front.html.twig' %}
  2. {% block bodyClass %}product product-model{% endblock %}
  3. {% block metas %}
  4. <title>{{ productModelDescription.headTitleTag ? productModelDescription.headTitleTag : productModelDescription.name }}</title>
  5. <meta name="description" content="{{ productModelDescription.headDescTag ? productModelDescription.headDescTag : productModelDescription.description|metadescription }}">
  6. <link rel="canonical" href="{{ url('product_model',{id:productModel.id, url:productModelDescription.url}) }}" />
  7. {% endblock %}
  8. {% block structuredData %}
  9. {% set cpt = 1 %}
  10. <script type="application/ld+json">
  11. {
  12. "@context": "https://schema.org",
  13. "@type": "BreadcrumbList",
  14. "itemListElement":
  15. [
  16. {
  17. "@type": "ListItem",
  18. "position": {{ cpt }},
  19. "item":
  20. {
  21. "@id": "{{ url('index') }}",
  22. "name": "{% trans %}Vivog | Matériel pour les toiletteurs et éleveurs{% endtrans %}"
  23. }
  24. },
  25. {% for p in path %}
  26. {% set cpt = cpt + 1 %}
  27. {
  28. "@type": "ListItem",
  29. "position": {{ cpt }},
  30. "item":
  31. {
  32. {% if loop.index == 1 %}
  33. "@id": "{{ url('universe',{url:p.url,id:p.id}) }}",
  34. {% else %}
  35. "@id": "{{ url('category',{url:p.url,id:p.id}) }}",
  36. {% endif %}
  37. "name": "{{ p.name }}"
  38. }
  39. },
  40. {% endfor %}
  41. {% set cpt = cpt + 1 %}
  42. {
  43. "@type": "ListItem",
  44. "position": {{ cpt }},
  45. "item":
  46. {
  47. "@id": "{{ url('product_model',{id:productModel.id, url:productModelDescription.url}) }}",
  48. "name": "{{ productModelDescription.name }}"
  49. }
  50. }
  51. ]
  52. }
  53. </script>
  54. <script>
  55. {# objets et non tableaux : les clés sont des ids / codes d'attribut (ex. "length",
  56. qui sur un Array redéfinirait sa longueur et lèverait une RangeError) #}
  57. var products = {};
  58. var defaultProductId = {{ product.id }};
  59. {% for p in products %}
  60. products['{{ p.id }}'] = {
  61. id: {{ p.id | e('js') }},
  62. model: '{{ p.model | e('js') }}',
  63. inStock: {{ (p.quantity > 0 ? 1 : 0) | e('js') }},
  64. price: {{ p.getPrice() | e('js') }},
  65. inCart: {{ cartMgr.qtyInCart(p) }},
  66. attributes: {},
  67. pictures: [],
  68. };
  69. {% for attribute in attributes %}
  70. products['{{ p.id }}'].attributes['{{ attribute.code }}'] = '{{ (p.getAttributeValue(attribute.code) ? p.getAttributeValue(attribute.code) : '') |e('js') }}';
  71. {% endfor %}
  72. {% for picture in p.pictures %}
  73. products['{{ p.id }}'].pictures.push ({
  74. id: {{ picture.id | e('js') }},
  75. code: '{{ picture.code | e('js') }}',
  76. url: '{{ picture.webPath |e('js') }}',
  77. small: '{{ picture.webPath | imagine_filter('product_small') |e('js') }}',
  78. medium: '{{ picture.webPath | imagine_filter('product_medium') |e('js') }}',
  79. large: '{{ picture.webPath | imagine_filter('product_large') |e('js') }}',
  80. zoom: '{{ picture.webPath | imagine_filter('product_zoom') |e('js') }}',
  81. title: '{{ picture.title |e('js') }}',
  82. alt: '{{ picture.alt |e('js') }}',
  83. });
  84. {% endfor %}
  85. {% endfor %}
  86. var assets = {};
  87. {% for pid, pictures in assets %}
  88. assets['{{pid}}'] = [];
  89. {% for asset in pictures %}
  90. assets['{{pid}}'].push ({
  91. id: {{ asset.id | e('js') }},
  92. code: '{{ asset.code | e('js') }}',
  93. url: '{{ asset.webPath |e('js') }}',
  94. small: '{{ asset.webPath | imagine_filter('product_small') |e('js') }}',
  95. medium: '{{ asset.webPath | imagine_filter('product_medium') |e('js') }}',
  96. large: '{{ asset.webPath | imagine_filter('product_large') |e('js') }}',
  97. zoom: '{{ asset.webPath | imagine_filter('product_zoom') |e('js') }}',
  98. title: '{{ asset.title |e('js') }}',
  99. alt: '{{ asset.alt |e('js') }}',
  100. });
  101. {% endfor %}
  102. {% endfor %}
  103. </script>
  104. {% endblock %}
  105. {% block featured %}{% endblock %}
  106. {% block breadcrumbs %}
  107. {% include 'front/layout/breadcrumbs.html.twig' with {productModel:productModel} %}
  108. {% endblock %}
  109. {% block content %}
  110. {% include 'front/layout/messages.html.twig' %}
  111. <div class="product-model-view product-view">
  112. <div class="ctn">
  113. <div class="product-infos">
  114. {% include 'front/catalog/model/view/assets.html.twig' %}
  115. <div class="infos">
  116. {% if is_granted('ROLE_ADMIN') %}
  117. <div class="admin-tools">
  118. <a href="{{ path('admin_product_edit',{id:product.id}) }}" class="admin-update" target="_blank">modifier le produit</a>
  119. </div>
  120. {% endif %}
  121. {% if product.manufacturer %}
  122. <div class="manufacturer"><a href="{{ path('manufacturer',{id:product.manufacturer.id, url:product.manufacturer.url}) }}">{{ product.manufacturer.name }}</a></div>
  123. {% endif %}
  124. <h1>{{ productModelDescription.headingTitle }}</h1>
  125. <div class="description">
  126. {% if hasWelcomeDiscount %}
  127. <div>
  128. {% include 'front/catalog/product/view/discount-welcome.html.twig' %}
  129. </div>
  130. {% endif %}
  131. </div>
  132. <div class="description">
  133. {% if productDescription.shortDescription %}
  134. {{ productDescription.shortDescription | raw }}
  135. {% endif %}
  136. </div>
  137. {% if productModelDescription.description %}
  138. <div class="description">
  139. <a href="#description" class="bt-scroll">{% trans %}Voir le descriptif{% endtrans %}</a>
  140. </div>
  141. {% endif %}
  142. {% if not customerMgr.canSeePrices() %}
  143. <div class="not-logged">
  144. {% trans %}Pour voir les prix des articles, {% endtrans %}<a href="{{ path('customer_login') }}">{% trans %}il faut être connecté{% endtrans %}</a> {% trans %}(c’est gratuit){% endtrans %}.
  145. </div>
  146. {% endif %}
  147. {% include 'front/catalog/model/view/references.html.twig' %}
  148. {% if not customerMgr.isExpert() %}
  149. <div class="offers">
  150. <div class="free-shipping">
  151. <img src="{{ asset('img/pictos/shipping.svg') }}" alt="{% trans %}Livraison gratuite dès 99 € HT{% endtrans %}">
  152. <div>{% trans %}<strong>LIVRAISON GRATUITE</strong><br>dès 99 € HT{% endtrans %}</div>
  153. </div>
  154. <div class="free-gift">
  155. <img src="{{ asset('img/pictos/gift.svg') }}" alt="{% trans %}1 cadeau offert pour chaque commande internet{% endtrans %}">
  156. <div>{% trans %}<strong>1 CADEAU OFFERT</strong> pour <br>chaque commande internet{% endtrans %}</div>
  157. </div>
  158. </div>
  159. {% if product.hasSoleil() %}
  160. <p>{% trans %}-25% de remise sur les produits <span class="picto soleil"></span> dès 100€ HT de commande de produits <span class="picto soleil"></span>{% endtrans %}</p>
  161. {% endif %}
  162. {% if product.hasNonSoleil() %}
  163. <p>{% trans %}-10% de remise sur les produits <span class="picto non-soleil"></span> dès 100€ HT de commande de produits <span class="picto non-soleil"></span>{% endtrans %}</p>
  164. {% endif %}
  165. {% endif %}
  166. </div>
  167. </div>
  168. </div>
  169. <div class="ctn">
  170. {% if productModelDescription.description %}
  171. <div class="tab-content rte section" id="description">
  172. <div class="title-ctn">
  173. <div class="title">{% trans %}Description détaillée{% endtrans %}</div>
  174. </div>
  175. {{ productModelDescription.description|raw }}
  176. </div>
  177. {% endif %}
  178. {% for p in products %}
  179. {% if p.productDescription.notice %}
  180. <div class="tab-content rte section tab-notice notice-{{ p.id }}" id="notice-{{ p.id }}">
  181. <div class="title-ctn">
  182. <div class="title">{% trans %}Notice{% endtrans %}</div>
  183. </div>
  184. <p class="notice notice-{{ p.id }}"><a href="{{ productDescription.noticeUrl }}" target="_blank">{% trans %}Télécharger la notice d'utilisation{% endtrans %}</a></p>
  185. </div>
  186. {% endif %}
  187. {% endfor %}
  188. {% if productModelDescription.conseil1 %}
  189. <div class="section rte advices">
  190. <div class="title-ctn">
  191. <div class="title">{% trans %}Conseils et astuces{% endtrans %}</div>
  192. </div>
  193. {{ productModelDescription.conseil1|raw }}
  194. </div>
  195. {% endif %}
  196. {% include 'front/catalog/model/view/caracteristics.html.twig' %}
  197. {% if product.video %}
  198. <div class="tab-content rte section" id="video">
  199. <div class="title-ctn">
  200. <div class="title">{% trans %}Vid&Eacute;o{% endtrans %}</div>
  201. <hr>
  202. </div>
  203. <div class="video-ctn">
  204. {{ product.video|raw }}
  205. </div>
  206. </div>
  207. {% endif %}
  208. </div>
  209. {% if associates %}
  210. {% include 'front/catalog/product/carousel.html.twig' with {products:associates, title:'Produits associés'|trans, withWrapper:true} %}
  211. {% endif %}
  212. <div class="ctn" style="padding: 30px 0;">
  213. {% if inCategory %}
  214. {% include 'front/catalog/product/carousel.html.twig' with {products:inCategory, title:'Dans la même catégorie'|trans, withWrapper:false} %}
  215. {% endif %}
  216. </div>
  217. {{ render(controller(
  218. 'App\\Controller\\Front\\Modules\\SeenProductsController::block',
  219. { 'request': app.request }
  220. )) }}
  221. <div class="ctn">
  222. {% if pathTags %}
  223. <div class="section rte tags">
  224. <div class="title-ctn">
  225. <div class="title">{% trans %}Craquez aussi pour...{% endtrans %}</div>
  226. </div>
  227. {{ pathTags|raw }}
  228. </div>
  229. {% endif %}
  230. </div>
  231. </div>
  232. {% endblock %}
  233. {% block javascripts %}
  234. <script src="{{ asset('js/product.js') }}?v=666565"></script>
  235. <script>
  236. $(document).ready(function(){
  237. {# tabs.init();#}
  238. product.init();
  239. });
  240. </script>
  241. {% endblock %}