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

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