templates/AtechNetCoreBundle/Homepage/bazaar.html.twig line 1

Open in your IDE?
  1. {% extends 'AtechNetCoreBundle/base.html.twig' %}
  2. {% import "AtechNetCoreBundle/macros.html.twig" as macros %}
  3. {% block head %}
  4.     {{ parent() }}
  5.     {% if banners.items|length > 1 %}
  6.         {% for bannerItem in banners.items %}
  7.             <link rel="preload" as="image" href="{{ bannerItem.image }}">
  8.         {% endfor %}
  9.     {% endif %}
  10. {% endblock %}
  11. {% block content %}
  12.     {% set defaultLocale = app.request.session.get('defaultLocale') %}
  13.     <div class="promotions p-0">
  14.         <div class="container text-end">
  15.             <a href="/" class="back-to-homepage">{{ 'Back to refurbished computers' |trans }}</a>
  16.         </div>
  17.     </div>
  18.     {% if banners is not null and banners.items|length > 0 %}
  19.         <div class="promotions px-0 px-xl-0 pt-0">
  20.             <div class="container">
  21.                 {% for message in app.flashes('pastPayResult') %}
  22.                     <div class="alert alert-info" role="alert">
  23.                         {{ message }}
  24.                     </div>
  25.                 {% endfor %}
  26.                 <div class="grid-wrapper">
  27.                     {% if banners.items |length > 1 %}
  28.                         <div id="bannersCarouselIndicators" class="banner carousel slide" data-bs-ride="carousel">
  29.                             <div class="carousel-indicators">
  30.                                 {% for banner in banners.items %}
  31.                                     <button
  32.                                         type="button"
  33.                                         data-bs-target="#bannersCarouselIndicators"
  34.                                         data-bs-slide-to="{{ loop.index - 1 }}"
  35.                                         class="active"
  36.                                         {% if loop.index == 1 %}
  37.                                             aria-current="true"
  38.                                         {% endif %}
  39.                                         aria-label="Slide {{ loop.index }}">
  40.                                     </button>
  41.                                 {% endfor %}
  42.                             </div>
  43.                             <div class="carousel-inner">
  44.                                 {% for bannerItem in banners.items %}
  45.                                     {% set gtag = "gtag('event', 'select_promotion', {" ~ 
  46.                                         "creative_name: 'homepage-tab-banner', " ~ 
  47.                                         "promotion_name: 'homepage-tab-banner', " ~ 
  48.                                         "promotion_id: '" ~ bannerItem.parentId ~ "_" ~ bannerItem.itemId ~ "', " ~ 
  49.                                         "promotion_name: '" ~ bannerItem.link ~ "', " ~ 
  50.                                         "items: [ "
  51.                                     %}
  52.                                     {% for item in banners.gtagEventItems %}
  53.                                         {% set gtag = gtag ~ "{" ~ 
  54.                                             "item_id: '" ~ item.item_id ~ "', " ~ 
  55.                                             "item_name: '" ~ item.item_name ~ "', " ~ 
  56.                                             "index: '" ~ item.index ~ "', " ~ 
  57.                                             "promotion_id: '" ~ item.promotion_id ~ "', " ~ 
  58.                                             "promotion_name: '" ~ item.promotion_name ~ "'" ~ 
  59.                                         "}, " %}
  60.                                     {% endfor %}
  61.                                     {% set gtag = gtag ~ " ]})" %}
  62.                                     <div class="carousel-item{% if loop.index == 1 %} active{% endif %}" data-bs-interval="{{ banners.interval }}">
  63.                                         <a href="{{ bannerItem.link }}" onclick="{{ gtag }}">
  64.                                             <img decoding="async" src="{{ bannerItem.image }}" class="d-block w-100" alt="#{{ loop.index }}" width="820" height="340" >
  65.                                         </a>
  66.                                     </div>
  67.                                 {% endfor %}
  68.                             </div>
  69.                             <button class="carousel-control-prev" type="button" data-bs-target="#bannersCarouselIndicators" data-bs-slide="prev">
  70.                                 <img  loading="lazy" decoding="async" src="{{ asset('theme/images/icon/arrow-left.svg') }}" alt="{{ 'Arrow left'|trans }}">
  71.                                 <span class="visually-hidden">{{ 'Previous slide' |trans }}</span>
  72.                             </button>
  73.                             <button class="carousel-control-next" type="button" data-bs-target="#bannersCarouselIndicators" data-bs-slide="next">
  74.                                 <img loading="lazy" decoding="async" src="{{ asset('theme/images/icon/arrow-right.svg') }}" alt="{{ 'Arrow right'|trans }}">
  75.                                 <span class="visually-hidden">{{ 'Next slide' |trans }}</span>
  76.                             </button>
  77.                             <div id="carousel-loader">
  78.                                 <div class="current-percent"></div>
  79.                             </div>
  80.                         </div>
  81.                     {% else %}
  82.                         <div class="banner">
  83.                             <a href="{{ banners.items[0].link }}" onclick="gtag('event','select_promotion',{creative_name:'homepage-tab-banner',promotion_name:'homepage-tab-banner', items:[]})" id="homepage-tab-banner">
  84.                                 <picture>
  85.                                     <img loading="lazy" decoding="async" src="{{ banners.items[0].image }}" alt="banner" width="820" height="340" />
  86.                                 </picture>
  87.                             </a>
  88.                         </div>
  89.                     {% endif %}
  90.                     {% if smallBanners is not empty %}
  91.                         {% if smallBanners.upper.image is defined and smallBanners.upper is not empty %}
  92.                             <div class="small-banner upper">
  93.                                 <a href="{{ smallBanners.upper.link }}" onclick="gtag('event','select_promotion',{creative_name:'homepage-featured-category',promotion_name:'homepage-featured-category',items:[]})" id="homepage-featured-category">
  94.                                     <img loading="lazy" decoding="async" src="{{ smallBanners.upper.image }}" alt="{{ smallBanners.upper.title }}" width="550" height="244">
  95.                                 </a>
  96.                             </div>
  97.                         {% else %}
  98.                             {% if smallBanners.upper.display == const('Banner::BANNER_DISPLAY_TYPE_CATEGORY_GROUP') and featuredCategory.upper is defined and featuredCategory.upper is not empty %}
  99.                                 <div class="featured-category-box{% if featuredCategory.upper.isWizard is defined and featuredCategory.upper.isWizard %} wizard{% endif %} upper">
  100.                                     <a href="{{ featuredCategory.upper.href }}" onclick="gtag('event','select_promotion',{creative_name:'homepage-featured-category',promotion_name:'homepage-featured-category',items:[]})" id="homepage-featured-category">
  101.                                         <img loading="lazy" decoding="async" src="{{ featuredCategory.upper.image }}" alt="{{ featuredCategory.upper.title }}" width="376" height="210">
  102.                                         <div class="description">
  103.                                             <h3 class="mb-1 mb-md-2 mb-xl-3"><strong>{{ featuredCategory.upper.title }}</strong></h3>
  104.                                             <p class="mb-1">{{ featuredCategory.upper.description }}</p>
  105.                                             <span>{{ 'Featured category view'|trans }}</span>
  106.                                         </div>
  107.                                     </a>
  108.                                 </div>
  109.                             {% elseif smallBanners.upper.display == const('Banner::BANNER_DISPLAY_TYPE_PRODUCT') and featuredProduct.upper is defined and featuredProduct.upper is not empty %}
  110.                                 <div class="featured-product-box upper">
  111.                                     <div class="recommendation-label">
  112.                                         <span>{{ 'Recommended'|trans }}</span>
  113.                                     </div>
  114.                                     {% set gtag = "gtag('event', 'select_promotion', {" ~ 
  115.                                         "creative_name:'homepage-featured-product', " ~ 
  116.                                         "promotion_name:'homepage-featured-product', " ~ 
  117.                                         "items: [{" ~ 
  118.                                             "item_id: '" ~ featuredProduct.upper.code ~ "', " ~ 
  119.                                             "item_name: '" ~ featuredProduct.upper.title ~ "', " ~ 
  120.                                             "discount: " ~ featuredProduct.upper.special|number_format(2, '.', '') ~ ", " ~ 
  121.                                             "index: 0, " ~ 
  122.                                             "item_brand: '" ~ featuredProduct.upper.vendor ~ "', " ~ 
  123.                                             "price: " ~ featuredProduct.upper.price|number_format(2, '.', '') ~ 
  124.                                             "quantity: 1, " ~ 
  125.                                         "}]
  126.                                     })" %}
  127.                                     <a href="{{ featuredProduct.upper.href }}" class="featured-product-wrapper" onclick="{{ gtag }}" id="homepage-featured-product">
  128.                                         <div class="product-image me-3">
  129.                                             {% if featuredProduct.upper.carouselImages is defined %}
  130.                                                 <div id="featuredProduct-upper-carousel" class="carousel slide" data-bs-ride="carousel">
  131.                                                     <div class="carousel-inner">
  132.                                                         {% for image in featuredProduct.upper.carouselImages %}
  133.                                                             <div class="carousel-item {% if loop.first %}active{% endif %}"  data-bs-interval="8000">
  134.                                                                 <img loading="lazy" decoding="async" src="{{ image }}" class="d-block w-100" alt="{{ featuredProduct.upper.vendor }} {{ featuredProduct.upper.title }}">
  135.                                                             </div>
  136.                                                         {% endfor %}
  137.                                                     </div>
  138.                                                 </div>
  139.                                             {% else %}
  140.                                                 <img loading="lazy" decoding="async" src="{{ featuredProduct.upper.image }}" alt="{{ featuredProduct.upper.vendor }} {{ featuredProduct.upper.title }}">
  141.                                             {% endif %}
  142.                                         </div>
  143.                                         <div class="product-info">
  144.                                             <div class="product-title mb-1 mb-md-2 mb-xl-3">{% if featuredProduct.upper.isCustomTitle is defined %} {{- featuredProduct.upper.title -}} {% else  %}{{- featuredProduct.upper.vendor }} {{ featuredProduct.upper.title -}} {% endif %}</div>
  145.                                             <p class="product-description mb-2 mb-md-3">{{- featuredProduct.upper.attributesListTxt|raw -}}</p>
  146.                                             <div class="prices">
  147.                                                 {% if featuredProduct.upper.isDiscounted %}
  148.                                                     <span class="discounted">
  149.                                                 {{- featuredProduct.upper.special|price(currency, precision) -}}
  150.                                             </span>
  151.                                                 {% endif %}
  152.                                                 <span class="price{{ featuredProduct.upper.isDiscounted ? ' discounted-on' : '' }}">
  153.                                             {{- featuredProduct.upper.price|price(currency, precision) -}}
  154.                                         </span>
  155.                                             </div>
  156.                                         </div>
  157.                                     </a>
  158.                                     {% if banners.items |length > 1 %}
  159.                                         {% set promotionItems = banners.gtagEventItems |json_encode %}
  160.                                         {# for item in banners.gtagEventItems %}
  161.                                             {% set promotionItems = promotionItems ~ "{" ~ 
  162.                                                 "item_id: '" ~ item.item_id "', " ~ 
  163.                                                 "item_name: '" ~ item.item_name "', " ~ 
  164.                                                     "item_name": "{{ item.item_name }}",
  165.                                                     "index": "{{ item.index }}",
  166.                                                     "promotion_id": "{{ item.promotion_id }}",
  167.                                                     "promotion_name": "{{ item.promotion_name }}"
  168.                                             
  169.                                             "}," %}
  170.                                         {% endfor #}
  171.                                     {% else %}
  172.                                     {% endif %}
  173.                                     <script>
  174.                                         gtag("event", "view_promotion", {
  175.                                             creative_name: "homepage-tab-banner", 
  176.                                             promotion_name: "homepage-tab-banner", 
  177.                                             items: JSON.parse('{{ promotionItems }}')
  178.                                         });
  179.                                         gtag("event", "view_promotion", {
  180.                                             creative_name: "homepage-featured-category",
  181.                                             promotion_name: "homepage-featured-category",
  182.                                             items: []
  183.                                         });
  184.                                         gtag("event", "view_promotion", {
  185.                                             creative_name: "homepage-featured-product",
  186.                                             promotion_name: "homepage-featured-product",
  187.                                             items: [
  188.                                                 {
  189.                                                     item_id: "{{ featuredProduct.upper.code }}",
  190.                                                     item_name: "{{ featuredProduct.upper.title }}",
  191.                                                     discount: {{ featuredProduct.upper.special|number_format(2, '.', '') }},
  192.                                                     index: 0,
  193.                                                     item_brand: "{{ featuredProduct.upper.vendor }}",
  194.                                                     price: {{ featuredProduct.upper.price|number_format(2, '.', '') }},
  195.                                                     quantity: 1
  196.                                                 }
  197.                                             ]
  198.                                         });
  199.                                     </script>
  200.                                 </div>
  201.                             {% else %}
  202.                                 <div class="small-banner upper"></div>
  203.                             {% endif %}
  204.                         {% endif %}
  205.                         {% if smallBanners.lower.image is defined and  smallBanners.lower is not empty %}
  206.                             <div class="small-banner lower">
  207.                                 <a href="{{ smallBanners.lower.link }}" onclick="gtag('event','select_promotion',{creative_name:'homepage-featured-category',promotion_name:'homepage-featured-category',items:[]})" id="homepage-featured-category">
  208.                                     <img loading="lazy" decoding="async" src="{{ smallBanners.lower.image }}" alt="{{ smallBanners.lower.title }}" width="550" height="244">
  209.                                 </a>
  210.                             </div>
  211.                         {% else %}
  212.                             {% if smallBanners.lower.display == const('Banner::BANNER_DISPLAY_TYPE_CATEGORY_GROUP') and featuredCategory.lower is defined and featuredCategory.lower is not empty %}
  213.                                 <div class="featured-category-box{% if featuredCategory.lower.isWizard is defined and featuredCategory.lower.isWizard %} wizard{% endif %} lower">
  214.                                     <a href="{{ featuredCategory.lower.href }}" onclick="gtag('event','select_promotion',{creative_name:'homepage-featured-category',promotion_name:'homepage-featured-category',items:[]})" id="homepage-featured-category">
  215.                                         <img loading="lazy" decoding="async" src="{{ featuredCategory.lower.image }}" alt="{{ featuredCategory.lower.title }}" width="376" height="210">
  216.                                         <div class="description">
  217.                                             <h3 class="mb-1 mb-md-2 mb-xl-3"><strong>{{ featuredCategory.lower.title }}</strong></h3>
  218.                                             <p class="mb-1">{{ featuredCategory.lower.description }}</p>
  219.                                             <span>{{ 'Featured category view'|trans }}</span>
  220.                                         </div>
  221.                                     </a>
  222.                                 </div>
  223.                             {% elseif smallBanners.lower.display == const('Banner::BANNER_DISPLAY_TYPE_PRODUCT') and featuredProduct.lower is defined and featuredProduct.lower is not empty %}
  224.                                 <div class="featured-product-box lower">
  225.                                     <div class="recommendation-label">
  226.                                         <span>{{ 'Recommended'|trans }}</span>
  227.                                     </div>
  228.                                     <a href="{{ featuredProduct.lower.href }}" class="featured-product-wrapper" onclick="gtag('event','select_promotion',{creative_name:'homepage-featured-product',promotion_name:'homepage-featured-product',items:[{item_id:'{{ featuredProduct.lower.code }}',item_name:'{{ featuredProduct.lower.title }}',discount:{{ featuredProduct.lower.special|number_format(2, '.', '') }},index:0,item_brand:'{{ featuredProduct.lower.vendor }}',price:{{ featuredProduct.lower.price|number_format(2, '.', '') }},quantity:1}]})" id="homepage-featured-product">
  229.                                         <div class="product-image me-3">
  230.                                             {% if featuredProduct.lower.carouselImages is defined %}
  231.                                                 <div id="featuredProduct-lower-carousel" class="carousel slide" data-bs-ride="carousel">
  232.                                                     <div class="carousel-inner">
  233.                                                         {% for image in featuredProduct.lower.carouselImages %}
  234.                                                             <div class="carousel-item {% if loop.first %}active{% endif %}">
  235.                                                                 <img loading="lazy" decoding="async" src="{{ image }}" class="d-block w-100" alt="{{ featuredProduct.lower.vendor }} {{ featuredProduct.lower.title }}">
  236.                                                             </div>
  237.                                                         {% endfor %}
  238.                                                     </div>
  239.                                                 </div>
  240.                                             {% else %}
  241.                                                 <img loading="lazy" decoding="async" src="{{ featuredProduct.lower.image }}" alt="{{ featuredProduct.lower.vendor }} {{ featuredProduct.lower.title }}">
  242.                                             {% endif %}
  243.                                         </div>
  244.                                         <div class="product-info">
  245.                                             <div class="product-title mb-1 mb-md-2 mb-xl-3">{% if featuredProduct.lower.isCustomTitle is defined %} {{- featuredProduct.lower.title -}} {% else  %}{{- featuredProduct.lower.vendor }} {{ featuredProduct.lower.title -}} {% endif %}</div>
  246.                                             <p class="product-description mb-2 mb-md-3">{{- featuredProduct.lower.attributesListTxt|raw -}}</p>
  247.                                             <div class="prices">
  248.                                                 {% if featuredProduct.lower.isDiscounted %}
  249.                                                     <span class="discounted">
  250.                                                 {{- featuredProduct.lower.special|price(currency, precision) -}}
  251.                                             </span>
  252.                                                 {% endif %}
  253.                                                 <span class="price{{ featuredProduct.lower.isDiscounted ? ' discounted-on' : '' }}">
  254.                                             {{- featuredProduct.lower.price|price(currency, precision) -}}
  255.                                         </span>
  256.                                             </div>
  257.                                         </div>
  258.                                     </a>
  259.                                     <script>
  260.                                         gtag("event", "view_promotion", {
  261.                                             creative_name: "homepage-tab-banner",
  262.                                             promotion_name: "homepage-tab-banner",
  263.                                             {% if banners.items|length > 1 -%}
  264.                                             items: [
  265.                                                 {% for item in banners.gtagEventItems  %}
  266.                                                 {
  267.                                                     "item_id": "{{ item.item_id }}",
  268.                                                     "item_name": "{{ item.item_name }}",
  269.                                                     "index": "{{ item.index }}",
  270.                                                     "promotion_id": "{{ item.promotion_id }}",
  271.                                                     "promotion_name": "{{ item.promotion_name }}"
  272.                                                 },
  273.                                                 {% endfor %}
  274.                                             ]
  275.                                             {% else -%}
  276.                                             items: []
  277.                                             {% endif -%}
  278.                                         });
  279.                                         gtag("event", "view_promotion", {
  280.                                             creative_name: "homepage-featured-category",
  281.                                             promotion_name: "homepage-featured-category",
  282.                                             items: []
  283.                                         });
  284.                                         gtag("event", "view_promotion", {
  285.                                             creative_name: "homepage-featured-product",
  286.                                             promotion_name: "homepage-featured-product",
  287.                                             items: [
  288.                                                 {
  289.                                                     item_id: "{{ featuredProduct.lower.code }}",
  290.                                                     item_name: "{{ featuredProduct.lower.title }}",
  291.                                                     discount: {{ featuredProduct.lower.special|number_format(2, '.', '') }},
  292.                                                     index: 0,
  293.                                                     item_brand: "{{ featuredProduct.lower.vendor }}",
  294.                                                     price: {{ featuredProduct.lower.price|number_format(2, '.', '') }},
  295.                                                     quantity: 1
  296.                                                 }
  297.                                             ]
  298.                                         });
  299.                                     </script>
  300.                                 </div>
  301.                             {% else %}
  302.                                 <div class="small-banner lower"></div>
  303.                             {% endif %}
  304.                         {% endif %}
  305.                     {% endif %}
  306.                 </div>
  307.             </div>
  308.         </div>
  309.     {% endif %}
  310.     {% include 'AtechNetCoreBundle/Module/advantages.html.twig' with {'warrantyYear': warrantyYear, 'reviewCount': reviewCount, 'lang': lang} %}
  311.     {% if featuredCategories %}
  312.         <section class="featured-categories">
  313.             <div class="container">
  314.                 {% for category in featuredCategories %}
  315.                     <div class="link-item">
  316.                         <a href="{{ category.href }}">
  317.                             <div class="image-wrapper">
  318.                                 <img loading="lazy" decoding="async" src="{{ asset('theme/images/category/' ~ category.image) }}" alt="{{ category.title }}">
  319.                             </div>
  320.                             <div class="featured-category-title"><span>{{ category.title }}</span></div>
  321.                             <div class="arrow-right"></div>
  322.                         </a>
  323.                     </div>
  324.                 {% endfor %}
  325.             </div>
  326.         </section>
  327.     {% endif %}
  328.     <div class="main-content">
  329.         <div class="container">
  330.             {{ include(template_from_string(content_top)) }}
  331.             <!-- Product selection tab -->
  332.             <section class="main-products-carousel">
  333.                 <h3>{{ 'Popular product list'|trans }}</h3>
  334.                 <div class="owl-carousel" id="main-products-carousel">
  335.                     {% if mainProducts %}
  336.                         {{ macros.printProducts(mainProducts, currency, precision, 12, true, true, false) }}
  337.                     {% endif %}
  338.                 </div>
  339.                 <script>
  340.                     if ( window.dataLayer ) {
  341.                         window.dataLayer.push({ ecommerce: null });  // Clear the previous ecommerce object.
  342.                         window.dataLayer.push({
  343.                             event: "view_item_list",
  344.                             ecommerce: {
  345.                                 item_list_id: "homepage-popular-products",
  346.                                 item_list_name: "homepage-popular-products",
  347.                                 items: [
  348.                                 {% for mainProduct in mainProducts %}{% if loop.index > 1 %},{% endif %}{
  349.                                         item_id: "{{ mainProduct.id }}",
  350.                                         item_name: "{{ mainProduct.title }}",
  351.                                         discount: {{ mainProduct.rawDiscountPrice }},
  352.                                         index: {{ loop.index }},
  353.                                         item_brand: "{{ mainProduct.vendor }}",
  354.                                         price: {{ mainProduct.rawPrice }},
  355.                                         quantity: 1
  356.                                     }
  357.                                 {% endfor %}
  358.                                 ]
  359.                             }
  360.                         });
  361.                     }
  362.                 </script>
  363.             </section>
  364.         </div>
  365.         <div class="testimonial-wrapper{% if domainId == const('Domain::DOMAIN_ID_RT_EU') %} eu-trustindex{% endif %}">
  366.             <div class="container">
  367.                 {%- if domainId == const('Domain::DOMAIN_ID_RT_EU') -%}
  368.                     <script defer async src='https://cdn.trustindex.io/loader.js?757dc6b28849419b02269e1ac4f'></script>
  369.                 {% else %}
  370.                     {{ include(template_from_string(content_reviews)) }}
  371.                 {%- endif -%}
  372.             </div>
  373.         </div>
  374.         <div id="preload-content-center">
  375.             <div class="category-selection">
  376.                 <div class="row preload">
  377.                     <div class="col-md-6">
  378.                         <div class="category-selection-item">
  379.                             <div class="category-selection-desc">
  380.                             {% for i in 1..4 %}
  381.                                 <div class="row">
  382.                                     <div class="col-3 col-sm-2"></div>
  383.                                     <div class="col-9 col-sm-10"></div>
  384.                                 </div>
  385.                             {% endfor %}
  386.                             </div>
  387.                         </div>
  388.                     </div>
  389.                     <div class="col-md-6">
  390.                         <div class="row wrapper">
  391.                             {% for i in 1..4 %}
  392.                                 <div class="col-sm-6"></div>
  393.                             {% endfor %}
  394.                         </div>
  395.                     </div>
  396.                 </div>
  397.             </div>
  398.             <div class="bazar-product-list">
  399.                 <div class="row preload">
  400.                     {% for i in 1..4 %}
  401.                         <div class="col-6 col-sm-4 col-lg-3">
  402.                             <div class="preload-item">
  403.                                 <div class="image"></div>
  404.                                 <div class="title1"></div>
  405.                                 <div class="title2"></div>
  406.                                 <div class="description"></div>
  407.                                 <div class="prices"></div>
  408.                                 <div class="button"></div>
  409.                             </div>
  410.                         </div>
  411.                     {% endfor %}
  412.                 </div>
  413.             </div>
  414.             <div class="heureka-list">
  415.                 <div class="row preload">
  416.                     <div class="col-sm-3">
  417.                         <div class="preload-item heureka-logo">
  418.                             <div class="image" style="border-radius: 200px;"></div>
  419.                             <div class="title1"></div>
  420.                         </div>
  421.                     </div>
  422.                     {% for i in 1..3 %}
  423.                         <div class="col-sm-3">
  424.                             <div class="preload-item">
  425.                                 <div class="image"></div>
  426.                                 <div class="title1"></div>
  427.                                 <div class="title2"></div>
  428.                             </div>
  429.                         </div>
  430.                     {% endfor %}
  431.                 </div>
  432.             </div>
  433.         </div>
  434.     <div id="content-center"></div>
  435.     {{ include(template_from_string(content_bottom)) }}
  436. {% endblock %}
  437. {% block stylesheets %}
  438.     <link rel="stylesheet" href="{{ asset('theme/owl-carousel/assets/owl.carousel.min.css'|appendAssetCache) }}">
  439.     {{ parent() }}
  440. {% endblock %}
  441. {% block javascripts %}
  442.     {{ parent() }}
  443.     <script type="text/javascript" src="{{ asset('theme/owl-carousel/owl.carousel.min.js'|appendAssetCache) }}"></script>
  444.     <script>
  445.         var mainProductsOwlObject = {
  446.             loop: false,
  447.             startPosition: 0,
  448.             dots: true,
  449.             checkVisibility: false,
  450.             nav: true,
  451.             navText: [
  452.                 `<i class="fas fa-chevron-left"></i><span class="visually-hidden">{{ 'Previous slide'|trans }}</span>`,
  453.                 `<i class="fas fa-chevron-right"></i><span class="visually-hidden">{{ 'Next slide'|trans }}</span>`
  454.             ],
  455.             responsive: {
  456.                 1330: {
  457.                     nav: true,
  458.                     items: 4,
  459.                     stagePadding: 10,
  460.                     margin: 0
  461.                 },
  462.                 990: {
  463.                     items: 4,
  464.                     nav: false,
  465.                     stagePadding: 10,
  466.                     margin: 20
  467.                 },
  468.                 576: {
  469.                     items: 3,
  470.                     nav: false,
  471.                     dots: true,
  472.                     stagePadding: 0
  473.                 },
  474.                 0: {
  475.                     items: 2,
  476.                     nav: false,
  477.                     dots: true,
  478.                     stagePadding: 0,
  479.                     mergeFit: true
  480.                 }
  481.             }
  482.         };
  483.         $(document).ready(function() {
  484.             $("#main-products-carousel").owlCarousel(mainProductsOwlObject);
  485.             $('#main-products-carousel').equation({
  486.                 carousel: true, 
  487.                 selectors: [
  488.                     '.product-list-item .product-list-details .product-list-name', 
  489.                     '.product-list-item .product-list-details .product-list-attributes'
  490.                 ]
  491.             });
  492.             $('#main-products-carousel .owl-dot').each(function(index) {
  493.                 $(this).attr('aria-label', "{{ 'Go to slide'|trans }}" + (index + 1));
  494.             });
  495.             $.ajax({
  496.                 method: 'GET',
  497.                 url: '{{ path("homepage_bottom_content_ajax") }}',
  498.                 success: function(response) {
  499.                     let result = response.replace(/\s/g,' ');
  500.                     $('#content-center').html(result).show();
  501.                     setCarousels();
  502.                     $('#preload-content-center').hide();
  503.                 }
  504.             });
  505.         });
  506.         function owlInitialized () {
  507.             $(".product-list .row.preload").remove();
  508.         }
  509.         function setCarousels () {
  510.             $('#categorySelection .carousel-inner').owlCarousel({
  511.                 items: 1,
  512.                 dots: false,
  513.                 nav: true,
  514.                 loop: true,
  515.                 navText: [
  516.                     '<i class="fas fa-chevron-left"></i>',
  517.                     '<i class="fas fa-chevron-right"></i>'
  518.                 ]
  519.             });
  520.             $("#homepage-blog-carousel").owlCarousel({
  521.                 items: 3,
  522.                 loop: false,
  523.                 startPosition: 0,
  524.                 nav: false,
  525.                 dots: true,
  526.                 responsive: {
  527.                     990: {
  528.                         items: 3,
  529.                         dots: false,
  530.                         stagePadding: 0
  531.                     },
  532.                     590: {
  533.                         items: 2,
  534.                         dots: true,
  535.                         stagePadding: 0
  536.                     },
  537.                     0: {
  538.                         items: 1,
  539.                         dots: true,
  540.                         stagePadding: 0
  541.                     }
  542.                 }
  543.             });
  544.             $("#under-amount-products-carousel").owlCarousel({
  545.                 loop: false,
  546.                 startPosition: 0,
  547.                 checkVisibility: false,
  548.                 margin: 20,
  549.                 navText: [
  550.                     '<i class="fas fa-chevron-left"></i>', 
  551.                     '<i class="fas fa-chevron-right"></i>'
  552.                 ],
  553.                 responsive: {
  554.                     1330: {
  555.                         nav: true,
  556.                         dots: true,
  557.                         items: 3
  558.                     },
  559.                     767: {
  560.                         items: 3,
  561.                         nav: false,
  562.                         dots: true
  563.                     },
  564.                     670: {
  565.                         items: 2,
  566.                         nav: false,
  567.                         dots: true,
  568.                         margin: 10,
  569.                         stagePadding: 40
  570.                     },
  571.                     380: {
  572.                         items: 1,
  573.                         nav: false,
  574.                         dots: true,
  575.                         mergeFit: true,
  576.                         margin: 10,
  577.                         stagePadding: 12
  578.                     },
  579.                     0: {
  580.                         items: 1,
  581.                         nav: false,
  582.                         dots: true,
  583.                         mergeFit: true,
  584.                         margin: 10,
  585.                         stagePadding: 12
  586.                     }
  587.                 }
  588.             });
  589.         }
  590.         {% if banners is not null and  banners.items|length > 1 %}
  591.             const myCarousel = document.getElementById("bannersCarouselIndicators");
  592.             const carouselIndicator = myCarousel.querySelector("#carousel-loader .current-percent");
  593.             let intervalID;
  594.             const carousel = new bootstrap.Carousel(myCarousel);
  595.             const carouselUpper = document.getElementById("featuredProduct-upper-carousel")
  596.                     ? new bootstrap.Carousel(document.getElementById("featuredProduct-upper-carousel"))
  597.                     : null;
  598.             const carouselLower = document.getElementById("featuredProduct-lower-carousel")
  599.                 ? new bootstrap.Carousel(document.getElementById("featuredProduct-lower-carousel"))
  600.                 : null;
  601.             window.addEventListener("load", function () {
  602.                 fillCarouselIndicator();
  603.             });
  604.             myCarousel.addEventListener("slid.bs.carousel", function (e) {
  605.                 fillCarouselIndicator();
  606.             });
  607.             function fillCarouselIndicator() {
  608.                 carouselIndicator.style.width = 0;
  609.                 clearInterval(intervalID);
  610.                 carousel.pause();
  611.                 if (carouselUpper)
  612.                 {
  613.                     carouselUpper.pause();
  614.                 }
  615.                 if (carouselLower)
  616.                 {
  617.                     carouselLower.pause();
  618.                 }
  619.                 let i = 0;
  620.                 intervalID = setInterval(function () {
  621.                     i++;
  622.                     myCarousel.querySelector(".current-percent").style.width = i + "%";
  623.                     if (i >= 100) {
  624.                         carousel.next();
  625.                         if (carouselUpper)
  626.                         {
  627.                             carouselUpper.next();
  628.                         }
  629.                         if (carouselLower)
  630.                         {
  631.                             carouselLower.next();
  632.                         }
  633.                     }
  634.                 }, {{ banners.interval > 0 ? banners.interval : 3 }} * 10);
  635.             }
  636.         {% endif %}
  637.     </script>
  638. {% endblock %}
  639. {% block bodyClass %}is-bazaar{% endblock %}
  640. {% block header %}
  641.     {{ include(template_from_string(header)) }}
  642. {% endblock %}
  643. {% block footer %}
  644.     {{ include(template_from_string(footer)) }}
  645. {% endblock %}