templates/components/theme/_extras.html.twig line 1

Open in your IDE?
  1. <section class="restock-product">
  2.     <div class="container">
  3.         <div class="row">
  4.             {# HOME-PROD #}
  5.             {% if extras.homeprod|length > 0 %}
  6.                 <div class="col-lg-12 col-md-12 mb-4">
  7.                     <div class="section-title">
  8.                         {# <h2>{{ 'homepage_sections.promotions'|trans }}</h2> #}
  9.                         <h2>Home Prod</h2>
  10.                     </div>
  11.                     <div class="featured-product__text p-2">
  12.                         <div class="featured-product__slider owl-carousel">
  13.                             {% for vinyl in extras.homeprod|slice(0, 15)|sort((a, b) => b.updatedAt <=> a.updatedAt) %}
  14.                                 <div class="featured-product__item bg-white p-2 h-100 text-center">
  15.                                     <div class="featured-product__item__pic d-flex justify-content-center">
  16.                                         <a href="{{ path('vinyls_show', {'slug': vinyl.slug}) }}">
  17.                                             {% if vinyl.img %}
  18.                                                 <img src="{{ asset('uploads/vinyles/' ~ vinyl.slug ~ '/' ~ vinyl.img) }}" class="card-img-top" alt="{{ vinyl.designation }} - vinyle {{ vinyl.styles[0] }}">
  19.                                             {% else %}
  20.                                                 <img src="{{ asset('uploads/vinyles/default_vinyl.png') }}" class="card-img-top" alt="{{ vinyl.designation }} - vinyle {{ vinyl.styles[0] }}">
  21.                                             {% endif %}
  22.                                         </a>
  23.                                     </div>
  24.                                     <div class="homeprod-product__item__text my-2 d-flex flex-column justify-content-center">
  25.                                         <h6>
  26.                                             <a href="{{ path('vinyls_show', {'slug': vinyl.slug}) }}">{{ vinyl.designation }}</a>
  27.                                         </h6>
  28.                                         <span>{{ vinyl.price|number_format(2) }} €{% if vinyl.state == "neuf" %} <span class="vat">{{ 'homepage_sections.ttc'|trans }}</span>{% endif %}</span>
  29.                                     </div>
  30.                                     {% if vinyl.quantity > 0 %}
  31.                                         {% if app.user %}
  32.                                             <a href="{{ path('cart_add', {'id': vinyl.id}) }}" class="btn btn-primary mt-2 w-100">
  33.                                                 <i class="fa fa-shopping-cart" aria-hidden="true"></i>
  34.                                             </a>
  35.                                         {% else %}
  36.                                             <button type="button" class="btn btn-primary mt-2 w-100" data-bs-toggle="modal" data-bs-target="#needConnexionModal">
  37.                                                 <i class="fa fa-shopping-cart" aria-hidden="true"></i>
  38.                                             </button>
  39.                                         {% endif %}
  40.                                     {% else %}
  41.                                         <h3 class="error">{{ 'homepage_sections.out_of_stock'|trans }}</h3>
  42.                                     {% endif %}
  43.                                 </div>
  44.                             {% endfor %}
  45.                         </div>
  46.                     </div>
  47.                     <div class="row">
  48.                         <div class="col-12 text-end">
  49.                             <a class="fw-bold fs-5 color-primary" href="{{ path('vinyls_search') }}?homeprod=1">{{ 'homepage_sections.see_all_homeprods'|trans }}</a>
  50.                         </div>
  51.                     </div>
  52.                 </div>
  53.             {% endif %}
  54.             {# TOP 10 #}
  55.             <div class="col-lg-12 col-md-12 mb-4">
  56.                 <div class="section-title">
  57.                     <h2>{{ 'homepage_sections.top_vinyls'|trans }}</h2>
  58.                 </div>
  59.                 <div class="best-product__text p-2">
  60.                     <div class="best-product__slider owl-carousel">
  61.                         {% set i = 1 %}
  62.                         {% for vinyl in extras.best|sort((a, b) => a.updatedAt <=> b.updatedAt)|slice(0, 15) %}
  63.                             <div class="best-product__item bg-white p-2 h-100 text-center">
  64.                                 <div class="best-product__item__pic d-flex flex-column align-items-center justify-content-center text-start">
  65.                                     <div class="num bg-primary rounded p-1 align-self-start ms-2" style="position:absolute;top:.7rem;left:1rem">#{{ i }}</div>
  66.                                     <a href="{{ path('vinyls_show', {'slug': vinyl.slug}) }}">
  67.                                     {% if vinyl.img %}
  68.                                         <img src="{{ asset('uploads/vinyles/' ~ vinyl.slug ~ '/' ~ vinyl.img) }}" class="card-img-top" alt="{{ vinyl.designation }} - vinyle {{ vinyl.styles[0] }}">
  69.                                     {% else %}
  70.                                         <img src="{{ asset('uploads/vinyles/default_vinyl.png') }}" class="card-img-top" alt="{{ vinyl.designation }} - vinyle {{ vinyl.styles[0] }}">
  71.                                     {% endif %}
  72.                                     </a>
  73.                                 </div>
  74.                                 <div class="best-product__item__text my-2 d-flex flex-column justify-content-center">
  75.                                     <h6>
  76.                                         <a href="{{ path('vinyls_show', {'slug': vinyl.slug}) }}">{{ vinyl.designation }}</a>
  77.                                     </h6>
  78.                                     <span>{{ vinyl.price|number_format(2) }} €{% if vinyl.state == "neuf" %} <span class="vat">{{ 'homepage_sections.ttc'|trans }}</span>{% endif %}</span>
  79.                                 </div>
  80.                                 {% if vinyl.quantity > 0 %}
  81.                                         {% if app.user %}
  82.                                             <a href="{{ path('cart_add', {'id': vinyl.id}) }}" class="btn btn-primary mt-2 w-100">
  83.                                                 <i class="fa fa-shopping-cart" aria-hidden="true"></i>
  84.                                             </a>
  85.                                         {% else %}
  86.                                             <button type="button" class="btn btn-primary mt-2 w-100" data-bs-toggle="modal" data-bs-target="#needConnexionModal">
  87.                                                 <i class="fa fa-shopping-cart" aria-hidden="true"></i>
  88.                                             </button>
  89.                                         {% endif %}
  90.                                     {% else %}
  91.                                         <h3 class="error">{{ 'homepage_sections.out_of_stock'|trans }}</h3>
  92.                                     {% endif %}
  93.                             </div>
  94.                             {% set i = i + 1 %}
  95.                         {% endfor %}
  96.                     </div>
  97.                 </div>
  98.             </div>
  99.             {# NEW NEUF #}
  100.             <div class="col-lg-12 col-md-12 mb-4">
  101.                 <div class="section-title">
  102.                     <h2>{{ 'homepage_sections.new_items'|trans }}</h2>
  103.                 </div>
  104.                 <div class="new1-product__text p-2">
  105.                     <div class="new1-product__slider owl-carousel">
  106.                         {% for vinyl in extras.news['neufs']|slice(0, 15)|sort((a, b) => b.createdAt <=> a.createdAt) %}
  107.                             <div class="new1-product__item bg-white p-2 h-100 text-center">
  108.                                 <div class="new1-product__item__pic d-flex justify-content-center">
  109.                                     <a href="{{ path('vinyls_show', {'slug': vinyl.slug}) }}">
  110.                                     {% if vinyl.img %}
  111.                                         <img src="{{ asset('uploads/vinyles/' ~ vinyl.slug ~ '/' ~ vinyl.img) }}" class="card-img-top" alt="{{ vinyl.designation }} - vinyle {{ vinyl.styles[0] }}">
  112.                                     {% else %}
  113.                                         <img src="{{ asset('uploads/vinyles/default_vinyl.png') }}" class="card-img-top" alt="{{ vinyl.designation }} - vinyle {{ vinyl.styles[0] }}">
  114.                                     {% endif %}
  115.                                     </a>
  116.                                 </div>
  117.                                 <div class="new1-product__item__text my-2">
  118.                                     <h6>
  119.                                         <a href="{{ path('vinyls_show', {'slug': vinyl.slug}) }}">{{ vinyl.designation }}</a>
  120.                                     </h6>
  121.                                     <span>{{ vinyl.price|number_format(2) }} € <span class="vat">{{ 'homepage_sections.ttc'|trans }}</span></span>
  122.                                 </div>
  123.                                 {% if vinyl.quantity > 0 %}
  124.                                     {% if app.user %}
  125.                                         <a href="{{ path('cart_add', {'id': vinyl.id}) }}" class="btn btn-primary mt-2 w-100">
  126.                                             <i class="fa fa-shopping-cart" aria-hidden="true"></i>
  127.                                         </a>
  128.                                     {% else %}
  129.                                         <button type="button" class="btn btn-primary mt-2 w-100" data-bs-toggle="modal" data-bs-target="#needConnexionModal">
  130.                                             <i class="fa fa-shopping-cart" aria-hidden="true"></i>
  131.                                         </button>
  132.                                     {% endif %}
  133.                                 {% else %}
  134.                                     <h3 class="error">{{ 'homepage_sections.out_of_stock'|trans }}</h3>
  135.                                 {% endif %}
  136.                             </div>
  137.                         {% endfor %}
  138.                     </div>
  139.                 </div>
  140.             </div>
  141.             {# NEW OCCASION #}
  142.             <div class="col-lg-12 col-md-12 mb-4">
  143.                 <div class="section-title">
  144.                     <h2>{{ 'homepage_sections.new_used'|trans }}</h2>
  145.                 </div>
  146.                 <div class="new2-product__text p-2">
  147.                     <div class="new2-product__slider owl-carousel">
  148.                         {% for vinyl in extras.news['occasions']|slice(0, 15)|sort((a, b) => b.createdAt <=> a.createdAt) %}
  149.                             <div class="new2-product__item bg-white p-2 h-100 text-center">
  150.                                 <div class="new2-product__item__pic d-flex justify-content-center">
  151.                                     <a href="{{ path('vinyls_show', {'slug': vinyl.slug}) }}">
  152.                                     {% if vinyl.img %}
  153.                                         <img src="{{ asset('uploads/vinyles/' ~ vinyl.slug ~ '/' ~ vinyl.img) }}" class="card-img-top" alt="{{ vinyl.designation }} - vinyle {{ vinyl.styles[0] }}">
  154.                                     {% else %}
  155.                                         <img src="{{ asset('uploads/vinyles/default_vinyl.png') }}" class="card-img-top" alt="{{ vinyl.designation }} - vinyle {{ vinyl.styles[0] }}">
  156.                                     {% endif %}
  157.                                     </a>
  158.                                 </div>
  159.                                 <div class="new2-product__item__text my-2">
  160.                                     <h6>
  161.                                         <a href="{{ path('vinyls_show', {'slug': vinyl.slug}) }}">{{ vinyl.designation }}</a>
  162.                                     </h6>
  163.                                     <span>{{ vinyl.price|number_format(2) }} €</span>
  164.                                 </div>
  165.                                 {% if vinyl.quantity > 0 %}
  166.                                     {% if app.user %}
  167.                                         <a href="{{ path('cart_add', {'id': vinyl.id}) }}" class="btn btn-primary mt-2 w-100">
  168.                                             <i class="fa fa-shopping-cart" aria-hidden="true"></i>
  169.                                         </a>
  170.                                     {% else %}
  171.                                         <button type="button" class="btn btn-primary mt-2 w-100" data-bs-toggle="modal" data-bs-target="#needConnexionModal">
  172.                                             <i class="fa fa-shopping-cart" aria-hidden="true"></i>
  173.                                         </button>
  174.                                     {% endif %}
  175.                                 {% else %}
  176.                                     <h3 class="error">{{ 'homepage_sections.out_of_stock'|trans }}</h3>
  177.                                 {% endif %}
  178.                             </div>
  179.                         {% endfor %}
  180.                     </div>
  181.                 </div>
  182.             </div>
  183.             {# RESTOCK #}
  184.             <div class="col-lg-12 col-md-12 mb-4">
  185.                 <div class="section-title">
  186.                     <h2>{{ 'homepage_sections.restock'|trans }}</h2>
  187.                 </div>
  188.                 <div class="restock-product__text p-4">
  189.                     <div class="restock-product__slider owl-carousel">
  190.                         {% for vinyl in extras.restock|sort((a, b) => b.updatedAt <=> a.updatedAt)|slice(0, 15) %}
  191.                             <div class="restock-product__item bg-white p-2 h-100 text-center">
  192.                                 <div class="restock-product__item__pic d-flex justify-content-center">
  193.                                     <a href="{{ path('vinyls_show', {'slug': vinyl.slug}) }}">
  194.                                     {% if vinyl.img %}
  195.                                         <img src="{{ asset('uploads/vinyles/' ~ vinyl.slug ~ '/' ~ vinyl.img) }}" class="card-img-top" alt="{{ vinyl.designation }} - vinyle {{ vinyl.styles[0] }}">
  196.                                     {% else %}
  197.                                         <img src="{{ asset('uploads/vinyles/default_vinyl.png') }}" class="card-img-top" alt="{{ vinyl.designation }} - vinyle {{ vinyl.styles[0] }}">
  198.                                     {% endif %}
  199.                                     </a>
  200.                                 </div>
  201.                                 <div class="restock-product__item__text my-2">
  202.                                     <h6>
  203.                                         <a href="{{ path('vinyls_show', {'slug': vinyl.slug}) }}">{{ vinyl.designation }}</a>
  204.                                     </h6>
  205.                                     <span>{{ vinyl.price|number_format(2) }} €{% if vinyl.state == "neuf" %} <span class="vat">{{ 'homepage_sections.ttc'|trans }}</span>{% endif %}</span>
  206.                                 </div>
  207.                                 {% if vinyl.quantity > 0 %}
  208.                                     {% if app.user %}
  209.                                         <a href="{{ path('cart_add', {'id': vinyl.id}) }}" class="btn btn-primary mt-2 w-100">
  210.                                             <i class="fa fa-shopping-cart" aria-hidden="true"></i>
  211.                                         </a>
  212.                                     {% else %}
  213.                                         <button type="button" class="btn btn-primary mt-2 w-100" data-bs-toggle="modal" data-bs-target="#needConnexionModal">
  214.                                             <i class="fa fa-shopping-cart" aria-hidden="true"></i>
  215.                                         </button>
  216.                                     {% endif %}
  217.                                 {% else %}
  218.                                     <h3 class="error">{{ 'homepage_sections.out_of_stock'|trans }}</h3>
  219.                                 {% endif %}
  220.                             </div>
  221.                         {% endfor %}
  222.                     </div>
  223.                     <div class="row">
  224.                         <div class="col-12 text-end">
  225.                             <a class="fw-bold fs-5 color-primary" href="{{ path('vinyls_index', {'stylename': 'restock'}) }}">{{ 'homepage_sections.see_all_restock'|trans }}</a>
  226.                         </div>
  227.                     </div>
  228.                 </div>
  229.                 </div>
  230.             </div>
  231.             
  232.             {# REPRESS #}
  233.             <div class="col-lg-12 col-md-12 mb-4">
  234.                 <div class="section-title">
  235.                     <h2>{{ 'homepage_sections.represses'|trans }}</h2>
  236.                 </div>
  237.                 <div class="repress-product__text p-4">
  238.                     <div class="repress-product__slider owl-carousel">
  239.                         
  240.                         {% for vinyl in extras.repress|slice(0, 15)|sort((a, b) => b.createdAt <=> a.createdAt) %}
  241.                             <div class="repress-product__item bg-white p-2 h-100 text-center">
  242.                                 <div class="repress-product__item__pic d-flex justify-content-center">
  243.                                     <a href="{{ path('vinyls_show', {'slug': vinyl.slug}) }}">
  244.                                     {% if vinyl.img %}
  245.                                         <img src="{{ asset('uploads/vinyles/' ~ vinyl.slug ~ '/' ~ vinyl.img) }}" class="card-img-top" alt="{{ vinyl.designation }} - vinyle {{ vinyl.styles[0] }}">
  246.                                     {% else %}
  247.                                         <img src="{{ asset('uploads/vinyles/default_vinyl.png') }}" class="card-img-top" alt="{{ vinyl.designation }} - vinyle {{ vinyl.styles[0] }}">
  248.                                     {% endif %}
  249.                                     </a>
  250.                                 </div>
  251.                                 <div class="repress-product__item__text my-2">
  252.                                     <h6>
  253.                                         <a href="{{ path('vinyls_show', {'slug': vinyl.slug}) }}">{{ vinyl.designation }}</a>
  254.                                     </h6>
  255.                                     <span>{{ vinyl.price|number_format(2) }} €{% if vinyl.state == "neuf" %} <span class="vat">{{ 'homepage_sections.ttc'|trans }}</span>{% endif %}</span>
  256.                                 </div>
  257.                                 {% if vinyl.quantity > 0 %}
  258.                                     {% if app.user %}
  259.                                         <a href="{{ path('cart_add', {'id': vinyl.id}) }}" class="btn btn-primary mt-2 w-100">
  260.                                             <i class="fa fa-shopping-cart" aria-hidden="true"></i>
  261.                                         </a>
  262.                                     {% else %}
  263.                                         <button type="button" class="btn btn-primary mt-2 w-100" data-bs-toggle="modal" data-bs-target="#needConnexionModal">
  264.                                             <i class="fa fa-shopping-cart" aria-hidden="true"></i>
  265.                                         </button>
  266.                                     {% endif %}
  267.                                 {% else %}
  268.                                     <h3 class="error">{{ 'homepage_sections.out_of_stock'|trans }}</h3>
  269.                                 {% endif %}
  270.                             </div>
  271.                         {% endfor %}
  272.                     </div>
  273.                 </div>
  274.                 <div class="row">
  275.                         <div class="col-12 text-end">
  276.                             <a class="fw-bold fs-5 color-primary" href="{{ path('vinyls_search') }}?repress=1">{{ 'homepage_sections.see_all_represses'|trans }}</a>
  277.                         </div>
  278.                     </div>
  279.                 </div>
  280.             
  281.             {# PROMO #}
  282.         {#{% if extras.promo|length > 0 %}
  283.                 <div class="col-lg-12 col-md-12 mb-4">
  284.                     <div class="section-title">
  285.                         <h2>{{ 'homepage_sections.promotions'|trans }}</h2>
  286.                     </div>
  287.                     <div class="featured-product__text p-2">
  288.                         <div class="featured-product__slider owl-carousel">
  289.                             {% for vinyl in extras.promo|slice(0, 15)|sort((a, b) => b.updatedAt <=> a.updatedAt) %}
  290.                                 <div class="featured-product__item bg-white p-2 h-100 text-center">
  291.                                     <div class="featured-product__item__pic d-flex justify-content-center">
  292.                                         <a href="{{ path('vinyls_show', {'slug': vinyl.slug}) }}">
  293.                                         {% if vinyl.img %}
  294.                                             <img src="{{ asset('uploads/vinyles/' ~ vinyl.slug ~ '/' ~ vinyl.img) }}" class="card-img-top" alt="{{ vinyl.designation }} - vinyle {{ vinyl.styles[0] }}">
  295.                                         {% else %}
  296.                                             <img src="{{ asset('uploads/vinyles/default_vinyl.png') }}" class="card-img-top" alt="{{ vinyl.designation }} - vinyle {{ vinyl.styles[0] }}">
  297.                                         {% endif %}
  298.                                         </a>
  299.                                     </div>
  300.                                     <div class="featured-product__item__text my-2">
  301.                                         <h6>
  302.                                             <a href="{{ path('vinyls_show', {'slug': vinyl.slug}) }}">{{ vinyl.designation }}</a>
  303.                                         </h6>
  304.                                         <del class="me-2">{{ vinyl.price|number_format(2) }} €</del> <span class="fw-bold color-primary">{{ vinyl.promo|number_format(2) }} €{% if vinyl.state == "neuf" %} <span class="vat">{{ 'homepage_sections.ttc'|trans }}</span>{% endif %}</span>
  305.                                     </div>
  306.                                     {% if vinyl.quantity > 0 %}
  307.                                         {% if app.user %}
  308.                                             <a href="{{ path('cart_add', {'id': vinyl.id}) }}" class="btn btn-primary mt-2 w-100">
  309.                                                 <i class="fa fa-shopping-cart" aria-hidden="true"></i>
  310.                                             </a>
  311.                                         {% else %}
  312.                                             <button type="button" class="btn btn-primary mt-2 w-100" data-bs-toggle="modal" data-bs-target="#needConnexionModal">
  313.                                                 <i class="fa fa-shopping-cart" aria-hidden="true"></i>
  314.                                             </button>
  315.                                         {% endif %}
  316.                                     {% else %}
  317.                                         <h3 class="error">{{ 'homepage_sections.out_of_stock'|trans }}</h3>
  318.                                     {% endif %}
  319.                                 </div>
  320.                             {% endfor %}
  321.                         </div>
  322.                     </div>
  323.                     <div class="row">
  324.                         <div class="col-12 text-end">
  325.                             <a class="fw-bold fs-5 color-primary" href="{{ path('vinyls_search') }}?promo=1">{{ 'homepage_sections.see_all_promos'|trans }}</a>
  326.                         </div>
  327.                     </div>
  328.                 </div>
  329.             {% endif %}#}
  330.         </div>
  331.     </div>
  332. </section>