templates/main/shop/show.html.twig line 1

Open in your IDE?
  1. {% extends base ~"/base.html.twig" %}
  2. {% import "macros/modal.html.twig" as modal %}
  3. {% block modal %}
  4. {{ modal.defaultLest()}}
  5. {% endblock %}
  6. {% block javascripts %}
  7. <div id="fb-root"></div>
  8. <script>(function (d, s, id) {
  9.         var js, fjs = d.getElementsByTagName(s)[0];
  10.         if (d.getElementById(id)) return;
  11.         js = d.createElement(s); js.id = id;
  12.         js.src = "https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.0";
  13.         fjs.parentNode.insertBefore(js, fjs);
  14.     }(document, 'script', 'facebook-jssdk'));</script>
  15. {% endblock %}
  16. {% block foot %}
  17. <script src="{{asset('js/article_detail.js') }}"></script>
  18. {% endblock %}
  19. {% block title %}{{ app_name }} - {{article.title}} - Boutique de vente en ligne {% endblock %}
  20. {% block favicon %}
  21. {% for item in article.images|slice(0,1) %}
  22. <link rel="shortcut icon" width="48px" height="48px" href="{{ asset('img/article/' ~ item.name ) }}">
  23. {% else %}
  24. <link rel="shortcut icon" width="48px" height="48px" href="{{ asset('img/' ~ site.logo2) }}">
  25. {% endfor %}
  26. {% endblock %}
  27. {% block main %}
  28. <main class="main">
  29.     <nav aria-label="breadcrumb" class="breadcrumb-nav border-0 mb-0">
  30.         <div class="container d-flex align-items-center">
  31.             <ol class="breadcrumb">
  32.                 <li class="breadcrumb-item">
  33.                     <a href="{{ path('home') }}">{{'Home'|trans}}</a>
  34.                 </li>
  35.                 <li class="breadcrumb-item">
  36.                     <a href="{{ path('articles') }}">{{ 'Shop'|trans }}</a>
  37.                 </li>
  38.                 <li class="breadcrumb-item">
  39.                     <a href="{{path('articles_category',{
  40.                         category3_slug:article.category.category2.category3.slug,
  41.                         category2_slug:article.category.category2.slug,
  42.                         category:article.category.slug}) }}">
  43.                         {{ article.category.title }}
  44.                     </a>
  45.                 </li>
  46.                 <li class="breadcrumb-item active" aria-current="page">{{ article.title }}</li>
  47.             </ol>
  48.             <!-- End .pager-nav -->
  49.         </div>
  50.         <!-- End .container -->
  51.     </nav>
  52.     <!-- End .breadcrumb-nav -->
  53.     <div class="page-content">
  54.         {% include "includes/_alerte.html.twig" %}
  55.         <div class="container">
  56.             <div class="product-details-top">
  57.                 <div class="row">
  58.                     <div class="col-md-4">
  59.                         <div class="product-gallery">
  60.                             <figure class="product-main-image">
  61.                                 {% import "macros/etats.html.twig" as etats %}
  62.                                 {% if article.quantity <= 0 %} <span class="product-label label-out bg-danger">{{'Out of
  63.                                     Stock'|trans}}</span>
  64.                                     {% endif %}
  65.                                     {{ etats.articleLabel(article.label) }}
  66.                                     {% for item in article.images|slice(0,1) %}
  67.                                     <img id="product-zoom" src="{{ asset('img/article/' ~ item.name ) }}"
  68.                                         alt="{{ article.title }}"
  69.                                         data-zoom-image="{{ asset('img/article/' ~ item.name ) }}" alt="product image">
  70.                                     {% else %}
  71.                                     <div class="single-prd-item">
  72.                                         <img class="img-fluid" src="{{ asset('img/article/vide.png') }}"
  73.                                             alt="{{ article.title }}">
  74.                                     </div>
  75.                                     {% endfor %}
  76.                             </figure>
  77.                             <!-- End .product-main-image -->
  78.                             <div class="row">
  79.                                 <div class="col-12 product-image-thumbs">
  80.                                     {% for item in article.images %}
  81.                                     <a href="{{ asset('img/article/' ~ item.name )}}" class="product-gallery-show">
  82.                                         <div class="product-image-thumb">
  83.                                             <img src="{{ asset('img/article/' ~ item.name )}}" width="100px"
  84.                                                 alt="{{ item.name }}">
  85.                                         </div>
  86.                                     </a>
  87.                                     {% endfor %}
  88.                                 </div>
  89.                             </div>
  90.                         </div>
  91.                         <!-- End .product-gallery -->
  92.                     </div>
  93.                     {# <div class="col-md-4">
  94.                         <div class="product-gallery">
  95.                             <figure class="product-main-image">
  96.                                 {% import "macros/etats.html.twig" as etats %}
  97.                                 {% if article.quantity <= 0 %} <span class="product-label label-out bg-danger">{{'Out of
  98.                                     Stock'|trans}}</span>
  99.                                     {% else %}
  100.                                     {{ etats.articleLabel(article.label) }}
  101.                                     {% endif %}
  102.                                     {% for item in article.images|slice(0,1) %}
  103.                                     <img id="product-zoom" src="{{ asset('img/article/' ~ item.name ) }}"
  104.                                         alt="{{ article.title }}"
  105.                                         data-zoom-image="{{ asset('img/article/' ~ item.name ) }}" alt="product image">
  106.                                     {% else %}
  107.                                     <div class="single-prd-item">
  108.                                         <img class="img-fluid" src="{{ asset('img/article/vide.png') }}"
  109.                                             alt="{{ article.title }}">
  110.                                     </div>
  111.                                     {% endfor %}
  112.                             </figure>
  113.                             <!-- End .product-main-image -->
  114.                             <div class="row">
  115.                                 <div class="col-12 product-image-thumbs">
  116.                                     {% for item in article.images %}
  117.                                     <a href="{{ asset('img/article/' ~ item.name )}}" class="product-gallery-show">
  118.                                         <div class="product-image-thumb">
  119.                                             <img src="{{ asset('img/article/' ~ item.name )}}" width="100px"
  120.                                                 alt="{{ item.name }}">
  121.                                         </div>
  122.                                     </a>
  123.                                     {% endfor %}
  124.                                 </div>
  125.                             </div>
  126.                         </div>
  127.                         <!-- End .product-gallery -->
  128.                     </div> #}
  129.                     <!-- End .col-md-6 -->
  130.                     <div class="col-md-8">
  131.                         <div class="product-details sticky-content">
  132.                             <h1 class="product-title">{{ article.title }}</h1>
  133.                             <!-- End .product-title -->
  134.                             <div class="ratings-container">
  135.                                 <div class="ratings">
  136.                                     <div class="ratings-val" style="width: {{ rating(article) }}%"></div>
  137.                                     <!-- End .ratings-val -->
  138.                                 </div>
  139.                                 <!-- End .ratings -->
  140.                                 <a class="ratings-text" href="#product-accordion" id="review-link">( {{
  141.                                     article.comments|length}} {{ (article.comments|length > 1 )?
  142.                                     'Commentaires':'Commentaire' }} )</a>
  143.                             </div>
  144.                             <!-- End .rating-container -->
  145.                             <div class="product-price">
  146.                                 {% if article.reduction > 0 %}
  147.                                 <span class="new-price">{{ article.getNewPrice |price_format }} {{
  148.                                     site.current_name}}</span>
  149.                                 <span class="old-price">{{ article.formatterPrice }}</span>
  150.                                 {% else %}
  151.                                 <span class="new-price">{{ article.getNewPrice |price_format }} {{
  152.                                     site.current_name }}</span>
  153.                                 {% endif %}
  154.                             </div>
  155.                             <!-- End .product-price -->
  156.                             <div class="product-content">
  157.                                 <p>{{ article.detail }}</p>
  158.                                 
  159.                             </div>
  160.                             <!-- End .product-content -->
  161.                             <div class="row">
  162.                                 <div class="col-lg-12 my-4">
  163.                                     <small id="helpId" class="text-muted">Stock: {{ article.quantity }} </small>
  164.                                     <form class="form-row" action="{{ path('article_show_add_cart') }}" method="post">
  165.                                         {% if article.quantity > 0 %}
  166.                                         <div class="form-group col-lg-3">
  167.                                             <input type="hidden" name="article_id" value="{{ article.id }}">
  168.                                             <input type="number" class="form-control" min="1"
  169.                                                 max="{{ article.quantity }}" name="qty" value="1">
  170.                                         </div>
  171.                                         <div class="form-group col-lg-6 product-details-action">
  172.                                             <button type="submit" class="btn-product btn-cart btn" name="card-add">
  173.                                                 {{'Add to cart'|trans}}
  174.                                             </button>
  175.                                         </div>
  176.                                         {% else %}
  177.                                         <p>Le produit est en rupture de stock</p>
  178.                                         {% endif %}
  179.                                     </form>
  180.                                 </div>
  181.                             </div>
  182.                             <div class="product-details-action">
  183.                                 <div class="details-action-wrapper article-{{article.id }}">
  184.                                     {% if app.user %} {% if not isToFavoris(app.user, article) %}
  185.                                     <a href="{{ path('favoris_add',{id:article.id}) }}" data-id="{{ article.id }}"
  186.                                         class="btn-product show btn-wishlist js-favoris js-add-favoris">
  187.                                         <span>{{'add to wishlist'|trans}}</span>
  188.                                     </a>
  189.                                     {% else %}
  190.                                     <a href="{{ path('favoris_remove',{id:article.id}) }}" data-id="{{ article.id }}"
  191.                                         class="btn-product show btn-wishlist js-favoris  js-remove-favoris">
  192.                                         <span class=" text-danger">{{'remove to wishlist'|trans}}</span>
  193.                                     </a>
  194.                                     {% endif %} {% else %}
  195.                                     <a href="#" class="btn-product show btn-wishlist js-favoris js-favoris-login">
  196.                                         <span>{{'add to wishlist'|trans}}</span>
  197.                                     </a>
  198.                                     {% endif %}
  199.                                 </div>
  200.                                 <div class="details-action-wrapper">
  201.                                     <a target="_blank"
  202.                                         href="https://api.whatsapp.com/send?phone={{ site.tel_whatsapp }}&text=Salut, Je souhaite commander cet article: {{ url('articles_show', { category: article.category.slug, slug: article.slug, id: article.id}) }}"
  203.                                         class="btn-product show">
  204.                                         <span>
  205.                                             <i class="icon-whatsapp"></i> Commander Via whatsapp
  206.                                         </span>
  207.                                     </a>
  208.                                 </div>
  209.                                 <!-- End .details-action-wrapper -->
  210.                             </div>
  211.                             <!-- End .product-details-action -->
  212.                             <div class="product-details-footer">
  213.                                 <div class="product-cat">
  214.                                     <span>{{'Category'|trans}}:</span>
  215.                                     <a href="{{path('articles_category',{
  216.                                         category3_slug:article.category.category2.category3.slug,
  217.                                         category2_slug:article.category.category2.slug,
  218.                                         category:article.category.slug}) }}">{{article.category.category2.title}} |
  219.                                         {{article.category.title}}</a>
  220.                                 </div>
  221.                                 <!-- End .product-cat -->
  222.                                 {% include base ~"/shop/_social_icons.html.twig" %}
  223.                             </div>
  224.                             <!-- End .product-details-footer -->
  225.                             <div class="accordion accordion-plus product-details-accordion" id="product-accordion">
  226.                                 <div class="card card-box card-sm">
  227.                                     <div class="card-header" id="product-desc-heading">
  228.                                         <h2 class="card-title">
  229.                                             <a class="collapsed" role="button" data-toggle="collapse"
  230.                                                 href="#product-accordion-desc" aria-expanded="false"
  231.                                                 aria-controls="product-accordion-desc">
  232.                                                 Description
  233.                                             </a>
  234.                                         </h2>
  235.                                     </div>
  236.                                     <!-- End .card-header -->
  237.                                     <div id="product-accordion-desc" class="collapse"
  238.                                         aria-labelledby="product-desc-heading" data-parent="#product-accordion">
  239.                                         <div class="card-body">
  240.                                             <div class="product-desc-content">
  241.                                                 <p>{{ article.description|raw }}</p>
  242.                                             </div>
  243.                                             <!-- End .product-desc-content -->
  244.                                         </div>
  245.                                         <!-- End .card-body -->
  246.                                     </div>
  247.                                     <!-- End .collapse -->
  248.                                 </div>
  249.                                 <!-- End .card -->
  250.                                 <div class="card card-box card-sm">
  251.                                     {% if article.options is not empty %}
  252.                                     <div class="card-header" id="product-info-heading">
  253.                                         <h2 class="card-title">
  254.                                             <a class="collapsed" role="button" data-toggle="collapse"
  255.                                                 href="#product-accordion-info" aria-expanded="false"
  256.                                                 aria-controls="product-accordion-info">
  257.                                                 Information suplémentaire ({{article.options|length}})
  258.                                             </a>
  259.                                         </h2>
  260.                                     </div>
  261.                                     {% endif %}
  262.                                     <!-- End .card-header -->
  263.                                     <div id="product-accordion-info" class="collapse"
  264.                                         aria-labelledby="product-info-heading" data-parent="#product-accordion">
  265.                                         <div class="card-body">
  266.                                             <div class="product-desc-content">
  267.                                                 <div class="row">
  268.                                                     {% for item in article.options %}
  269.                                                     <div class="col-md-6 col-12 font-weight-bold">{{
  270.                                                         item.title|capitalize }}</div>
  271.                                                     <div class="col-md-6 col-12">{{ item.content }}</div>
  272.                                                     {% endfor %}
  273.                                                 </div>
  274.                                             </div>
  275.                                             <!-- End .product-desc-content -->
  276.                                         </div>
  277.                                         <!-- End .card-body -->
  278.                                     </div>
  279.                                     <!-- End .collapse -->
  280.                                 </div>
  281.                                 <!-- End .card -->
  282.                                 <div class="card card-box card-sm">
  283.                                     <div class="card-header" id="product-review-heading">
  284.                                         <h2 class="card-title">
  285.                                             <a class="" role="button" data-toggle="collapse"
  286.                                                 href="#product-accordion-review" aria-expanded="true"
  287.                                                 aria-controls="product-accordion-review">
  288.                                                 {{ (article.comments|length > 1 )?
  289.                                                 'Commentaires':'Commentaire' }} ({{ article.comments|length}})
  290.                                             </a>
  291.                                         </h2>
  292.                                     </div>
  293.                                     <!-- End .card-header -->
  294.                                     <div id="product-accordion-review" class="collapse show"
  295.                                         aria-labelledby="product-review-heading" data-parent="#product-accordion">
  296.                                         <div class="card-body">
  297.                                             <div id="load_comment" class="reviews">
  298.                                                 {% include base ~"/shop/_comment.html.twig" %}
  299.                                             </div>
  300.                                             <!-- End .reviews -->
  301.                                             {% if is_buy %} {% if not is_comment %}
  302.                                             <div class="form-comment">
  303.                                                 {{ form_start(formComment, { 'attr':{ 'id':'form_comment',
  304.                                                 'novalidate':'novalidate' } }) }}
  305.                                                 <div class="row">
  306.                                                     <div class="ratings-comment col-12 col-md-12 text-center">
  307.                                                         <a class="star star-1" href="#">
  308.                                                             <i class="icon-star" style="font-size:3rem"></i>
  309.                                                         </a>
  310.                                                         <a href="#" class="star star-2">
  311.                                                             <i class="icon-star" style="font-size:3rem"></i>
  312.                                                         </a>
  313.                                                         <a href="#" class="star star-3">
  314.                                                             <i class="icon-star" style="font-size:3rem"></i>
  315.                                                         </a>
  316.                                                         <a href="#" class="star star-4">
  317.                                                             <i class="icon-star" style="font-size:3rem"></i>
  318.                                                         </a>
  319.                                                         <a href="#" class="star star-5">
  320.                                                             <i class="icon-star" style="font-size:3rem"></i>
  321.                                                         </a>
  322.                                                         <input id="rating" type="hidden" name="rating" value="">
  323.                                                     </div>
  324.                                                     <div class="col-md-12 col-12">
  325.                                                         {{form_row(formComment.content)}}
  326.                                                     </div>
  327.                                                 </div>
  328.                                                 {% if is_granted('ROLE_CLIENT') %}
  329.                                                 <div class="text-center">
  330.                                                     <button type="submit" id="btn-add-comment"
  331.                                                         class="btn btn-primary">Evaluer</button>
  332.                                                 </div>
  333.                                                 {% endif %} {{ form_widget(formComment) }} {{ form_end(formComment) }}
  334.                                             </div>
  335.                                             {% endif %} {% endif %}
  336.                                         </div>
  337.                                         <!-- End .card-body -->
  338.                                     </div>
  339.                                     <!-- End .collapse -->
  340.                                 </div>
  341.                                 <!-- End .card -->
  342.                             </div>
  343.                             <!-- End .accordion -->
  344.                         </div>
  345.                         <!-- End .product-details -->
  346.                     </div>
  347.                     <!-- End .col-md-6 -->
  348.                 </div>
  349.                 <!-- End .row -->
  350.             </div>
  351.             <!-- End .product-details-top -->
  352.             <hr class="mt-3 mb-5">
  353.             <h2 class="title text-center mb-4">Ces produits peuvent vous intéresser</h2>
  354.             <!-- End .title text-center -->
  355.             <div class="owl-carousel owl-full carousel-equal-height carousel-with-shadow" data-toggle="owl"
  356.                 data-owl-options='{
  357.                         "nav": true,
  358.                         "dots": false,
  359.                         "margin": 20,
  360.                         "loop": false,
  361.                         "autoplay":true,
  362.                         "autoplayTimeout":4000,
  363.                         "responsive": {
  364.                             "0": {
  365.                                 "items":2
  366.                             },
  367.                             "480": {
  368.                                 "items":2
  369.                             },
  370.                             "768": {
  371.                                 "items":2
  372.                             },
  373.                             "992": {
  374.                                 "items":3
  375.                             },
  376.                             "1200": {
  377.                                 "items":5
  378.                             }
  379.                         }
  380.                     }'>
  381.                 {% for item in article_rand %}
  382.                 {% include base ~ "/home/_article.html.twig" %}
  383.                 {% endfor %}
  384.             </div>
  385.             <!-- End .owl-carousel -->
  386.         </div>
  387.         <!-- End .container -->
  388.     </div>
  389.     <!-- End .page-content -->
  390. </main>
  391. {% endblock %}