{% extends 'front/front.html.twig' %}
{% block bodyClass %}product product-model{% endblock %}
{% block metas %}
<title>{{ productModelDescription.headTitleTag ? productModelDescription.headTitleTag : productModelDescription.name }}</title>
<meta name="description" content="{{ productModelDescription.headDescTag ? productModelDescription.headDescTag : productModelDescription.description|metadescription }}">
<link rel="canonical" href="{{ url('product',{id:product.id, url:productModelDescription.url}) }}" />
{% endblock %}
{% block structuredData %}
{% set cpt = 1 %}
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement":
[
{
"@type": "ListItem",
"position": {{ cpt }},
"item":
{
"@id": "{{ url('index') }}",
"name": "{% trans %}Vivog | Matériel pour les toiletteurs et éleveurs{% endtrans %}"
}
},
{% for p in path %}
{% set cpt = cpt + 1 %}
{
"@type": "ListItem",
"position": {{ cpt }},
"item":
{
{% if loop.index == 1 %}
"@id": "{{ url('universe',{url:p.url,id:p.id}) }}",
{% else %}
"@id": "{{ url('category',{url:p.url,id:p.id}) }}",
{% endif %}
"name": "{{ p.name }}"
}
},
{% endfor %}
{% set cpt = cpt + 1 %}
{
"@type": "ListItem",
"position": {{ cpt }},
"item":
{
"@id": "{{ url('product',{url:product.url,id:product.id}) }}",
"name": "{{ product.name }}"
}
}
]
}
</script>
<script>
var products = [];
{% for p in products %}
products['{{ p.id }}'] = {
id: {{ p.id | e('js') }},
model: '{{ p.model | e('js') }}',
inStock: {{ (p.quantity > 0 ? 1 : 0) | e('js') }},
price: {{ p.getPrice() | e('js') }},
attributes: [],
pictures: [],
};
{% for attribute in attributes %}
products['{{ p.id }}'].attributes['{{ attribute.code }}'] = '{{ (p.getAttribute(attribute.code) ? p.getAttribute(attribute.code).value : '') |e('js') }}';
{% endfor %}
{% for picture in p.pictures %}
products['{{ p.id }}'].pictures.push ({
id: {{ picture.id | e('js') }},
code: '{{ picture.code | e('js') }}',
url: '{{ picture.webPath |e('js') }}',
small: '{{ picture.webPath | imagine_filter('product_small') |e('js') }}',
medium: '{{ picture.webPath | imagine_filter('product_medium') |e('js') }}',
large: '{{ picture.webPath | imagine_filter('product_large') |e('js') }}',
zoom: '{{ picture.webPath | imagine_filter('product_zoom') |e('js') }}',
title: '{{ picture.title |e('js') }}',
alt: '{{ picture.alt |e('js') }}',
});
{% endfor %}
{% endfor %}
var assets = [];
{% for pid, pictures in assets %}
assets['{{pid}}'] = [];
{% for asset in pictures %}
assets['{{pid}}'].push ({
id: {{ asset.id | e('js') }},
code: '{{ asset.code | e('js') }}',
url: '{{ asset.webPath |e('js') }}',
small: '{{ asset.webPath | imagine_filter('product_small') |e('js') }}',
medium: '{{ asset.webPath | imagine_filter('product_medium') |e('js') }}',
large: '{{ asset.webPath | imagine_filter('product_large') |e('js') }}',
zoom: '{{ asset.webPath | imagine_filter('product_zoom') |e('js') }}',
title: '{{ asset.title |e('js') }}',
alt: '{{ asset.alt |e('js') }}',
});
{% endfor %}
{% endfor %}
</script>
{% endblock %}
{% block featured %}{% endblock %}
{% block breadcrumbs %}
{% include 'front/layout/breadcrumbs.html.twig' with {productModel:productModel} %}
{% endblock %}
{% block content %}
{% include 'front/layout/messages.html.twig' %}
{% if app.request.get('debug') %}
<div class="ctn debug">
<p>
<em><strong>debug</strong></em>
id du modèle : {{ productModel.id }}<br>
code du modèle : {{ productModel.code }}<br>
{% if productModel.variant %}
{{ productModel.variant.code }} {{ productModel.variant.title }} {{ productModel.variant.axis1 }} {{ productModel.variant.axis2 }}
{% endif %}
</p>
{% if productModel.hasChildren() %}
<p>
<em><strong>sous modèles</strong></em>
{% for child in productModel.children %}
<li>
id du sous-modèle : {{ child.id }}<br>
code du sous-modèle : {{ child.code }}<br>
{% if child.variant %}
{{ child.variant.code }} {{ child.variant.title }} {{ child.variant.axis1 }} {{ child.variant.axis2 }}
{% endif %}
</li>
{% endfor %}
</p>
{% endif %}
<p>
<em><strong>produits</strong></em>
<ul>
{% for p in productModel.allProducts %}
<li>
id du produit : {{ p.id }}<br>
ref du produit : {{ p.reference }}<br>
variant par défaut : {{ p.isDefaultVariant }}<br>
</li>
{% endfor %}
</ul>
</p>
</div>
{% endif %}
<div class="product-view">
<div class="ctn">
<div class="product-infos">
{% include 'front/catalog/model/view/assets.html.twig' %}
<div class="infos">
{% if is_granted('ROLE_ADMIN') %}
<div class="admin-tools">
<a href="{{ path('admin_product_edit',{id:product.id}) }}" class="admin-update" target="_blank">modifier le produit</a>
</div>
{% endif %}
{% if product.manufacturer %}
<div class="manufacturer"><a href="{{ path('manufacturer',{id:product.manufacturer.id, url:product.manufacturer.url}) }}">{{ product.manufacturer.name }}</a></div>
{% endif %}
<h1>{{ productModelDescription.headingTitle }}</h1>
<div class="description">
{% if hasWelcomeDiscount %}
<div>
{% include 'front/catalog/product/view/discount-welcome.html.twig' %}
</div>
{% endif %}
{% if productModelDescription.description %}
<a href="#description" class="bt-scroll">{% trans %}Voir le descriptif{% endtrans %}</a>
{% endif %}
</div>
{% if not customerMgr.canSeePrices() %}
<div class="not-logged">
{% 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 %}.
</div>
{% endif %}
{% include 'front/catalog/model/view/references.html.twig' %}
{% if not customerMgr.isExpert() %}
<div class="offers">
<div class="free-shipping">
<img src="{{ asset('img/pictos/shipping.svg') }}" alt="{% trans %}Livraison gratuite dès 100 € HT{% endtrans %}">
<div>{% trans %}<strong>LIVRAISON GRATUITE</strong><br>dès 100 € HT{% endtrans %}</div>
</div>
<div class="free-gift">
<img src="{{ asset('img/pictos/gift.svg') }}" alt="{% trans %}1 cadeau offert pour chaque commande internet{% endtrans %}">
<div>{% trans %}<strong>1 CADEAU OFFERT</strong> pour <br>chaque commande internet{% endtrans %}</div>
</div>
</div>
{% if product.hasSoleil() %}
<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>
{% endif %}
{% if product.hasNonSoleil() %}
<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>
{% endif %}
{% endif %}
</div>
</div>
</div>
<div class="ctn">
{% if productModelDescription.description %}
<div class="tab-content rte section" id="description">
<div class="title-ctn">
<div class="title">{% trans %}Description détaillée{% endtrans %}</div>
</div>
{{ productModelDescription.description|raw }}
</div>
{% endif %}
{% if product.notice %}
<div class="tab-content rte section" id="notice">
<div class="title-ctn">
<div class="title">{% trans %}Notice{% endtrans %}</div>
</div>
<p class="notice"><a href="{{ product.noticeUrl }}" target="_blank">{% trans %}Télécharger la notice d'utilisation{% endtrans %}</a></p>
</div>
{% endif %}
{% if productModelDescription.conseil1 %}
<div class="section rte advices">
<div class="title-ctn">
<div class="title">{% trans %}Conseils et astuces{% endtrans %}</div>
</div>
{{ productModelDescription.conseil1|raw }}
</div>
{% endif %}
{% if product.video %}
<div class="tab-content rte section" id="video">
<div class="title-ctn">
<div class="title">{% trans %}VidÉo{% endtrans %}</div>
<hr>
</div>
<div class="video-ctn">
{{ product.video|raw }}
</div>
</div>
{% endif %}
{% include 'front/catalog/product/view/caracteristics.html.twig' %}
</div>
{% if associates %}
{% include 'front/catalog/product/carousel.html.twig' with {products:associates, title:'Produits associés'|trans, withWrapper:true} %}
{% endif %}
<div class="ctn" style="padding: 30px 0;">
{% if inCategory %}
{% include 'front/catalog/product/carousel.html.twig' with {products:inCategory, title:'Dans la même catégorie'|trans, withWrapper:false} %}
{% endif %}
</div>
{{ render(controller(
'App\\Controller\\Front\\Modules\\SeenProductsController::block',
{ 'request': app.request }
)) }}
<div class="ctn">
{% if pathTags %}
<div class="section rte tags">
<div class="title-ctn">
<div class="title">{% trans %}Craquez aussi pour...{% endtrans %}</div>
</div>
{{ pathTags|raw }}
</div>
{% endif %}
</div>
</div>
{% endblock %}
{% block javascripts %}
<script src="{{ asset('js/product.js') }}"></script>
<script>
$(document).ready(function(){
{# tabs.init();#}
product.init();
});
</script>
{% endblock %}