templates/home/home_new.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block body %}
  3. {% set route = app.request.attributes.get('_route') %}
  4. {% set params = app.request.attributes.get('_route_params') %}
  5. {% set cat_id = app.request.get('categoria_id') %}
  6. {{ include('basic/canales.html.twig') }}
  7. <section class="banner-home" data-delay="{{ qi.setting('tiempo-slider-home') }}">
  8.     <div class="swiper swiper-home only-desk">
  9.         <div class="swiper-wrapper">
  10.             {% for item in qi.galeria('home-banner') %}  
  11.             {# {{ dump(item)}} #}
  12.                 <div class="swiper-slide optimagen" style="background-image: url('{{ qi.imagen('imagen-defecto').image }}');" data-imagen="{{ item.image }}">
  13.                         <!-- en desktop dejar un maximo de 4 links por slider -->
  14.                     {% if item.link %}
  15.                     <div class="links">
  16.                         <a href="{{ item.link }}" target="_blank"></a>
  17.                     </div>
  18.                     {% endif %}
  19.                 </div>
  20.             {% endfor %}
  21.         </div>
  22.         <div class="controls d-flex justify-content-center align-items-center">
  23.             <a class="control stop" data-state="play">
  24.                 <img class="imgoptimize" src="{{qi.imagen('imagen-defecto').image}}" data-imagen="{{ qi.imagen('stop_home').image }}" alt="imgoptimize"/>
  25.             </a>
  26.             <p class="color-naranja mx-3 separador">|</p>
  27.             <div class="swiper-button-prev">
  28.                 <img class="imgoptimize" src="{{qi.imagen('imagen-defecto').image}}" data-imagen="{{ qi.imagen('left_home').image }}" alt="imgoptimize"/>
  29.             </div>
  30.             <div class="pagination-banner-home swiper-pagination mx-3"></div>
  31.               <div class="swiper-button-next">
  32.                   <img class="imgoptimize" src="{{qi.imagen('imagen-defecto').image}}" data-imagen="{{ qi.imagen('right_home').image }}" alt="imgoptimize"/>
  33.             </div>
  34.         </div>
  35.     </div>
  36.     
  37.     <div class="swiper swiper-home only-mobile">
  38.         <div class="swiper-wrapper">
  39.             {% for item in qi.galeria('home-banner-mobile') %}
  40.                 <div class="swiper-slide optimagen" style="background-image: url('{{qi.imagen('imagen-defecto').image}}');" data-imagen="{{ item.image }}">
  41.                     <!-- en mobile dejar un maximo de 2 links por slider -->
  42.                     <div class="links">
  43.                         <a href="#"></a>
  44.                         <a href="#"></a>
  45.                     </div>
  46.                 </div>
  47.             {% endfor %}
  48.         </div>
  49.         <div class="controls d-flex justify-content-center align-items-center">
  50.             <a class="control stop" data-state="play">
  51.                 <img src="{{qi.imagen('imagen-defecto').image}}" data-imagen="{{ qi.imagen('stop_home').image }}" alt="img"/>
  52.             </a>
  53.             <p class="color-naranja mx-3 separador">|</p>
  54.             <div class="swiper-button-prev">
  55.                 <img src="{{qi.imagen('imagen-defecto').image}}" data-imagen="{{ qi.imagen('left_home').image }}" alt="img"/>
  56.             </div>
  57.             <div class="pagination-banner-home swiper-pagination mx-3"></div>
  58.               <div class="swiper-button-next">
  59.                   <img src="{{qi.imagen('imagen-defecto').image}}" data-imagen="{{ qi.imagen('right_home').image }}" alt="img"/>
  60.             </div>
  61.         </div>
  62.     </div>
  63.     <div class="aviso only-desk">
  64.         <a href="{{ qi.imagen('banner_ad').link }}" >
  65.             <img class="imgoptimize" src="{{ qi.imagen('imagen-defecto').image }}" data-imagen="{{  qi.imagen('banner_ad').image }}" alt="{{ qi.imagen('banner_ad').alt }}"/>
  66.         </a>
  67.         <img  class="flecha imgoptimize" src="{{ asset(qi.imagen('imagen-defecto').image) }}" data-imagen="{{ qi.imagen('flecha_home').image }}" alt="img">
  68.     </div>
  69.     <div class="aviso only-mobile">
  70.         <img class="imgoptimize" src="{{ asset(qi.imagen('imagen-defecto').image) }}" data-imagen="{{ qi.imagen('seleccionar_home').image }}" alt="img">
  71.     </div>
  72.     <div class="conjunto only-mobile">
  73.         <a href=""><img class="imgoptimize" src="{{ asset(qi.imagen('imagen-defecto').image) }}" data-imagen="{{ qi.imagen('enlinea_home').image }}"  alt="img"></a> <br>
  74.         <a href=""><img  class="imgoptimize" src="{{ asset(qi.imagen('imagen-defecto').image) }}" data-imagen="{{ qi.imagen('chat_home').image }}" alt="img"></a>
  75.     </div>
  76. </section>
  77. <div class="container">
  78.     <div class="row">
  79.         <div class="col-12 col-md-8 offset-md-2 py-2 py-md-4 text-center">
  80.             <h1 class="mb-2 mb-md-4">{{ qi.texto('titulo-productos-home') |raw}}</h1>
  81.             <p>{{ qi.texto('texto-productos-home') |raw}} </p>
  82.         </div>
  83.     </div>
  84. </div>
  85. {# productos destacados #}
  86. <section class="products-home bg-gris3">
  87.     <div class="container pt-4">
  88.         <div class="swiper productos-home">
  89.       <div class="swiper-wrapper">
  90.         {% for item in productos %}
  91.         <div class="swiper-slide">
  92.             <div class="item-producto">
  93.                 <div class="tags-promos">
  94.                     {% if item.descuento %}
  95.                         
  96.                         <p class="prom bg-naranja mb-2">
  97.                             {{ (item.descuento * 100) | round }}% Dcto
  98.                         </p>
  99.                         
  100.                     {% endif %}
  101.                     {% if item.nuevo == 1 %}
  102.                         
  103.                         <p class="prom bg-naranja-claro">nuevo</p>
  104.                         
  105.                     {% endif %}
  106.                 </div>
  107.                 {# enlace en la img #}
  108.                 <a class="img" href="{{ path('producto_slug_subcat', {idproducto: item.id, producto: item.slug}) }}"> 
  109.                     <img class="imgoptimize" src="{{ qi.imagen('imagen-defecto').image }}" alt="{{ item.alt }}" data-imagen="{{ item.imagen }}" alt="img">
  110.                 </a>
  111.                 <div class="text-center px-3">
  112.                     <h4 class="color-negro">{{ item.nombre }}</h4>
  113.                 </div>
  114.                 <p class="sm pt-2">{{ item.resumen | raw }}</p>
  115.                 {% for lista in listas %}
  116.                     {% if lista.producto.plu == item.plu %}
  117.                         <p class="pt-2 anterior">${{ lista.PrecioSinDescuento | number_format }}</p>
  118.                         <p class="pt-1">Desde ${{ lista.precio | number_format }}</p>                    
  119.                     {% endif %}                                    
  120.                 {% endfor %}
  121.                 {% if not listas and item.descuento %}
  122.                     <p class="pt-2 anterior">${{ item.PrecioSinDescuento | number_format }}</p>
  123.                     <p class="pt-1">Desde ${{ item.precio | number_format }}</p>
  124.                 {% endif %}    
  125.                 {% if not item.descuento %}
  126.                     <p class="pt-1">${{ item.precio | number_format }}</p> 
  127.                 {% endif %}    
  128.                 
  129.                 <div class="btn-ver mt-1">
  130.                     <a href="{{ path('product', {id: item.plu, nombre:item.nombre}) }}" class="btn btn-gris btn-item">{{qi.Texto('btn_ver_producto_home')}}</a>
  131.                 </div>
  132.             </div> 
  133.         </div>
  134.         {% endfor %}
  135.       </div>
  136.         <div class="swiper-button-next">
  137.             <img class="imgoptimize" src="{{qi.imagen('imagen-defecto').image}}" data-imagen="{{ qi.imagen('right_home').image }}" alt="img">
  138.         </div>
  139.         <div class="swiper-button-prev">
  140.             <img class="imgoptimize" src="{{qi.imagen('imagen-defecto').image}}" data-imagen="{{ qi.imagen('left_home').image }}" alt="img">
  141.         </div>
  142.     </div>
  143.     </div>
  144. </section>
  145. <div class="conjunto only-desk text-center">
  146.     <!-- <a href="{{qi.setting('chat_en_linea')}}" target="_blank"><img class="imgoptimize" src="{{qi.imagen('imagen-defecto').image}}" data-imagen="{{ qi.imagen('chat_home').image }}" alt="img"/></a> -->
  147.     <div>
  148.         <a class="cursor-pointer" id="btn-action-chats"><img class="imgoptimize" src="{{qi.imagen('imagen-defecto').image}}" data-imagen="{{ qi.imagen('chat_home').image }}" alt="img"/></a>
  149.     </div>
  150.     <div class="btns-chats" id="btns-chats">
  151.         <a href="{{qi.setting('chat_en_linea')}}" target="_blank"><img class="imgoptimize icono" src="/img/SVG/whatsapp-verde.svg" alt="img"/></a>
  152.         <a href="https://telegram.me/Warriorseg" target="_blank"><img class="imgoptimize icono" src="/img/SVG/telegram-azul.svg" alt="img"/></a>
  153.     </div>
  154. </div>
  155. <section class="bg-gris3 py-5 categ-slider">
  156.     <div class="container">
  157.         <div class="row">
  158.             <div class="col-12 d-flex justify-content-between align-items-center">
  159.                 <div class="swiper-button-prev color-naranja">
  160.                     <img class="imgoptimize" src="{{qi.imagen('imagen-defecto').image}}" data-imagen="{{ qi.imagen('left_home').image }}" alt="img"/>
  161.                 </div>
  162.                 <div class="swiper-container categoria-slider px-2">
  163.                     <div class="swiper-wrapper">
  164.                         {% for item in blogs %}
  165.                             <div class="swiper-slide">
  166.                                 <div class="container">
  167.                                     <div class="row">
  168.                                         <div class="col-sm-6">
  169.                                             <!-- <img class="imgoptimize" src="{{ qi.imagen('imagen-defecto').image }}" data-imagen="{{ item.imagenHome }}" alt="item img"> -->
  170.                                             <img class="w-100" src="{{ item.imagenHome }}" alt="item img">
  171.                                         </div>
  172.                                         <div class="col-sm-6 d-flex align-items-center">
  173.                                             <div class="info-swiper">
  174.                                                 <h4 class="color-amarillo">{{ item.categoria }}</h4>
  175.                                                 <h2 class="color-negro pt-4">{{ item.titulo }}</h2>
  176.                                                 <p class="color-negro">{{ item.resumen|raw }} </p>
  177.                                                 <button class="btn btn-naranja mt-4"><a href="{{ path('blog-interna', {id: item.id, nombre: item.titulo}) }}">{{qi.Texto('btn_ver_mas_home')}}</a></button>
  178.                                             </div>
  179.                                         </div>
  180.                                     </div>
  181.                                 </div>
  182.                             </div>
  183.                         {% endfor %}
  184.                     </div>
  185.                 </div>
  186.                 <div class="swiper-button-next color-naranja">
  187.                     <img class="imgoptimize" src="{{qi.imagen('imagen-defecto').image}}" data-imagen="{{ qi.imagen('right_home').image }}" alt="img"/>
  188.                 </div>
  189.             </div>
  190.         </div>
  191.     </div>
  192. </section>
  193. <section class="bg-gris2 w-100 info d-flex justify-content-center align-items-center optimagen" style="background-image: url({{ qi.imagen('imagen-defecto').image }});" data-imagen="{{ qi.imagen('bg-nubes').image }}">
  194.     <div class="container">
  195.         <div class="row text-center">
  196.             <div class="col">
  197.                 <div>
  198.                     {{ qi.imagen('bg-nubes').descripcion | raw }}
  199.                 </div>
  200.             </div>
  201.         </div>
  202.     </div>
  203. </section>
  204. {% if qi.setting('imgvideo_home') == 1 %}
  205. <section>
  206.     <div class="bg-naranja animacion py-5">
  207.         <div class="wave my-lg-5 m-auto d-flex justify-content-center">
  208.             <img class="w-100 imgoptimize" src="{{qi.imagen('imagen-defecto').image}}" data-imagen="{{ qi.imagen('imgvideo_home').image }}" alt="img">
  209.         </div>
  210.     </div>
  211.     {{ include('basic/swiper-firmeza.html.twig') }}    
  212. </section>
  213. {% else %}
  214. <section class="video-home">    
  215.     <iframe class="video" src="https://www.youtube.com/embed/{{qi.imagen('imgvideo_home').link}}" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
  216. </section>
  217. {% endif %}
  218. <section>
  219.     <div class="row w-100 cont pt-2">
  220.         {% for item in qi.galeria('puntos_home') %}
  221.             {% if item.link %}
  222.             {# <a href="{{item.link}}"> #}
  223.                 <a href="{{item.link}}" class="col-sm-4 elementos optimagen" style="background-image: url('{{ qi.imagen('imagen-defecto').image }}');" data-imagen="{{ item.image }}">
  224.                 </a>
  225.             {# </a> #}
  226.             {% else %}
  227.             <div class="col-sm-4 elementos optimagen" style="background-image: url('{{ qi.imagen('imagen-defecto').image }}');" data-imagen="{{ item.image }}">
  228.                 {% for punto in item.puntos %}
  229.                     <a href="{{ path('product',{id: punto.producto.id, nombre: qi.slugify(punto.producto.nombre)}) }}" data-toggle="tooltip" data-placement="top" class="boton" style="top: calc({{ punto.y*100 }}% - 4.2vw); left: calc({{ punto.x*100 }}% - 4.2vw);" title="
  230.                         <div class='tooltip-box' data-href='{{ path('product',{id: punto.producto.id, nombre: qi.slugify(punto.producto.nombre)}) }}''>
  231.                             <a href='{{ path('product',{id: punto.producto.id, nombre: qi.slugify(punto.producto.nombre)}) }}'>
  232.                                 <img src='{{punto.producto.imagen}}' />
  233.                                 <h4 class='color-blanco'>{{ punto.producto.nombre }}</h4>
  234.                                 {# <p class='color-blanco'>${{ punto.producto.precio | number_format }}</p> #}
  235.                                 <i class='icon-ver ft-tx color-blanco'></i>
  236.                             </a>
  237.                         </div>">
  238.                         <div>
  239.                             <button type="button" class="bot color-gris7" >+</button>
  240.                         </div>
  241.                     </a>
  242.                 {% endfor %}
  243.             </div>
  244.             {% endif %}
  245.         {% endfor %}
  246.     </div>
  247. </section>
  248. <section class="info-banner-mobile optimagen d-md-none" style="background-image: url('{{ qi.imagen('imagen-defecto').image }}');" data-imagen="{{ qi.imagen('home_promocion_mobile').image }}">
  249.     <div class="d-flex justify-content-center align-items-center w-100 h-100">
  250.         <h2 class="italic color-blanco text-center">{{ qi.imagen('home_promocion_mobile').titulo }}</h2>
  251.     </div>
  252. </section>
  253. <section class="info-banner optimagen d-none d-md-block" style="background-image: url('{{ qi.imagen('imagen-defecto').image }}');" data-imagen="{{ qi.imagen('home_promocion').image }}">
  254.     <div class="d-flex justify-content-center align-items-center w-100 h-100">
  255.         <h2 class="italic color-blanco text-center">{{ qi.imagen('home_promocion').titulo }}</h2>
  256.     </div>
  257. </section>
  258. {{ include('basic/necesitas-ayuda.html.twig') }}
  259. {{ include('basic/modalProm.html.twig') }}
  260. {% endblock %}
  261. {% block javascripts %}
  262.     <script>
  263.         (function () {
  264.             const mediaQueryMobile = window.matchMedia("(max-width: 1200px)");
  265.             if (mediaQueryMobile.matches) {
  266.                 const botonesPuntos = $('.cont .elementos a');
  267.                 for (let i = 0; i < botonesPuntos.length; i++) {
  268.                     botonesPuntos[i].addEventListener("click", (e) => {
  269.                         e.preventDefault();
  270.                     });
  271.                 }
  272.             }
  273.         })();    
  274.     </script>
  275. {% endblock %}