templates/website/product/product-results.html.twig line 12

Open in your IDE?
  1. {% extends 'website/main.template.html.twig' %}
  2. {% from 'utils.html.twig' import ico, imgUpload %}
  3. {% block category_css %}
  4.     {% if category is defined %}
  5.         {% include 'website/includes/css-category.html.twig' %}
  6.     {% endif %}
  7. {% endblock %}
  8. {% block body %}
  9.     {% include 'website/includes/search-section.html.twig' %}
  10.     {# TITLE - CATEGORIES #}
  11.     {% if category is defined %}
  12.         {# TITLE - CATEGORIES - IMAGE #}
  13.         {% if category.image is not null %}
  14.             <section class="category-banner">
  15.                 {# BANNER #}
  16.                 <div class="banner-img">
  17.                     {{ imgUpload(category.image, enum('AbstractEnum::PATH_OTHERS'), 'category-cover', category.category) }}
  18.                 </div>
  19.                 <div class="container">
  20.                     <div class="wrap category-banner-color">
  21.                         <h1 class="title">{{ category.category }}</h1>
  22.                         <nav class="migalhas">
  23.                             <a href="{{ path('home') }}">{{ getLanguage('home', 'product') }}</a>&ensp;/&ensp;
  24.                             <a href="{{ path('home') }}#categories-container">{{ getLanguage('categories', 'product') }}</a>&ensp;/&ensp;
  25.                             <span>{{ category.category }}</span>
  26.                         </nav>
  27.                         {% if category.description %}
  28.                             <div class="desc">{{ category.description|raw }}</div>
  29.                         {% endif %}
  30.                     </div>
  31.                 </div>
  32.             </section>            
  33.         {# TITLE - CATEGORIES - NO IMAGE #}
  34.         {% else %}
  35.             {% embed 'website/includes/page-title.html.twig' with { pageTitle: category.category }%}
  36.                 {% block migalhas %}
  37.                     <a href="{{ path('home') }}">{{ getLanguage('home', 'product') }}</a>&ensp;/&ensp;
  38.                     <a href="{{ path('home') }}#categories-container">{{ getLanguage('categories', 'product') }}</a>&ensp;/&ensp;
  39.                     <span>{{ category.category }}</span>
  40.                 {% endblock %}
  41.             {% endembed %}
  42.         {% endif %}
  43.     {# TITLE - SEARCH STRING #}
  44.     {% elseif search is defined %}
  45.         {% set emptySearch = search %}
  46.         {% embed 'website/includes/page-title.html.twig' %}
  47.             {% block header %}
  48.                 <h1>{{ getLanguage('results_for', 'product') }} <em>“{{ search }}”</em></h1>
  49.             {% endblock %}
  50.             {% block migalhas %}
  51.                 <a href="{{ path('home') }}">{{ getLanguage('home', 'product') }}</a>&ensp;/&ensp;<span>{{ getLanguage('search_results', 'product') }}</span>
  52.             {% endblock %}
  53.         {% endembed %}
  54.     {% endif %}
  55.     {# COUPON #}
  56.     {% if productCoupon is defined and productCoupon %}
  57.         <div class="coupon-success coupon-category">
  58.             <p>
  59.                 {{ getLanguage('coupon_code', 'product') }}
  60.                 <strong>{{ productCoupon.key  }}</strong>
  61.                 {{ getLanguage('successfully_applied', 'product') }}.
  62.             </p>
  63.         </div>
  64.     {% endif %}
  65.     <div class="{{ hasResult ? 'bg-alt' }}">
  66.         <div class="container">
  67.             <div class="results">
  68.                 {# CONTEM ITENS #}
  69.                 {% if hasResult %}
  70.                     {% set firstShow = 6 %}
  71.                     {% for section in dataSearch %}
  72.                         {% set secLabel = section.name|lower %}
  73.                         {% if section.items|length > 0 %}
  74.                             <section class="js--results-section"
  75.                                 data-status="initial"
  76.                                 data-route="{{
  77.                                     path('productListSearchOrder', { 
  78.                                         couponKey: (productCoupon is defined and productCoupon ? productCoupon.key : '')
  79.                                     }) 
  80.                                 }}"
  81.                                 data-tipo="{{ section.enum }}"
  82.                                 data-search="{{ search }}"
  83.                                 data-label="{{ secLabel }}"
  84.                                 data-init-offset="{{ section.items|length }}"
  85.                                 data-total="{{ section.total ?? '' }}"
  86.                                 data-category="{{ (category is defined)? category.id }}">
  87.                                 <header>
  88.                                     <h2>{{ ico(section.ico) }} {{ section.name }} ({{ section.total ?? '' }})</h2>
  89.                                     <div class="ordenacao">
  90.                                         <i class="loader">{{ ico('loader-wish') }}</i>
  91.                                         <select class="custom-select search-combo">
  92.                                             <option value="{{ enum('ProductOfferEnum::ORDER_BY') }}">
  93.                                                 {{ getLanguage('order_by', 'product') }}
  94.                                             </option>
  95.                                             <option value="{{ enum('ProductOfferEnum::LOWEST_PRICE') }}">
  96.                                                 {{ getLanguage('lowest_price', 'product') }}
  97.                                             </option>
  98.                                             <option value="{{ enum('ProductOfferEnum::BIGGEST_PRICE') }}">
  99.                                                 {{ getLanguage('biggest_price', 'product') }}
  100.                                             </option>
  101.                                             <option value="{{ enum('ProductOfferEnum::MOST_RELEVANT') }}">
  102.                                                 {{ getLanguage('most_relevant', 'product') }}
  103.                                             </option>
  104.                                         </select>
  105.                                     </div>
  106.                                 </header>
  107.                                 <div class="products-list js--results-container">
  108.                                     {% include 'website/product/product-results-items.html.twig' with {'items': section.items } %}
  109.                                 </div>
  110.                                 <div class="content-loader">
  111.                                     <i class="loader">{{ ico('loader-wish') }}</i>
  112.                                 </div>
  113.                                 <div class="todos">
  114.                                     {% if section.total > firstShow %}
  115.                                         <button type="button" class="js--search-load-more" data-label="{{ secLabel }}">
  116.                                             <span>{{ getLanguage('loading', 'util') }} &hellip;</span>
  117.                                             <span>{{ getLanguage('see_more', 'product') }}</span>
  118.                                         </button>
  119.                                     {% endif %}
  120.                                 </div>
  121.                             </section>
  122.                         {% endif %}
  123.                     {% endfor %}
  124.                 {# VAZIO #}
  125.                 {% else %}
  126.                     <div class="box-aviso">
  127.                         <div class="aviso-img">
  128.                             <div class="img-ico">
  129.                                 {{ ico('no-results') }}
  130.                             </div>
  131.                         </div>
  132.                         <h2 class="titulo-aviso">
  133.                             <span>
  134.                                 {{ getLanguage('not_find', 'product') }} {{ search }} &hellip;&ensp;
  135.                             </span>
  136.                             <img src="{{ cdn }}img/emoji_crying.png">
  137.                         </h2>
  138.                         <p class="sub">{{ getLanguage('check_if_word', 'product') }}</p>
  139.                         <a href="{{ path('home') }}" class="btn-acao">
  140.                             <i class="fas fa-arrow-left ico-left"></i>
  141.                             {{ getLanguage('back_to_home', 'product') }}
  142.                         </a>
  143.                     </div>
  144.                 {% endif %}
  145.             </div>
  146.         </div>
  147.     </div>
  148.     
  149. {% endblock %}