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

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