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

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',{id:product.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',{url:product.url,id:product.id}) }}",
  48. "name": "{{ product.name }}"
  49. }
  50. }
  51. ]
  52. }
  53. </script>
  54. <script>
  55. var products = [];
  56. {% for p in products %}
  57. products['{{ p.id }}'] = {
  58. id: {{ p.id | e('js') }},
  59. model: '{{ p.model | e('js') }}',
  60. inStock: {{ (p.quantity > 0 ? 1 : 0) | e('js') }},
  61. price: {{ p.getPrice() | e('js') }},
  62. inCart: {{ cartMgr.qtyInCart(p) }},
  63. attributes: [],
  64. pictures: [],
  65. };
  66. {% for attribute in attributes %}
  67. products['{{ p.id }}'].attributes['{{ attribute.code }}'] = '{{ (p.getAttributeValue(attribute.code) ? p.getAttributeValue(attribute.code) : '') |e('js') }}';
  68. {% endfor %}
  69. {% for picture in p.pictures %}
  70. products['{{ p.id }}'].pictures.push ({
  71. id: {{ picture.id | e('js') }},
  72. code: '{{ picture.code | e('js') }}',
  73. url: '{{ picture.webPath |e('js') }}',
  74. small: '{{ picture.webPath | imagine_filter('product_small') |e('js') }}',
  75. medium: '{{ picture.webPath | imagine_filter('product_medium') |e('js') }}',
  76. large: '{{ picture.webPath | imagine_filter('product_large') |e('js') }}',
  77. zoom: '{{ picture.webPath | imagine_filter('product_zoom') |e('js') }}',
  78. title: '{{ picture.title |e('js') }}',
  79. alt: '{{ picture.alt |e('js') }}',
  80. });
  81. {% endfor %}
  82. {% endfor %}
  83. var assets = [];
  84. {% for pid, pictures in assets %}
  85. assets['{{pid}}'] = [];
  86. {% for asset in pictures %}
  87. assets['{{pid}}'].push ({
  88. id: {{ asset.id | e('js') }},
  89. code: '{{ asset.code | e('js') }}',
  90. url: '{{ asset.webPath |e('js') }}',
  91. small: '{{ asset.webPath | imagine_filter('product_small') |e('js') }}',
  92. medium: '{{ asset.webPath | imagine_filter('product_medium') |e('js') }}',
  93. large: '{{ asset.webPath | imagine_filter('product_large') |e('js') }}',
  94. zoom: '{{ asset.webPath | imagine_filter('product_zoom') |e('js') }}',
  95. title: '{{ asset.title |e('js') }}',
  96. alt: '{{ asset.alt |e('js') }}',
  97. });
  98. {% endfor %}
  99. {% endfor %}
  100. </script>
  101. {% endblock %}
  102. {% block featured %}{% endblock %}
  103. {% block breadcrumbs %}
  104. {% include 'front/layout/breadcrumbs.html.twig' with {productModel:productModel} %}
  105. {% endblock %}
  106. {% block content %}
  107. {% include 'front/layout/messages.html.twig' %}
  108. <div class="product-model-view product-view">
  109. <div class="ctn">
  110. <div class="product-infos">
  111. {% include 'front/catalog/model/view/assets.html.twig' %}
  112. <div class="infos">
  113. {% if is_granted('ROLE_ADMIN') %}
  114. <div class="admin-tools">
  115. <a href="{{ path('admin_product_edit',{id:product.id}) }}" class="admin-update" target="_blank">modifier le produit</a>
  116. </div>
  117. {% endif %}
  118. {% if product.manufacturer %}
  119. <div class="manufacturer"><a href="{{ path('manufacturer',{id:product.manufacturer.id, url:product.manufacturer.url}) }}">{{ product.manufacturer.name }}</a></div>
  120. {% endif %}
  121. <h1>{{ productModelDescription.headingTitle }}</h1>
  122. <div class="description">
  123. {% if hasWelcomeDiscount %}
  124. <div>
  125. {% include 'front/catalog/product/view/discount-welcome.html.twig' %}
  126. </div>
  127. {% endif %}
  128. </div>
  129. <div class="description">
  130. {% if productDescription.shortDescription %}
  131. {{ productDescription.shortDescription | raw }}
  132. {% endif %}
  133. </div>
  134. {% if productModelDescription.description %}
  135. <div class="description">
  136. <a href="#description" class="bt-scroll">{% trans %}Voir le descriptif{% endtrans %}</a>
  137. </div>
  138. {% endif %}
  139. {% if not customerMgr.canSeePrices() %}
  140. <div class="not-logged">
  141. {% 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 %}.
  142. </div>
  143. {% endif %}
  144. {% include 'front/catalog/model/view/references.html.twig' %}
  145. {% if not customerMgr.isExpert() %}
  146. <div class="offers">
  147. <div class="free-shipping">
  148. <img src="{{ asset('img/pictos/shipping.svg') }}" alt="{% trans %}Livraison gratuite dès 100 € HT{% endtrans %}">
  149. <div>{% trans %}<strong>LIVRAISON GRATUITE</strong><br>dès 100 € HT{% endtrans %}</div>
  150. </div>
  151. <div class="free-gift">
  152. <img src="{{ asset('img/pictos/gift.svg') }}" alt="{% trans %}1 cadeau offert pour chaque commande internet{% endtrans %}">
  153. <div>{% trans %}<strong>1 CADEAU OFFERT</strong> pour <br>chaque commande internet{% endtrans %}</div>
  154. </div>
  155. </div>
  156. {% if product.hasSoleil() %}
  157. <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>
  158. {% endif %}
  159. {% if product.hasNonSoleil() %}
  160. <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>
  161. {% endif %}
  162. {% endif %}
  163. </div>
  164. </div>
  165. </div>
  166. <div class="ctn">
  167. {% if productModelDescription.description %}
  168. <div class="tab-content rte section" id="description">
  169. <div class="title-ctn">
  170. <div class="title">{% trans %}Description détaillée{% endtrans %}</div>
  171. </div>
  172. {{ productModelDescription.description|raw }}
  173. </div>
  174. {% endif %}
  175. {% for p in products %}
  176. {% if p.productDescription.notice %}
  177. <div class="tab-content rte section tab-notice" id="notice-{{ p.id }}">
  178. <div class="title-ctn">
  179. <div class="title">{% trans %}Notice{% endtrans %}</div>
  180. </div>
  181. <p class="notice notice-{{ p.id }}"><a href="{{ productDescription.noticeUrl }}" target="_blank">{% trans %}Télécharger la notice d'utilisation{% endtrans %}</a></p>
  182. </div>
  183. {% endif %}
  184. {% endfor %}
  185. {% if productModelDescription.conseil1 %}
  186. <div class="section rte advices">
  187. <div class="title-ctn">
  188. <div class="title">{% trans %}Conseils et astuces{% endtrans %}</div>
  189. </div>
  190. {{ productModelDescription.conseil1|raw }}
  191. </div>
  192. {% endif %}
  193. {% if product.video %}
  194. <div class="tab-content rte section" id="video">
  195. <div class="title-ctn">
  196. <div class="title">{% trans %}Vid&Eacute;o{% endtrans %}</div>
  197. <hr>
  198. </div>
  199. <div class="video-ctn">
  200. {{ product.video|raw }}
  201. </div>
  202. </div>
  203. {% endif %}
  204. {% include 'front/catalog/model/view/caracteristics.html.twig' %}
  205. </div>
  206. {% if associates %}
  207. {% include 'front/catalog/product/carousel.html.twig' with {products:associates, title:'Produits associés'|trans, withWrapper:true} %}
  208. {% endif %}
  209. <div class="ctn" style="padding: 30px 0;">
  210. {% if inCategory %}
  211. {% include 'front/catalog/product/carousel.html.twig' with {products:inCategory, title:'Dans la même catégorie'|trans, withWrapper:false} %}
  212. {% endif %}
  213. </div>
  214. {{ render(controller(
  215. 'App\\Controller\\Front\\Modules\\SeenProductsController::block',
  216. { 'request': app.request }
  217. )) }}
  218. <div class="ctn">
  219. {% if pathTags %}
  220. <div class="section rte tags">
  221. <div class="title-ctn">
  222. <div class="title">{% trans %}Craquez aussi pour...{% endtrans %}</div>
  223. </div>
  224. {{ pathTags|raw }}
  225. </div>
  226. {% endif %}
  227. </div>
  228. </div>
  229. {% endblock %}
  230. {% block javascripts %}
  231. <script src="{{ asset('js/product.js') }}"></script>
  232. <script>
  233. $(document).ready(function(){
  234. {# tabs.init();#}
  235. product.init();
  236. });
  237. </script>
  238. {% endblock %}