templates/includes/header.html.twig line 1

Open in your IDE?
  1. {% block content %}
  2. {% set totalAmount = ((totalAmount is defined) and totalAmount)%}
  3. {% set categories = app_category_get_data() %}
  4. {% set params = app_get_params() %}
  5. {% set userType = (app.user)?app.user.UserType:'' %}
  6. {% set role = (app.user)?app.user.UserRoles:'' %}
  7. <header class="header box-shadow">
  8.    
  9.             <div class="header-middle sticky-header" data-sticky-options="{'mobile': true}">
  10.                 <div class="container">
  11.                     <div class="header-left">
  12.                         <button class="mobile-menu-toggler" type="button">
  13.                             <i class="fas fa-bars fa-2x"></i>
  14.                             <!-- <img src="/mecstore/assets/images/custom/logo-soci.png" alt="Mecstore" width="111" height="44"> -->
  15.                         </button>
  16.                         <a href="/" class="logo">
  17.                         {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  18.                             <img src="/mecstore/assets/images/custom/logo-soci.png" alt="Mecstore" class="d-block" width="262" height="auto" >
  19.                         {% else %}
  20.                             <img src="/mecstore/b2c/assets/images/custom/logo.png" alt="Mecstore" class="d-block" width="262" height="auto" >
  21.                         {% endif %}
  22.                             {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  23.                             <a href="{{ path('account-index') }}" class="d-block d-lg-none text-dark">
  24.                                 Benvenuto {# <strong>{{app.user.firstname}} {{app.user.lastname}}</strong> #}
  25.                             </a>   
  26.                             {% endif %}
  27.                         </a>
  28.                     </div>                  
  29.                     <div class="header-center">
  30.                         <div
  31.                             class="header-icon header-search header-search-inline header-search-category w-lg-max text-right mt-0">
  32.                             <a href="#" class="search-toggle" role="button"><i class="icon-search-3"></i></a>
  33.                             <form action="{{ path('search') }}" id="search-form" name="search-form" method="get">
  34.                                 <div class="header-search-wrapper">
  35.                                     <input type="search" class="form-control" name="term" id="term" value=""
  36.                                         placeholder="Cerca prodotto..." required>
  37.                                     <div class="select-custom">
  38.                                         <select id="cat" name="cat">
  39.                                             {% if categories %}
  40.                                                 <option value="" selected data-href="{{ path('shop-category', {categoryname: 'ovunque',category: 0}) }}">tutto il catalogo</option> 
  41.                                                 {% for category in categories %}
  42.                                                     {% if params.cat is defined %}
  43.                                                         {% if params.cat == category.id %}
  44.                                                             <option value="{{category.Id}}" selected data-href="{{ path('shop-category', {categoryname: category.key,category: category.id}) }}">{{category.Name}}</option>   
  45.                                                         {% else %}
  46.                                                             <option value="{{category.Id}}" data-href="{{ path('shop-category', {categoryname: category.key,category: category.id}) }}">{{category.Name}}</option>   
  47.                                                         {% endif %}  
  48.                                                     {% else %}
  49.                                                             <option value="{{category.Id}}" data-href="{{ path('shop-category', {categoryname: category.key,category: category.id}) }}">{{category.Name}}</option>
  50.                                                     {% endif %} 
  51.                                                 {% endfor %}
  52.                                             {% endif %}                                         
  53.                                         </select>
  54.                                     </div><!-- End .select-custom -->
  55.                                     <button class="btn icon-magnifier bg-dark text-white term-search-btn" title="search"
  56.                                         type="submit"></button>
  57.                                 </div><!-- End .header-search-wrapper -->
  58.                             </form>
  59.                         </div><!-- End .header-search -->
  60.                     </div>
  61.                     {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  62.                     <div class="header-right ml-0 ml-lg-auto">
  63.                         {% if role == 'Manager' %}
  64.                             {% set sp_selected = 'socio' %}
  65.                             {% if ms_price_view == 'vendita' %}
  66.                                 {% set sp_selected = 'vendita' %}
  67.                             {% endif %}
  68.                             <select class="custom-select switch-prezzi" name="switch-prezzi">
  69.                                 <option value="socio" {% if sp_selected == 'socio' %}selected{% endif %}>Socio</option>
  70.                                 <option value="vendita" {% if sp_selected == 'vendita' %}selected{% endif %}>Vendita</option>
  71.                             </select>
  72.                         {% endif %}
  73.                         <a href="{{ path('account-index') }}" class="pr-2 pr-xl-5 border-right border-dark d-none d-lg-block ">
  74.                             Benvenuto {# <strong>{{app.user.firstname}} {{app.user.lastname}}</strong> #}
  75.                         </a>
  76.                         <a href="{{ path('account-logout') }}" class="pl-2 pl-xl-5 d-none d-lg-block " >
  77.                             {{ 'general.logout' | trans }}
  78.                         </a>
  79.                     </div>
  80.                     {%  else %}
  81.                     <div class="header-right ml-0 ml-lg-auto">
  82.                         <a href="{{ path('account-login') }}" class="pr-2 pr-xl-5 border-right border-dark d-none d-lg-block login-lnk">
  83.                            {{ 'general.login' | trans }}
  84.                         </a>                        
  85.                     </div>
  86.                     {% endif %}
  87.                 </div>
  88.             </div>
  89.             <div class="header-bottom sticky-header" data-sticky-options="{'mobile': false}">
  90.                 <!-- header sticky -->
  91.                 <div class="container">
  92.                     <div class="header-left">
  93.                         <a href="/" class="logo">
  94.                             <img src="/mecstore/assets/images/custom_icons/logo-mecstore.png" alt="Logo">
  95.                         </a>
  96.                     </div>
  97.                     <div class="header-center ml-4">
  98.                         <nav class="main-nav w-100">                            
  99.                             <ul class="menu">
  100.                                 <li class="mr-xl-5 mr-4" >
  101.                                     <a href="/" class="page-index" data-name="/">Home</a>
  102.                                 </li>
  103.                                 <li class="mr-xl-5 mr-4" >
  104.                                     <a class="page-index">catalogo</a>
  105.                                     <div class="megamenu megamenu-fixed-width megamenu-3cols">
  106.                                         <div class="row">
  107.                                             {% set count = 0%}
  108.                                             {% for category in app_category_get_data() %}                                                                                                                         
  109.                                             {% if (count == 0) %}<div class="col-lg-4">{% endif %}
  110.                                                 <ul class="submenu"> 
  111.                                                     <li><a href="{{ path('shop-category', {categoryname: category.key,category: category.id}) }}">{{ category.Name }}</a></li>
  112.                                                 </ul> 
  113.                                             {% set count = count + 1 %}                                        
  114.                                             {% if (count % 9 == 0) %} </div><div class="col-lg-4"> {% endif %}
  115.                                             {% endfor %}  
  116.                                             </div>                                            
  117.                                                 {#header - generate pimcore navigation #}
  118.                                                 
  119.                                                 {#header - navigation icons#}                                            
  120.                                         </div>
  121.                                     </div><!-- End .megamenu -->
  122.                                 </li>
  123.                                 <li class="mr-xl-5 mr-4" >
  124.                                     <a class="page-index">FORNITORI</a>
  125.                                     <div class="megamenu megamenu-fixed-width megamenu-3cols providers">
  126.                                         <div class="row">
  127.                                             {% set count = 0%}
  128.                                             {% set brands = app_brand_get_data() %}
  129.                                             {% for brand in brands %}                                                                              
  130.                                             {% if (count == 0) %}<div class="col-lg-2">{% endif %}
  131.                                                 <ul class="submenu"> 
  132.                                                     {% if brand.enableDedicatedPage %}
  133.                                                     <li><a href="{{ path('shop-brand-product', {brandname: brand.key,brand: brand.id}) }}">{{ brand.Name }}</a></li>
  134.                                                     {% else %}
  135.                                                     <li><a href="{{ path('shop-brand', {brandname: brand.key,brand: brand.id}) }}">{{ brand.Name }}</a></li>
  136.                                                     {% endif %}
  137.                                                 </ul> 
  138.                                             {% set count = count + 1 %}
  139.                                             {% set elements_column = (brands|length //6) + 1 %}                        
  140.                                             {% if (count % elements_column == 0) %}</div><div class="col-lg-2"> {% endif %}
  141.                                             {% endfor %}  
  142.                                             <hr/>
  143.                                         </div>                                            
  144.                                                 {#header - generate pimcore navigation #}
  145.                                                 
  146.                                                 {#header - navigation icons#}                                            
  147.                                         </div>
  148.                                     </div><!-- End .megamenu -->
  149.                                 </li>
  150.                                 {# <li class="mr-xl-5 mr-4" >
  151.                                     <!-- to do  -->
  152.                                     <a class="page-index" data-name="app-forniture.php">fornitori</a>
  153.                                     <div class="megamenu megamenu-fixed-width">
  154.                                         <div class="row">
  155.                                             <div class="col-lg-4">
  156.                                                 <a href="#" class="nolink">PRODUCT PAGES</a>
  157.                                                 <ul class="submenu">
  158.                                                     <li><a href="demo21-product.html">SIMPLE PRODUCT</a></li>
  159.                                                     <li><a href="product-variable.html">VARIABLE PRODUCT</a></li>
  160.                                                     <li><a href="demo21-product.html">SALE PRODUCT</a></li>
  161.                                                     <li><a href="demo21-product.html">FEATURED & ON SALE</a></li>
  162.                                                     <li><a href="product-custom-tab.html">WITH CUSTOM TAB</a></li>
  163.                                                     <li><a href="product-sidebar-left.html">WITH LEFT SIDEBAR</a></li>
  164.                                                     <li><a href="product-sidebar-right.html">WITH RIGHT SIDEBAR</a></li>
  165.                                                     <li><a href="product-addcart-sticky.html">ADD CART STICKY</a></li>
  166.                                                 </ul>
  167.                                             </div><!-- End .col-lg-4 -->
  168.                                             <div class="col-lg-4">
  169.                                                 <a href="#" class="nolink">PRODUCT LAYOUTS</a>
  170.                                                 <ul class="submenu">
  171.                                                     <li><a href="product-extended-layout.html">EXTENDED LAYOUT</a></li>
  172.                                                     <li><a href="product-grid-layout.html">GRID IMAGE</a></li>
  173.                                                     <li><a href="product-full-width.html">FULL WIDTH LAYOUT</a></li>
  174.                                                     <li><a href="product-sticky-info.html">STICKY INFO</a></li>
  175.                                                     <li><a href="product-sticky-both.html">LEFT & RIGHT STICKY</a></li>
  176.                                                     <li><a href="product-transparent-image.html">TRANSPARENT IMAGE</a>
  177.                                                     </li>
  178.                                                     <li><a href="product-center-vertical.html">CENTER VERTICAL</a></li>
  179.                                                     <li><a href="#">BUILD YOUR OWN</a></li>
  180.                                                 </ul>
  181.                                             </div><!-- End .col-lg-4 -->
  182.                                             <div class="col-lg-4 p-0">
  183.                                                 <div class="menu-banner menu-banner-2">
  184.                                                     <figure>
  185.                                                         <img src="/mecstore/assets/images/custom_placeholders/product3.png" alt="Menu banner"
  186.                                                             class="product-promo" width="380" height="790">
  187.                                                     </figure>
  188.                                                     <i>OFF</i>
  189.                                                     <div class="banner-content">
  190.                                                         <h4>
  191.                                                             <span class="">UP TO</span><br />
  192.                                                             <b class="">50%</b>
  193.                                                         </h4>
  194.                                                     </div>
  195.                                                     <a href="category.html" class="btn btn-sm btn-dark">SHOP NOW</a>
  196.                                                 </div>
  197.                                             </div><!-- End .col-lg-4 -->
  198.                                         </div><!-- End .row -->
  199.                                     </div><!-- End .megamenu -->
  200.                                 </li> #}
  201.                                 {% if allow_user('view_news') %}
  202.                                 <li class="mr-xl-5 mr-4" >
  203.                                     <a href="/news" class="page-index" data-name="/news">News</a>
  204.                                 </li> 
  205.                                {% endif %}                               
  206.                                 {% if allow_user('commercial_agreement') or allow_user('administratives_agreement') %}
  207.                                     {% if app.user.userRoles != 'Affiliate' and app.user.userRole[0] != '/Master/UserRoles/Warehouseman' %}
  208.                                 <li class="mr-xl-5 mr-4">
  209.                                     <a class="page-index sf-with-ul" data-name="app-accordi-commerciali.php">area documentale</a>
  210.                                     <ul style="display: none; white-space:nowrap;"> 
  211.                                         <li><a href="{{  pimcore_url({},'aggiornamentoprezzi-listing',true,true) }}">aggiornamento prezzi</a></li>       
  212.                                         {% if allow_user('commercial_agreement') %}
  213.                                         <li><a href="{{  pimcore_url({'type': 'commerciali','id':''},'documentation-listing',true,true) }}">accordi commerciali</a></li>
  214.                                         {% endif %}
  215.                                         {% if allow_user('administratives_agreement') %}
  216.                                         <li><a href="{{  pimcore_url({'type': 'amministrativa','id':''},'documentation-listing',true,true) }}">area amministrativa</a></li>
  217.                                         {% endif %}                                                                           
  218.                                     </ul>
  219.                                 </li>
  220.                                         {% endif %}
  221.                                 {% endif %}
  222.                                 <li class="mr-xl-5 mr-4" >
  223.                                     <a href="{{ path('marketplace-listing') }}" class="page-index" data-name="mercatino soci">mercatino soci</a>
  224.                                 </li>
  225.                                 {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  226.                                     {# <li class="sticky-button mr-xl-5 mr-4" > #}
  227.                                     {# <li class="sticky-button one border-left border-dark pl-2 ">
  228.                                         <a href="app-my-mecstore.php" class="page-index" data-name="app-my-mecstore.php">my mecstore</a>
  229.                                     </li> #}
  230.                                     
  231.                                     {#   
  232.                                     <li><a href="">Anagrafica</a></li>
  233.                                     <li><a href="">Rubrica indirizzi</a></li> 
  234.                                     #} 
  235.                                     {# <li class="sticky-button mr-xl-5 mr-4" > #}
  236.                                     {# <li class="sticky-button two border-right border-dark pr-2 mr-3 ">
  237.                                         <a href="{{  pimcore_url({'type': 'confirm'},'account-order-list',true,true) }}" class="page-index">ordini</a>
  238.                                     </li> #}
  239.                             
  240.                                    {% if allow_user('draft_create') or allow_user('booking_create') or allow_user('order_create')  %}
  241.                                         {% if app.user.partner.isMecstoreHQ != true %}
  242.                                         <li class="float-right">
  243.                                             <a href="{{ path('shop-cart-detail') }}" class="icon-a page-index" data-name="{{ path('shop-cart-detail') }}">
  244.                                                 <i class="fas fa-shopping-cart"></i>
  245.                                                 <span class="cart-count badge-circle">{{ app_cart_items_count() }}</span>
  246.                                             </a>
  247.                                         </li>
  248.                                         {% endif %}
  249.                                     {% endif %}
  250.                                     <li class="float-right">
  251.                                         <a class="icon-a page-index" href="{{ path('wishlist-index') }}" data-name="{{ path('wishlist-index') }}">
  252.                                             <i class="icon-star-empty"></i>
  253.                                             <span class="wishlist-count badge-circle sticky" style="display:none!important">{{ app_wish_list_count() }}</span>
  254.                                         </a>
  255.                                     </li>
  256.                                     {#{% if allow_user('draft_create') or allow_user('booking_create') or allow_user('order_create') or allow_user('order_view')  %}
  257.                                          <li class="float-right border-right border-dark pr-2 pr-xl-5 mr-3 mr-xl-5">
  258.                                             <a class="page page-index" href="{{  pimcore_url({'type': 'confirm'},'account-order-list',true,true) }}">
  259.                                                 ordini
  260.                                             </a>
  261.                                         </li> 
  262.                                     {% endif %}#}
  263.                                     {% if allow_user('draft_create') or allow_user('booking_create') or allow_user('order_create') or allow_user('order_view')  %}
  264.                                     {# <li class="float-right border-left border-dark pl-2 pl-xl-5 ">
  265.                                         <a class="page page-index" href="{{ path('account-index') }}" data-name="{{ path('account-index') }}">
  266.                                             my mecstore
  267.                                         </a> 
  268.                                     </li>#}
  269.                                     <li class="float-right border-left border-right border-dark pl-2 pl-xl-5 pr-2 pr-xl-5 mymecstore" >
  270.                                         <a class="" ><span>my mecstore</span></a>
  271.                                         <div class="megamenu megamenu-fixed-width">
  272.                                             <div class="row">
  273.                                                 <div class="col-lg">
  274.                                                     <strong>B2B</strong>
  275.                                                     <ul class="submenu"> 
  276.                                                         {% if app.user.partner.isMecstoreHq %}
  277.                                                         <li><a href="{{  pimcore_url({'type': 'ordini'},'account-order-list',true,true) }}">Ordini</a></li>
  278.                                                         <li><a href="{{  pimcore_url({'type': 'impegnati'},'account-order-list',true,true) }}">Impegnati</a></li>
  279.                                                         <li><a href="{{  pimcore_url({'type': 'riepilogo'},'account-order-list',true,true) }}">Riepilogo</a></li>
  280.                                                         {# <li><a href="{{  pimcore_url({'type': 'bozze-ordini'},'account-order-list',true,true) }}">Bozze ordini</a></li> #}
  281.                                                         {% else %}
  282.                                                         <li><a href="{{  pimcore_url({'type': 'confirm'},'account-order-list',true,true) }}">Ordini inviati</a></li>
  283.                                                         {# {% if app.user.userRoles != 'Affiliate' %}  #}
  284.                                                         <li><a href="{{  pimcore_url({'type': 'pre-ordini'},'account-order-list',true,true) }}">Preordini</a></li>
  285.                                                         <li><a href="{{  pimcore_url({'type': 'booked'},'account-order-list',true,true) }}">Prenotazioni</a></li>
  286.                                                         {# {% endif %}  #}
  287.                                                         <li><a href="{{  pimcore_url({'type': 'draft'},'account-order-list',true,true) }}">Bozze ordini</a></li>
  288.                                                         {% endif %}                                                      
  289.                                                         
  290.                                                         {# <li><a href=""><strong>Note</strong></a></li> #}
  291.                                                     </ul> 
  292.                                                 </div>
  293.                                                 {# {% if app.user.userRoles != 'Affiliate' %}  #}
  294.                                                 {% if app.user.userRole[0] != '/Master/UserRoles/Warehouseman' and app.user.userRoles != 'Affiliate' %}
  295.                                                 <div class="col-lg">
  296.                                                     <strong>B2C</strong>
  297.                                                     <ul class="submenu"> 
  298.                                                         <li><a href="{{  pimcore_url({"type":"sent_to_customer"},'quote-branch-listing',true,true) }}">Preventivi</a></li>
  299.                                                         <li><a href="{{  pimcore_url({"type":"confirmed_quote"},'quote-branch-listing',true,true) }}">Preventivi Confermati</a></li>
  300.                                                         <li><a href="{{  pimcore_url({"type":"not_processed"},'quote-branch-listing',true,true) }}">Contatti ricevuti</a></li>
  301.                                                         {# <li><a href="">Resi</a></li> #}
  302.                                                     </ul> 
  303.                                                 </div>
  304.                                                 {% endif %}
  305.                                                 {# {% endif %}  #}
  306.                                                 <div class="col-lg border-left">
  307.                                                     <ul class="submenu"> 
  308.                                                       {#   <li><a href="">Anagrafica</a></li>
  309.                                                         <li><a href="">Rubrica indirizzi</a></li> #}
  310.                                                     </ul> 
  311.                                                 </div> 
  312.                                             </div>                                            
  313.                                                     {#header - generate pimcore navigation #}
  314.                                                     
  315.                                                     {#header - navigation icons#}                                            
  316.                                             </div>
  317.                                         </div><!-- End .megamenu -->
  318.                                     </li>
  319.                                     {% endif %}
  320.                                  {% endif %}
  321.                             </ul>
  322.                         </nav>
  323.                     </div>
  324.                     <div class="header-right pr-4">
  325.                         <!-- HEADER SEARCH STICKY -->
  326.                         <div
  327.                             class="header-icon header-search header-search-popup header-search-category w-lg-max text-right">
  328.                             <a href="#" class="search-toggle" role="button"><i class="icon-search-3"></i></a>
  329.                             <!-- SEARCH INPUT -->
  330.                             {# <form action="{{ path('search') }}" id="search-form" name="search-form" method="get"> #}
  331.                                 <div class="header-search-wrapper">
  332.                                     <input type="search" class="form-control" name="term_header" id="term_header" value="{% if params.term is defined %}{{ params.term }}{% endif %}"
  333.                                         placeholder="Cerca prodotto..." required>
  334.                                     <div class="select-custom">
  335.                                         <select id="cat_header" name="cat_header">
  336.                                             {% if categories %}
  337.                                                 <option value="" selected data-href="{{ path('shop-category', {categoryname: 'ovunque',category: 0}) }}">tutto il catalogo</option> 
  338.                                                 {% for category in categories %}
  339.                                                     {% if params.cat is defined %}                                                        
  340.                                                         {% if params.cat == category.id %}
  341.                                                             <option value="{{category.Id}}" selected data-href="{{ path('shop-category', {categoryname: category.key,category: category.id}) }}">{{category.Name}}</option>   
  342.                                                         {% else %}
  343.                                                             <option value="{{category.Id}}" data-href="{{ path('shop-category', {categoryname: category.key,category: category.id}) }}">{{category.Name}}</option>   
  344.                                                         {% endif %}  
  345.                                                     {% else %}
  346.                                                             <option value="{{category.Id}}" data-href="{{ path('shop-category', {categoryname: category.key,category: category.id}) }}">{{category.Name}}</option>
  347.                                                     {% endif %} 
  348.                                                 {% endfor %}
  349.                                             {% endif %}                                         
  350.                                         </select>
  351.                                     </div><!-- End .select-custom -->
  352.                                     <button class="btn icon-search-3 bg-dark text-white p-0 term-search-btn-header" title="search"
  353.                                         type="button"></button>
  354.                                 </div><!-- End .header-search-wrapper -->
  355.                             {# </form> #}
  356.                         </div><!-- End .header-search -->
  357.                         {% if allow_user('draft_create') or allow_user('booking_create') or allow_user('order_create') or allow_user('order_view')  %}
  358.                         <a href="{{ path('wishlist-index') }}" class="header-icon page-index icon-a " data-name="{{ path('wishlist-index') }}">
  359.                             <i class="icon-star-empty"></i>
  360.                             <span class="wishlist-count badge-circle sticky" style="display:none!important">{{ app_wish_list_count() }}</span>
  361.                         </a>
  362.                         {% if app.user.partner.isMecstoreHQ != true %}
  363.                         <a href="{{ path('shop-cart-detail') }}" class="page-index icon-a " data-name="{{ path('shop-cart-detail') }}">
  364.                             <i class="fas fa-shopping-cart"></i>
  365.                             <span class="cart-count badge-circle sticky">{{ app_cart_items_count() }}</span>
  366.                         </a>
  367.                         {% endif %}
  368.                         {% endif %}
  369.                     </div>
  370.                 </div>
  371.             </div>
  372.         </header><!-- End .header -->
  373. {% endblock %}