templates/AtechNetCoreBundle/Common/header.html.twig line 1

Open in your IDE?
  1. {% set customerTypeId = app.request.session.get('customerTypeId') %}
  2. {% set domainId = app.request.session.get('domainId') %}
  3. {% set isAdminLogin = app.request.session.get('isAdminLogin') %}
  4. {% set locale = app.request.locale %}
  5. {% set defaultLocale = app.request.session.get('defaultLocale') %}
  6. {% if app.request.attributes.get('_route') not in ['cart_show', 'checkout_customer', 'checkout_address', 'checkout_shipping_and_payment', 'checkout_review', 'checkout_success'] %}
  7.     {% for nanobar in nanobars %}
  8.         <div id="nanobar-item" class="nanobar py-1" style="background-color:{{ nanobar.color }};">
  9.             <div class="container">
  10.                 {{- nanobar.message | raw -}}
  11.             </div>
  12.         </div>
  13.     {% endfor %}
  14. {% endif %}
  15. {% if mode == 'standard' %}
  16.     <header class="header smart-scroll">
  17.         <div class="header-top">
  18.             <div class="container">
  19.                 {% if isBazaarPage %}
  20.                     <span class="web-description">{{ 'bazaar header top web description'|trans }}</span>
  21.                 {% else %}
  22.                     <span class="web-description">{{ 'header top web description'|trans }}</span>
  23.                 {% endif %}
  24.                 <div class="page-list">
  25.                     {% for page in headerPageList %}
  26.                         <a href="{{ page.link }}">{{ page.title }}</a>
  27.                     {% endfor %}
  28.                 </div>
  29.             </div>
  30.         </div>
  31.         <div class="header-bottom{% if customerTypeId == 2 %} partner{% endif %}">
  32.             <div class="container px-1 px-lg-3">
  33.                 <div class="row align-items-center row-no-padding">
  34.                     <div class="col menu-and-logo col-md-auto">
  35.                         <button id="nav-icon" class="toggle-sidebar toggle-button toggle-sidebar">
  36.                             <img loading="lazy" decoding="async" src="{{ asset('theme/images/icon/hamburger.svg') }}">
  37.                         </button>
  38.                         {% set logoPartnerSuffix = '' %}
  39.                         {% if customerTypeId == 2 %}
  40.                             {% set logoPartnerSuffix = '-partner' %}
  41.                         {% endif %}
  42.                         {%- set logoSrc = isAdminLogin ? 'theme/images/furbify-logo-admin-login.svg' : 'theme/images/furbify-logo.svg' -%}
  43.                         <a href="{{ path('homepage') }}" class="logo"><img loading="lazy" decoding="async" src="{{ asset(logoSrc) }}" alt="{{ 'Furbify premium renewed, used electronics' | trans }}" width="143" height="37" /></a>
  44.                         {% if customerTypeId == 2 %}
  45.                             <div class="logo-vertical-line"></div>
  46.                             <img loading="lazy" decoding="async" src="{{ asset('theme/images/partner-dashboard.svg') }}" alt="Partner dashboard" width="100" class="partner-dashboard-logo" />
  47.                         {% endif %}
  48.                     </div>
  49.                     <div class="col flex-md-grow-1 text-end px-0">
  50.                         <a href="#widget-search" class="dropdown-toggle search-dropdown-toggle ms-auto ms-xl-0" role="button" aria-expanded="false" aria-controls="widget-search" data-bs-toggle="collapse">
  51.                             <img loading="lazy" decoding="async" src="{{ asset('theme/images/icon/header-mobile-search.svg') }}" width="15" height="18" />
  52.                         </a>
  53.                         <div id="widget-search" class="d-flex justify-content-around collapse pe-0 pe-xl-5">
  54.                             <div class="search-bar m-auto">
  55.                                 <form method="get" action="{{ path('product_search') }}" class="input-group search-form justify-content-center" id="searchbox">
  56.                                     <input type="text" id="ajax_search" name="fs" placeholder="{{ 'keyword...' |trans }}" class="form-control mb-0 col col-2" value="{{ filterSearch }}"  aria-label="{{ 'keyword...' | trans }}" aria-describedby="button-submit-widget-search">
  57.                                     <button id="button-clear-widget-search" type="button" class="input-group-text border-right col col-auto d-none"></button>
  58.                                     <button id="button-arrow-submit-widget-search" type="submit" class="input-group-text border-radius col col-auto d-none"></button>
  59.                                     <button id="button-submit-widget-search" type="submit" class="input-group-text border-radius col col-auto  event-log-view-all-results">
  60.                                         <img loading="lazy" decoding="async" src="{{ asset('theme/images/icon/header-search.svg') }}" height="16" width="auto" class="m-auto" alt="{{ 'Search' | trans }}" />
  61.                                     </button>
  62.                                     <div id="widget-search-results" data-no-matches="{{ 'No results' | trans }}" data-view-all="{{ 'View all results' | trans }}" data-action="{{ path('product_live_search') }}" data-url="{{ path('product_search') }}" data-loading="{{ 'Loading' | trans }}" data-try="{{ 'Try this' |trans }}" data-featured="{{ 'Featured products' |trans }}" data-popular="{{ 'Popular categories' |trans }}" data-log="{{ path('product_log_search') }}" class="text-start d-none"></div>
  63.                                 </form>
  64.                             </div>
  65.                             <a href="tel:{{ phone_support }}" class="support-link d-none d-xl-flex flex-row align-items-center me-0 ms-0">
  66.                                 <img loading="lazy" decoding="async" src="{{ asset('theme/images/icon/header-telephone.svg') }}" width="32" height="32" alt="{{ 'header-top call us'|trans }}"/>
  67.                                 <div class="ms-2 text-elements d-flex flex-column text-start">
  68.                                     <span>{{ 'header-top call us'|trans }}</span>
  69.                                     <strong>{{ phone_support }}</strong>
  70.                                 </div>
  71.                             </a>
  72.                         </div>
  73.                     </div>
  74.                     <div class="col text-end icons col-md-auto flex-grow-0 col-sm-auto">
  75.                         <div class="account-dropdown dropdown dropleft">
  76.                             <button class="dropdown-toggle account-dropdown-toggle d-none d-md-block" type="button" id="dropdownAccountButton" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  77.                                 <img loading="lazy" decoding="async" src="{{ asset('theme/images/icon/header-profile.svg') }}" alt="{{ 'Account' | trans }}">
  78.                                 <div class="d-none d-xl-block">
  79.                                     {% if isLoggedIn() and customer.firstName is defined and customer.lastName is defined %}
  80.                                         {% if defaultLocale == 'hu' %}
  81.                                             <span>{{ customer.lastName ~ ' ' ~ customer.firstName |slice(0, 1) ~ '.' }}</span>
  82.                                         {% else %}
  83.                                             <span>{{ customer.firstName |slice(0, 1) ~ '. ' ~ customer.lastName }}</span>
  84.                                         {% endif %}
  85.                                     {% else %}
  86.                                         <span>{{ 'Account' | trans }}</span>
  87.                                     {% endif %}
  88.                                 </div>
  89.                             </button>
  90.                             <a href="{{ path('customer_login') }}" class="account-dropdown-toggle d-flex d-md-none">
  91.                                 <img loading="lazy" decoding="async" src="{{ asset('theme/images/icon/header-profile.svg') }}">
  92.                             </a>
  93.                             <div class="dropdown-menu" aria-labelledby="dropdownAccountButton">
  94.                                 {% if isLoggedIn() %}
  95.                                     <a class="dropdown-item" href="{{ path('customer_account') }}">{{ 'Account' | trans }}</a>
  96.                                     <a class="dropdown-item" href="{{ path('customer_orders') }}">{{ 'Orders' | trans }}</a>
  97.                                     <a class="dropdown-item log-out" href="{{ path('customer_logout') }}">{{ 'Log out' | trans }}</a>
  98.                                 {% else %}
  99.                                     <a class="dropdown-item" href="{{ path('customer_login') }}">{{ 'Log in' | trans }}</a>
  100.                                     <a class="dropdown-item" href="{{ path('customer_registration') }}">{{ 'Sign up' | trans }}</a>
  101.                                 {% endif %}
  102.                             </div>
  103.                         </div>
  104.                         {%- if cart -%}
  105.                             {{- include(template_from_string(cart)) -}}
  106.                         {%- else -%}
  107.                             <div id="cart" class="cart-dropdown dropdown">
  108.                                 <button class="dropdown-toggle" type="button" id="dropdownCartButton" data-bs-toggle="dropdown">
  109.                                     <i class="fas fa-shopping-cart"></i>
  110.                                     <div class="d-none d-lg-block">
  111.                                         <span>{{ 'Cart' | trans }}</span>
  112.                                     </div>
  113.                                     {%- if cartItemsCount > 0 -%}
  114.                                         <div class="shopping-cart-item">
  115.                                             <img loading="lazy" decoding="async" src="{{ asset('theme/images/icon/header-cart-item-count.svg') }}" class="m-0 p-0" alt="{{ 'Cart'|trans }}">
  116.                                             <span>{{ cartItemsCount }}</span>
  117.                                         </div>
  118.                                     {%- endif -%}
  119.                                 </button>
  120.                                 <div class="dropdown-menu" aria-labelledby="dropdownCartButton"></div>
  121.                             </div>
  122.                         {%- endif -%}
  123.                         <div class="dropdown dropdown-store-switcher">
  124.                             <button class="btn" type="button" id="dropdown-store-switcher" data-bs-toggle="modal" data-bs-target="#modal-language-store" aria-haspopup="true" aria-expanded="false">
  125.                                 <img loading="lazy" decoding="async" src="{{ asset('theme/images/flag/' ~ locale ~ '.svg') }}" alt="{{ (locale ~ ' icon alt') | trans }}">
  126.                                 <div class="d-md-block">{{ locale |upper }}</div>
  127.                             </button>
  128.                         </div>
  129.                     </div>
  130.                 </div>
  131.             </div>
  132.         </div>
  133.     </header>
  134.     <nav class="main-nav {{ customerType }}">
  135.         {% if menu.push is defined and menu.push |length %}
  136.             <ul class="main-menu container m-auto has-push-menu">
  137.         {% else %}
  138.             <ul class="main-menu container m-auto">
  139.         {% endif %}
  140.             {% if menu.product is defined %}
  141.                 <li>
  142.                     <a aria-label="{{ menu.product.name |trans }}">
  143.                         <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 24 19" xml:space="preserve"><g><rect x="3.4" y="3.5" class="st0" width="18" height="2"/><rect x="3.4" y="8.5" class="st0" width="18" height="2"/><rect x="3.4" y="13.5" class="st0" width="18" height="2"/></g></svg>
  144.                         {{ menu.product.name |trans }}
  145.                     </a>
  146.                     <div class="sub-menu">
  147.                         <div class="container">
  148.                             <ul>
  149.                                 {% for mainMenuItem in menu.product.children %}
  150.                                     <li>
  151.                                         <a href="{{ mainMenuItem.href }}" aria-label="{{ mainMenuItem.name }}">
  152.                                             {% if mainMenuItem.icon %}
  153.                                                 <span class="icon">{{ mainMenuItem.icon |raw }}</span>
  154.                                             {% else %}
  155.                                                 <span class="icon"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512"><path d="M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512z"/></svg></span>
  156.                                             {% endif %}
  157.                                             {{ mainMenuItem.name }}
  158.                                             {% if mainMenuItem.children %}
  159.                                                 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 448 512"><path d="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"/></svg>
  160.                                             {% endif %}
  161.                                         </a>
  162.                                         {% if mainMenuItem.children %}
  163.                                             <div class="sub-menu-block">
  164.                                                 <div class="d-flex flex-wrap flex-column h-100">
  165.                                                     {% for group in mainMenuItem.children %}
  166.                                                         <div class="sub-menu-group">
  167.                                                             {% if group.name %}
  168.                                                                 <strong>{{ group.name }}:</strong><br>
  169.                                                             {% endif %}
  170.                                                             <ul class="sub-menu-list">
  171.                                                                 {% for item in group.children %}
  172.                                                                     <li>
  173.                                                                         <a href="{{ item.href }}">{{ item.title }}</a>
  174.                                                                         {% if item.subTitle %}
  175.                                                                             ({{ item.subTitle }})
  176.                                                                         {% endif %}
  177.                                                                         {%- if item.label -%}
  178.                                                                             <span>{{ item.label | trans }}!</span>
  179.                                                                         {%- endif -%}
  180.                                                                     </li>
  181.                                                                 {% endfor %}
  182.                                                             </ul>
  183.                                                         </div>
  184.                                                     {% endfor %}
  185.                                                 </div>
  186.                                             </div>
  187.                                         {% endif %}
  188.                                     </li>
  189.                                 {% endfor %}
  190.                             </ul>
  191.                         </div>
  192.                     </div>
  193.                 </li>
  194.             {% endif %}
  195.             {% if menu.standard is defined and menu.standard |length %}
  196.                 {% for mainMenuItem in menu.standard %}
  197.                     <li
  198.                         {% if mainMenuItem.name == 'BLACK FRIDAY' %}
  199.                             class="black-friday-menu-link"
  200.                         {% elseif mainMenuItem.name == 'The Zone akció' or mainMenuItem.name in ['Kiárusítás', 'Výpredaj', 'Výprodej', 'Sale', 'Bestseller'] %}
  201.                             class="the-zone-menu-link"
  202.                         {% elseif mainMenuItem.name == 'Valentínska akcia' or mainMenuItem.name == 'Valentýnská akce'%}
  203.                             class="valentine-menu-link"
  204.                         {% endif %}
  205.                         {% if domainId in [1,2,3,4,9,5] %}
  206.                             {% if loop.length - loop.index0 == 2 %} class="ms-auto"{% endif %}
  207.                         {% else %}
  208.                             {% if loop.last %} class="ms-auto"{% endif %}
  209.                         {% endif %}
  210.                     >
  211.                         <a href="{{ mainMenuItem.href }}" aria-label="{{ mainMenuItem.name }}">
  212.                             <span class="visually-hidden">{{- mainMenuItem.name -}}</span>
  213.                             <div class="nav-standard-item">
  214.                                 {%- if mainMenuItem.icon is defined and mainMenuItem.icon is not null -%}
  215.                                     <div class="icon me-1">{{ mainMenuItem.icon |raw }}</div>
  216.                                 {%- endif -%}
  217.                                 <span>{{- mainMenuItem.name -}}</span>
  218.                             </div>
  219.                         </a>
  220.                     </li>
  221.                 {% endfor %}
  222.             {% endif %}
  223.             {% if menu.push is defined and menu.push |length %}
  224.                 {% for mainMenuItem in menu.push %}
  225.                     {% if loop.first %}
  226.                         <li style="margin-left: auto">
  227.                     {% else %}
  228.                         <li>
  229.                     {% endif %}
  230.                         <a href="{{ mainMenuItem.href }}">{{ mainMenuItem.name }}</a>
  231.                     </li>
  232.                 {% endfor %}
  233.             {% endif %}
  234.         </ul>
  235.     </nav>
  236. {% elseif mode == 'minimal' %}
  237.     <header class="header minimal">
  238.         <div class="container">
  239.             <div class="row my-4">
  240.                 {%- set logoSrc = isAdminLogin ? 'theme/images/furbify-logo-admin-login.svg' : 'theme/images/furbify-logo.svg' -%}
  241.                 <div class="col-6" style="border-right: 1px solid #e9e9e9">
  242.                     <a href="{{ path('homepage') }}" class="logo" style="float: right;"><img loading="lazy" decoding="async" src="{{ asset(logoSrc) }}" alt="Furbify" width="135" height="35" /></a>
  243.                 </div>
  244.                 <div class="col-6 d-flex">
  245.                     <div style="margin: auto auto auto 0; font-style: italic;">{{ 'secure checkout' | trans }}</div>
  246.                 </div>
  247.             </div>
  248.         </div>
  249.     </header>
  250. {% endif %}