templates/frontoffice_bundle/base/index.html.twig line 1
{% extends 'frontoffice_bundle/base.html.twig' %}
{% block activeIndex %}class="active"{% endblock %}
{% block body %}
<style>
.voir_plus:hover{color:rgb(1 122 8 / 59%);}
</style>
{# <div class="modal fade" id="searchModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-fullscreen">
<div class="modal-content rounded-0">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Recherche par mot-clé</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<form action="/search/" method="GET">
<div class="modal-body d-flex align-items-center">
<div class="input-group w-75 mx-auto d-flex">
<input type="search" class="form-control p-3" placeholder="mot-clé" aria-describedby="search-icon-1" name="name">
<button type="submit" id="search-icon-1" class="input-group-text p-3"><i class="fa fa-search"></i></button>
</div>
</div>
</form>
</div>
</div>
</div> #}
<div class="container-fluid py-1 mb-5 hero-header">
<div class="container py-5">
<div class="row g-5 align-items-center">
<div class="col-md-12 col-lg-7">
<h4 class="mb-3 text-secondary">Aliments 100%</h4>
<h1 class="mb-5 display-3 text-primary">Légumes et fruits</h1>
<div class="position-relative mx-auto">
<form action="/search/" method="GET">
<input class="form-control border-2 border-secondary w-75 py-3 px-4 rounded-pill" type="text" placeholder="Recherche" name="name" >
<button type="submit" class="btn btn-primary border-2 border-secondary py-3 px-4 position-absolute rounded-pill text-white h-100" style="top: 0; right: 25%;">Envoyer maintenant</button>
</form>
</div>
</div>
<div class="col-md-12 col-lg-5">
<div id="carouselId" class="carousel slide position-relative" data-bs-ride="carousel">
{% set counter = 0 %}
<div class="carousel-inner" role="listbox">
{% for slide in sliders %}
<div class="carousel-item rounded {% if counter == 0 %}active{% endif %}">
<img src="{{ asset(slide.img) }}" class="img-fluid w-100 h-100 bg-secondary rounded" alt="Diapositive">
<a href="{{ slide.url }}" class="btn px-4 py-2 text-white rounded">{{ slide.titre }}</a>
</div>
{% set counter = counter + 1 %}
{% endfor %}
</div>
{#<div class="carousel-inner" role="listbox">#}
{# <div class="carousel-item active rounded">#}
{# <img src="{{ asset("bundles/Frontoffice/img/hero-img-1.png")}}" class="img-fluid w-100 h-100 bg-secondary rounded" alt="Première diapositive">#}
{# <a href="/products/Fruits/2/" class="btn px-4 py-2 text-white rounded">Fruits</a>#}
{# </div>#}
{# <div class="carousel-item rounded">#}
{# <img src="{{ asset("bundles/Frontoffice/img/hero-img-2.jpg")}}" class="img-fluid w-100 h-100 rounded" alt="Deuxième diapositive">#}
{# <a href="/products/Légumes/1/" class="btn px-4 py-2 text-white rounded">Légumes</a>#}
{# </div>#}
{# <div class="carousel-item rounded">#}
{# <img src="{{ asset("bundles/Frontoffice/img/hero-img-333.jpg")}}" class="img-fluid w-100 h-100 rounded" alt="Deuxième diapositive">#}
{# <a href="/products/Poissons/3/" class="btn px-4 py-2 text-white rounded">Poissons</a>#}
{# </div>#}
{#</div>#}
<button class="carousel-control-prev" type="button" data-bs-target="#carouselId" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Précédent</span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#carouselId" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Suivant</span>
</button>
</div>
</div>
</div>
</div>
</div>
<div class="container-fluid featurs py-1">
<div class="container py-5">
<div class="row g-4">
<div class="col-md-6 col-lg-3">
<div class="featurs-item text-center rounded bg-light p-4">
<div class="featurs-icon btn-square rounded-circle bg-secondary mb-5 mx-auto">
<i class="fas fa-car-side fa-3x text-white"></i>
</div>
<div class="featurs-content text-center">
<h5>Livraison gratuite</h5>
<p class="mb-0">Gratuite pour toute commande de plus de 300 $</p>
</div>
</div>
</div>
<div class="col-md-6 col-lg-3 text-center rounded bg-light">
<div class="featurs-item p-4">
<div class="featurs-icon btn-square rounded-circle bg-secondary mb-5 mx-auto">
<i class="fas fa-user-shield fa-3x text-white"></i>
</div>
<div class="featurs-content text-center">
<h5>Paiement sécurisé</h5>
<p class="mb-0">Paiement 100% sécurisé</p>
</div>
</div>
</div>
<div class="col-md-6 col-lg-3">
<div class="featurs-item text-center rounded bg-light p-4">
<div class="featurs-icon btn-square rounded-circle bg-secondary mb-5 mx-auto">
<i class="fas fa-exchange-alt fa-3x text-white"></i>
</div>
<div class="featurs-content text-center">
<h5>Retour sous 30 jours</h5>
<p class="mb-0">Garantie de remboursement sous 30 jours</p>
</div>
</div>
</div>
<div class="col-md-6 col-lg-3 text-center rounded bg-light">
<div class="featurs-item p-4">
<div class="featurs-icon btn-square rounded-circle bg-secondary mb-5 mx-auto">
<i class="fa fa-phone-alt fa-3x text-white"></i>
</div>
<div class="featurs-content text-center">
<h5>Support 24/7</h5>
<p class="mb-0">Support rapide à tout moment</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="container-fluid fruite py-1" id="produits">
<div class="container py-5">
<div class="tab-class text-center">
<div class="row g-4">
<div class="col-lg-4 text-start">
<h1>Nos Produits</h1>
</div>
<div class="col-lg-8 text-end">
<ul class="nav nav-pills d-inline-flex text-center mb-5">
<li class="nav-item">
<a class="d-flex m-2 py-2 bg-light rounded-pill active" data-bs-toggle="pill" href="#tab-0">
<span class="text-dark" style="width: 180px;">Tous les produits</span>
</a>
</li>
{% for cat in categories %}
<li class="nav-item">
<a class="d-flex py-2 m-2 bg-light rounded-pill" data-bs-toggle="pill" href="#tab-{{ loop.index }}">
<span class="text-dark" style="width: 130px;">{{cat.titre}} </span>
</a>
</li>
{% endfor %}
</ul>
</div>
</div>
<div class="tab-content">
<div id="tab-0" class="tab-pane fade show p-0 active">
<div class="row g-4">
<div class="col-lg-12">
<div class="row g-4">
{% for a in articles %}
<div class="col-md-6 col-lg-4 col-xl-3" >
<div class="rounded position-relative fruite-item border border-secondary rounded-bottom">
<div class="fruite-img">
<a href="/product/{{ a["titreCat"] }}/{{ a["titreCat"] }}/{{ a[0].id }}/">
<img src="{{ asset(a[0].imgPrincipale) }}" class="img-fluid w-100 rounded-top" alt=""
style="
height: 210px !important;
padding-left: 20px;
padding-right: 20px;
padding-top: 20px;"
></a>
</div>
<div class="text-white bg-secondary px-3 py-1 rounded position-absolute" style="top: 10px; left: 10px;"> {{a["titreCat"]}} </div>
<div class="p-4">
<h4><a href="/product/{{ a["titreCat"] }}/{{ a["titreCat"] }}/{{ a[0].id }}/" style='color:#45595b'>{{a[0].titre}}</a></h4>
<p>{{a[0].description | raw}}</p>
<div class="input-group" style="width: 60%;margin-top:10px;margin-bottom: 10px;margin-left: auto;margin-right: auto;">
<div class="input-group-btn">
<button type="button" class="btn btn-default btn-number" disabled="disabled" data-type="minus" data-field="quant-{{ a[0].id }}">
<i class="fa fa-minus"></i>
</button>
</div>
<input type="text" name="quant-{{ a[0].id }}" class="form-control input-number" id="quant-{{ a[0].id }}" value="{{ a[0].minQte }}" min="{{ a[0].minQte }}" max="150" unite="{{ a[0].unite }}">
<div class="input-group-btn">
<button type="button" class="btn btn-default btn-number" data-type="plus" data-field="quant-{{ a[0].id }}">
<i class="fa fa-plus"></i>
</button>
</div>
</div>
<div class="d-flex justify-content-between flex-lg-wrap">
<p class="text-dark fs-5 fw-bold mb-0">{{a[0].prixTtc}} DH</p>
<button type="button" class="btn border border-secondary rounded-pill px-3 text-primary" onClick='addToPanierArticle({{ a[0].id }});'><i class="fa fa-cart-plus me-2 text-primary"></i> Au panier</button>
</div>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
</div>
{% for cat in categories %}
<div id="tab-{{loop.index}}" class="tab-pane fade show p-0">
<div class="row g-4">
<div class="col-lg-12">
<div class="row g-4">
{% for a in articles %}
{% if a[0].idSousCategorie == cat.id %}
<div class="col-md-6 col-lg-4 col-xl-3">
<div class="rounded position-relative fruite-item border border-secondary rounded-bottom">
<div class="fruite-img">
<a href="/product/{{ a["titreCat"] }}/{{ a["titreCat"] }}/{{ a[0].id }}/">
<img src="{{ asset(a[0].imgPrincipale) }}" class="img-fluid w-100 rounded-top" alt=""
style="height: 210px !important;padding-left: 20px;padding-right: 20px;padding-top: 20px;">
</a>
</div>
<div class="text-white bg-secondary px-3 py-1 rounded position-absolute" style="top: 10px; left: 10px;"> {{a["titreCat"]}} </div>
<div class="p-4">
<h4>{{a[0].titre}}</h4>
<p>{{a[0].description | raw}}</p>
<div class="d-flex justify-content-between flex-lg-wrap">
<p class="text-dark fs-5 fw-bold mb-0">{{a[0].prixTtc}} DH</p>
<button type="button" class="btn border border-secondary rounded-pill px-3 text-primary" onClick='addToPanierArticle({{ a[0].id }});'><i class="fa fa-cart-plus me-2 text-primary"></i> Au panier</button>
</div>
</div>
</div>
</div>
{% endif %}
{% endfor %}
</div>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
</div>
<div class="container-fluid service py-1">
<div class="container py-5">
<div class="row g-4 justify-content-center">
<div class="col-md-6 col-lg-4">
<a href="#">
<div class="service-item bg-secondary rounded border border-secondary">
<img src="{{ asset("bundles/Frontoffice/img/featur-1.jpg")}}" class="img-fluid rounded-top w-100" alt="">
<div class="px-4 rounded-bottom">
<div class="service-content bg-primary text-center p-4 rounded">
<h5 class="text-white">Pommes Fraîches</h5>
<h3 class="mb-0 text-secondary">20% de réduction</h3>
</div>
</div>
</div>
</a>
</div>
<div class="col-md-6 col-lg-4">
<a href="#">
<div class="service-item bg-dark rounded border border-dark">
<img src="{{ asset("bundles/Frontoffice/img/featur-2.jpg")}}" class="img-fluid rounded-top w-100" alt="">
<div class="px-4 rounded-bottom">
<div class="service-content bg-light text-center p-4 rounded">
<h5 class="text-primary">Fruits Savoureux</h5>
<h3 class="mb-0">Livraison gratuite</h3>
</div>
</div>
</div>
</a>
</div>
<div class="col-md-6 col-lg-4">
<a href="#">
<div class="service-item bg-primary rounded border border-primary">
<img src="{{ asset("bundles/Frontoffice/img/featur-3.jpg")}}" class="img-fluid rounded-top w-100" alt="">
<div class="px-4 rounded-bottom">
<div class="service-content bg-secondary text-center p-4 rounded">
<h5 class="text-white">Légume Exotique</h5>
<h3 class="mb-0 text-primary">30% de réduction</h3>
</div>
</div>
</div>
</a>
</div>
</div>
</div>
</div>
<div class="container-fluid banner my-1" style="background-color:rgb(1 122 8 / 59%) ;">{# #107aa280#}
<div class="container py-4">
<div class="row g-4 align-items-center">
<div class="col-lg-6">
<div class="py-4">
<h2 class="display-3 text-white">Fruits Exotiques Frais</h2>
<p class="fw-normal display-3 text-dark mb-4">dans notre magasin</p>
<p class="mb-4 text-dark">{{ArticlePromo[0].description | raw}}</p> {#href="/promotions"#}
<a onClick='addToPanier({{ ArticlePromo[0].id }},{{ ArticlePromo[0].minQte }});' class="banner-btn btn border-2 border-white rounded-pill text-dark py-3 px-5">ACHETER</a>
</div>
</div>
<div class="col-lg-6">
<div class="position-relative">
<img src="{{ asset(ArticlePromo[0].imgPrincipale) }}" class="img-fluid w-100 rounded" alt="">
<div class="d-flex align-items-center justify-content-center bg-white rounded-circle position-absolute" style="width: 140px; height: 140px; top: 0; left: 0;">
<h2 style="font-size: 100px;padding-left:10px;">{{ArticlePromo[0].minQte}}</h2>
<div class="d-flex flex-column">
{% if typeCompte == "PARTICULIER" %}
<span class="h3 mb-0">{{ArticlePromo[0].prixHT}} DH</span>
{% else %}
<span class="h3 mb-0">{{ArticlePromo[0].prixPro}} DH</span>
{% endif %}
<span class="h4 text-muted mb-0">{{ArticlePromo[0].unite}}</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="container-fluid vesitable py-1">
<div class="container py-5">
<div style="display: flex;"><h1 class="mb-0">Nos Promotions</h1> <a href="/promotions" class="voir_plus mt-3"> ( Voir plus )</a></div>
<div class="owl-carousel vegetable-carousel justify-content-center">
{% for a in ArticlesPromotions %}
<div class="border border-primary rounded position-relative vesitable-item">
<div class="vesitable-img">
<a href="/product/{{ a["titreCat"] }}/{{ a["titreCat"] }}/{{ a[0].id }}/"><img src="{{ asset(a[0].imgPrincipale) }}" class="img-fluid w-100 rounded-top" alt=""
style="
height: 210px !important;
padding-left: 20px;
padding-right: 20px;
padding-top: 20px;"></a>
</div>
<div class="text-white bg-primary px-3 py-1 rounded position-absolute" style="top: 10px; right: 10px;">{{a["titreCat"]}} </div>
<div class="p-4 rounded-bottom">
<h4>{{a[0].titre}}</h4>
<p>{{a[0].description | raw}}</p>
<div class="d-flex justify-content-between flex-lg-wrap">
<p class="text-dark fs-5 fw-bold mb-0">{{a[0].prixTtc}} DH</p>
<input type="text" style="display:none;" name="quant-{{ a[0].id }}" class="form-control input-number" id="quant-{{ a[0].id }}" value="{{ a[0].minQte }}" min="{{ a[0].minQte }}" max="150" unite="{{ a[0].unite }}">
<button class="btn border border-secondary rounded-pill px-3 py-1 mb-4 text-primary" onClick='addToPanierArticle({{ a[0].id }});'>Ajouter au <i class="fa fa-shopping-cart"></i></button>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
{% endblock %}
{% block js %}
<script src='https://cdn.jsdelivr.net/jquery.slick/1.5.9/slick.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/gsap/1.18.2/TweenMax.min.js'></script>
<script type="text/javascript">
var listOfProduct = {{ articlesJson|json_encode|raw }};
function addArtPan(){
var qte = document.getElementById("qte").value;
var id = document.getElementById("idArticle").value;
addToPanier(id,qte);
var lastPan = parseInt(document.getElementById("nbrArticle").innerText);
var nbrPan = lastPan+1;
document.getElementById("nbrArticle").innerText = nbrPan;
}
function addToPanierArticle(id){
var qte = document.getElementById("quant-"+id).value;
addToPanier(id,qte);
var lastPan = parseInt(document.getElementById("nbrArticle").innerText);
var nbrPan = lastPan+1;
document.getElementById("nbrArticle").innerText = nbrPan;
}
function goToPage(url){
window.location = url;
}
/*---------slider----------*/
var $slider = $('.slider');
var $slickTrack = $('.slick-track');
var $slickCurrent = $('.slick-current');
var slideDuration = 900;
//RESET ANIMATIONS
// On init slide change
$slider.on('init', function(slick){
TweenMax.to($('.slick-track'), 0.9, {
marginLeft: 0
});
TweenMax.to($('.slick-active'), 0.9, {
x: 0,
zIndex: 2
});
});
// On before slide change
$slider.on('beforeChange', function(event, slick, currentSlide, nextSlide){
TweenMax.to($('.slick-track'), 0.9, {
marginLeft: 0
});
TweenMax.to($('.slick-active'), 0.9, {
x: 0
});
});
// On after slide change
$slider.on('afterChange', function(event, slick, currentSlide){
TweenMax.to($('.slick-track'), 0.9, {
marginLeft: 0
});
$('.slick-slide').css('z-index','1');
TweenMax.to($('.slick-active'), 0.9, {
x: 0,
zIndex: 2
});
});
//SLICK INIT
$slider.slick({
speed: slideDuration,
dots: true,
waitForAnimate: true,
useTransform: true,
cssEase: 'cubic-bezier(0.455, 0.030, 0.130, 1.000)',
autoplay: true,
autoplaySpeed: 3000
})
//PREV
$('.slick-prev').on('mouseenter', function(){
TweenMax.to($('.slick-track'), 0.6, {
marginLeft: "180px",
ease: Quad.easeOut
});
TweenMax.to($('.slick-current'), 0.6, {
x: -100,
ease: Quad.easeOut
});
});
$('.slick-prev').on('mouseleave', function(){
TweenMax.to($('.slick-track'), 0.4, {
marginLeft: 0,
ease: Sine.easeInOut
});
TweenMax.to($('.slick-current'), 0.4, {
x: 0,
ease: Sine.easeInOut
});
});
//NEXT
$('.slick-next').on('mouseenter', function(){
TweenMax.to($('.slick-track'), 0.6, {
marginLeft: "-180px",
ease: Quad.easeOut
});
TweenMax.to($('.slick-current'), 0.6, {
x: 100,
ease: Quad.easeOut
});
});
$('.slick-next').on('mouseleave', function(){
TweenMax.to($('.slick-track'), 0.4, {
marginLeft: 0,
ease: Quad.easeInOut
});
TweenMax.to($('.slick-current'), 0.4, {
x: 0,
ease: Quad.easeInOut
});
});
</script>
<script src='{{ asset("bundles/Frontoffice/js/products.js") }}'></script>
{% endblock %}