{% extends 'AtechNetCoreBundle/base.html.twig' %}
{% import "AtechNetCoreBundle/macros.html.twig" as macros %}
{% block head %}
{{ parent() }}
{% if banners.items|length > 1 %}
{% for bannerItem in banners.items %}
<link rel="preload" as="image" href="{{ bannerItem.image }}">
{% endfor %}
{% endif %}
{% endblock %}
{% block content %}
{% set defaultLocale = app.request.session.get('defaultLocale') %}
<div class="promotions p-0">
<div class="container text-end">
<a href="/" class="back-to-homepage">{{ 'Back to refurbished computers' |trans }}</a>
</div>
</div>
{% if banners is not null and banners.items|length > 0 %}
<div class="promotions px-0 px-xl-0 pt-0">
<div class="container">
{% for message in app.flashes('pastPayResult') %}
<div class="alert alert-info" role="alert">
{{ message }}
</div>
{% endfor %}
<div class="grid-wrapper">
{% if banners.items |length > 1 %}
<div id="bannersCarouselIndicators" class="banner carousel slide" data-bs-ride="carousel">
<div class="carousel-indicators">
{% for banner in banners.items %}
<button
type="button"
data-bs-target="#bannersCarouselIndicators"
data-bs-slide-to="{{ loop.index - 1 }}"
class="active"
{% if loop.index == 1 %}
aria-current="true"
{% endif %}
aria-label="Slide {{ loop.index }}">
</button>
{% endfor %}
</div>
<div class="carousel-inner">
{% for bannerItem in banners.items %}
{% set gtag = "gtag('event', 'select_promotion', {" ~
"creative_name: 'homepage-tab-banner', " ~
"promotion_name: 'homepage-tab-banner', " ~
"promotion_id: '" ~ bannerItem.parentId ~ "_" ~ bannerItem.itemId ~ "', " ~
"promotion_name: '" ~ bannerItem.link ~ "', " ~
"items: [ "
%}
{% for item in banners.gtagEventItems %}
{% set gtag = gtag ~ "{" ~
"item_id: '" ~ item.item_id ~ "', " ~
"item_name: '" ~ item.item_name ~ "', " ~
"index: '" ~ item.index ~ "', " ~
"promotion_id: '" ~ item.promotion_id ~ "', " ~
"promotion_name: '" ~ item.promotion_name ~ "'" ~
"}, " %}
{% endfor %}
{% set gtag = gtag ~ " ]})" %}
<div class="carousel-item{% if loop.index == 1 %} active{% endif %}" data-bs-interval="{{ banners.interval }}">
<a href="{{ bannerItem.link }}" onclick="{{ gtag }}">
<img decoding="async" src="{{ bannerItem.image }}" class="d-block w-100" alt="#{{ loop.index }}" width="820" height="340" >
</a>
</div>
{% endfor %}
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#bannersCarouselIndicators" data-bs-slide="prev">
<img loading="lazy" decoding="async" src="{{ asset('theme/images/icon/arrow-left.svg') }}" alt="{{ 'Arrow left'|trans }}">
<span class="visually-hidden">{{ 'Previous slide' |trans }}</span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#bannersCarouselIndicators" data-bs-slide="next">
<img loading="lazy" decoding="async" src="{{ asset('theme/images/icon/arrow-right.svg') }}" alt="{{ 'Arrow right'|trans }}">
<span class="visually-hidden">{{ 'Next slide' |trans }}</span>
</button>
<div id="carousel-loader">
<div class="current-percent"></div>
</div>
</div>
{% else %}
<div class="banner">
<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">
<picture>
<img loading="lazy" decoding="async" src="{{ banners.items[0].image }}" alt="banner" width="820" height="340" />
</picture>
</a>
</div>
{% endif %}
{% if smallBanners is not empty %}
{% if smallBanners.upper.image is defined and smallBanners.upper is not empty %}
<div class="small-banner upper">
<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">
<img loading="lazy" decoding="async" src="{{ smallBanners.upper.image }}" alt="{{ smallBanners.upper.title }}" width="550" height="244">
</a>
</div>
{% else %}
{% if smallBanners.upper.display == const('Banner::BANNER_DISPLAY_TYPE_CATEGORY_GROUP') and featuredCategory.upper is defined and featuredCategory.upper is not empty %}
<div class="featured-category-box{% if featuredCategory.upper.isWizard is defined and featuredCategory.upper.isWizard %} wizard{% endif %} upper">
<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">
<img loading="lazy" decoding="async" src="{{ featuredCategory.upper.image }}" alt="{{ featuredCategory.upper.title }}" width="376" height="210">
<div class="description">
<h3 class="mb-1 mb-md-2 mb-xl-3"><strong>{{ featuredCategory.upper.title }}</strong></h3>
<p class="mb-1">{{ featuredCategory.upper.description }}</p>
<span>{{ 'Featured category view'|trans }}</span>
</div>
</a>
</div>
{% elseif smallBanners.upper.display == const('Banner::BANNER_DISPLAY_TYPE_PRODUCT') and featuredProduct.upper is defined and featuredProduct.upper is not empty %}
<div class="featured-product-box upper">
<div class="recommendation-label">
<span>{{ 'Recommended'|trans }}</span>
</div>
{% set gtag = "gtag('event', 'select_promotion', {" ~
"creative_name:'homepage-featured-product', " ~
"promotion_name:'homepage-featured-product', " ~
"items: [{" ~
"item_id: '" ~ featuredProduct.upper.code ~ "', " ~
"item_name: '" ~ featuredProduct.upper.title ~ "', " ~
"discount: " ~ featuredProduct.upper.special|number_format(2, '.', '') ~ ", " ~
"index: 0, " ~
"item_brand: '" ~ featuredProduct.upper.vendor ~ "', " ~
"price: " ~ featuredProduct.upper.price|number_format(2, '.', '') ~
"quantity: 1, " ~
"}]
})" %}
<a href="{{ featuredProduct.upper.href }}" class="featured-product-wrapper" onclick="{{ gtag }}" id="homepage-featured-product">
<div class="product-image me-3">
{% if featuredProduct.upper.carouselImages is defined %}
<div id="featuredProduct-upper-carousel" class="carousel slide" data-bs-ride="carousel">
<div class="carousel-inner">
{% for image in featuredProduct.upper.carouselImages %}
<div class="carousel-item {% if loop.first %}active{% endif %}" data-bs-interval="8000">
<img loading="lazy" decoding="async" src="{{ image }}" class="d-block w-100" alt="{{ featuredProduct.upper.vendor }} {{ featuredProduct.upper.title }}">
</div>
{% endfor %}
</div>
</div>
{% else %}
<img loading="lazy" decoding="async" src="{{ featuredProduct.upper.image }}" alt="{{ featuredProduct.upper.vendor }} {{ featuredProduct.upper.title }}">
{% endif %}
</div>
<div class="product-info">
<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>
<p class="product-description mb-2 mb-md-3">{{- featuredProduct.upper.attributesListTxt|raw -}}</p>
<div class="prices">
{% if featuredProduct.upper.isDiscounted %}
<span class="discounted">
{{- featuredProduct.upper.special|price(currency, precision) -}}
</span>
{% endif %}
<span class="price{{ featuredProduct.upper.isDiscounted ? ' discounted-on' : '' }}">
{{- featuredProduct.upper.price|price(currency, precision) -}}
</span>
</div>
</div>
</a>
{% if banners.items |length > 1 %}
{% set promotionItems = banners.gtagEventItems |json_encode %}
{# for item in banners.gtagEventItems %}
{% set promotionItems = promotionItems ~ "{" ~
"item_id: '" ~ item.item_id "', " ~
"item_name: '" ~ item.item_name "', " ~
"item_name": "{{ item.item_name }}",
"index": "{{ item.index }}",
"promotion_id": "{{ item.promotion_id }}",
"promotion_name": "{{ item.promotion_name }}"
"}," %}
{% endfor #}
{% else %}
{% endif %}
<script>
gtag("event", "view_promotion", {
creative_name: "homepage-tab-banner",
promotion_name: "homepage-tab-banner",
items: JSON.parse('{{ promotionItems }}')
});
gtag("event", "view_promotion", {
creative_name: "homepage-featured-category",
promotion_name: "homepage-featured-category",
items: []
});
gtag("event", "view_promotion", {
creative_name: "homepage-featured-product",
promotion_name: "homepage-featured-product",
items: [
{
item_id: "{{ featuredProduct.upper.code }}",
item_name: "{{ featuredProduct.upper.title }}",
discount: {{ featuredProduct.upper.special|number_format(2, '.', '') }},
index: 0,
item_brand: "{{ featuredProduct.upper.vendor }}",
price: {{ featuredProduct.upper.price|number_format(2, '.', '') }},
quantity: 1
}
]
});
</script>
</div>
{% else %}
<div class="small-banner upper"></div>
{% endif %}
{% endif %}
{% if smallBanners.lower.image is defined and smallBanners.lower is not empty %}
<div class="small-banner lower">
<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">
<img loading="lazy" decoding="async" src="{{ smallBanners.lower.image }}" alt="{{ smallBanners.lower.title }}" width="550" height="244">
</a>
</div>
{% else %}
{% if smallBanners.lower.display == const('Banner::BANNER_DISPLAY_TYPE_CATEGORY_GROUP') and featuredCategory.lower is defined and featuredCategory.lower is not empty %}
<div class="featured-category-box{% if featuredCategory.lower.isWizard is defined and featuredCategory.lower.isWizard %} wizard{% endif %} lower">
<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">
<img loading="lazy" decoding="async" src="{{ featuredCategory.lower.image }}" alt="{{ featuredCategory.lower.title }}" width="376" height="210">
<div class="description">
<h3 class="mb-1 mb-md-2 mb-xl-3"><strong>{{ featuredCategory.lower.title }}</strong></h3>
<p class="mb-1">{{ featuredCategory.lower.description }}</p>
<span>{{ 'Featured category view'|trans }}</span>
</div>
</a>
</div>
{% elseif smallBanners.lower.display == const('Banner::BANNER_DISPLAY_TYPE_PRODUCT') and featuredProduct.lower is defined and featuredProduct.lower is not empty %}
<div class="featured-product-box lower">
<div class="recommendation-label">
<span>{{ 'Recommended'|trans }}</span>
</div>
<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">
<div class="product-image me-3">
{% if featuredProduct.lower.carouselImages is defined %}
<div id="featuredProduct-lower-carousel" class="carousel slide" data-bs-ride="carousel">
<div class="carousel-inner">
{% for image in featuredProduct.lower.carouselImages %}
<div class="carousel-item {% if loop.first %}active{% endif %}">
<img loading="lazy" decoding="async" src="{{ image }}" class="d-block w-100" alt="{{ featuredProduct.lower.vendor }} {{ featuredProduct.lower.title }}">
</div>
{% endfor %}
</div>
</div>
{% else %}
<img loading="lazy" decoding="async" src="{{ featuredProduct.lower.image }}" alt="{{ featuredProduct.lower.vendor }} {{ featuredProduct.lower.title }}">
{% endif %}
</div>
<div class="product-info">
<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>
<p class="product-description mb-2 mb-md-3">{{- featuredProduct.lower.attributesListTxt|raw -}}</p>
<div class="prices">
{% if featuredProduct.lower.isDiscounted %}
<span class="discounted">
{{- featuredProduct.lower.special|price(currency, precision) -}}
</span>
{% endif %}
<span class="price{{ featuredProduct.lower.isDiscounted ? ' discounted-on' : '' }}">
{{- featuredProduct.lower.price|price(currency, precision) -}}
</span>
</div>
</div>
</a>
<script>
gtag("event", "view_promotion", {
creative_name: "homepage-tab-banner",
promotion_name: "homepage-tab-banner",
{% if banners.items|length > 1 -%}
items: [
{% for item in banners.gtagEventItems %}
{
"item_id": "{{ item.item_id }}",
"item_name": "{{ item.item_name }}",
"index": "{{ item.index }}",
"promotion_id": "{{ item.promotion_id }}",
"promotion_name": "{{ item.promotion_name }}"
},
{% endfor %}
]
{% else -%}
items: []
{% endif -%}
});
gtag("event", "view_promotion", {
creative_name: "homepage-featured-category",
promotion_name: "homepage-featured-category",
items: []
});
gtag("event", "view_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
}
]
});
</script>
</div>
{% else %}
<div class="small-banner lower"></div>
{% endif %}
{% endif %}
{% endif %}
</div>
</div>
</div>
{% endif %}
{% include 'AtechNetCoreBundle/Module/advantages.html.twig' with {'warrantyYear': warrantyYear, 'reviewCount': reviewCount, 'lang': lang} %}
{% if featuredCategories %}
<section class="featured-categories">
<div class="container">
{% for category in featuredCategories %}
<div class="link-item">
<a href="{{ category.href }}">
<div class="image-wrapper">
<img loading="lazy" decoding="async" src="{{ asset('theme/images/category/' ~ category.image) }}" alt="{{ category.title }}">
</div>
<div class="featured-category-title"><span>{{ category.title }}</span></div>
<div class="arrow-right"></div>
</a>
</div>
{% endfor %}
</div>
</section>
{% endif %}
<div class="main-content">
<div class="container">
{{ include(template_from_string(content_top)) }}
<!-- Product selection tab -->
<section class="main-products-carousel">
<h3>{{ 'Popular product list'|trans }}</h3>
<div class="owl-carousel" id="main-products-carousel">
{% if mainProducts %}
{{ macros.printProducts(mainProducts, currency, precision, 12, true, true, false) }}
{% endif %}
</div>
<script>
if ( window.dataLayer ) {
window.dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object.
window.dataLayer.push({
event: "view_item_list",
ecommerce: {
item_list_id: "homepage-popular-products",
item_list_name: "homepage-popular-products",
items: [
{% for mainProduct in mainProducts %}{% if loop.index > 1 %},{% endif %}{
item_id: "{{ mainProduct.id }}",
item_name: "{{ mainProduct.title }}",
discount: {{ mainProduct.rawDiscountPrice }},
index: {{ loop.index }},
item_brand: "{{ mainProduct.vendor }}",
price: {{ mainProduct.rawPrice }},
quantity: 1
}
{% endfor %}
]
}
});
}
</script>
</section>
</div>
<div class="testimonial-wrapper{% if domainId == const('Domain::DOMAIN_ID_RT_EU') %} eu-trustindex{% endif %}">
<div class="container">
{%- if domainId == const('Domain::DOMAIN_ID_RT_EU') -%}
<script defer async src='https://cdn.trustindex.io/loader.js?757dc6b28849419b02269e1ac4f'></script>
{% else %}
{{ include(template_from_string(content_reviews)) }}
{%- endif -%}
</div>
</div>
<div id="preload-content-center">
<div class="category-selection">
<div class="row preload">
<div class="col-md-6">
<div class="category-selection-item">
<div class="category-selection-desc">
{% for i in 1..4 %}
<div class="row">
<div class="col-3 col-sm-2"></div>
<div class="col-9 col-sm-10"></div>
</div>
{% endfor %}
</div>
</div>
</div>
<div class="col-md-6">
<div class="row wrapper">
{% for i in 1..4 %}
<div class="col-sm-6"></div>
{% endfor %}
</div>
</div>
</div>
</div>
<div class="bazar-product-list">
<div class="row preload">
{% for i in 1..4 %}
<div class="col-6 col-sm-4 col-lg-3">
<div class="preload-item">
<div class="image"></div>
<div class="title1"></div>
<div class="title2"></div>
<div class="description"></div>
<div class="prices"></div>
<div class="button"></div>
</div>
</div>
{% endfor %}
</div>
</div>
<div class="heureka-list">
<div class="row preload">
<div class="col-sm-3">
<div class="preload-item heureka-logo">
<div class="image" style="border-radius: 200px;"></div>
<div class="title1"></div>
</div>
</div>
{% for i in 1..3 %}
<div class="col-sm-3">
<div class="preload-item">
<div class="image"></div>
<div class="title1"></div>
<div class="title2"></div>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
<div id="content-center"></div>
{{ include(template_from_string(content_bottom)) }}
{% endblock %}
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('theme/owl-carousel/assets/owl.carousel.min.css'|appendAssetCache) }}">
{{ parent() }}
{% endblock %}
{% block javascripts %}
{{ parent() }}
<script type="text/javascript" src="{{ asset('theme/owl-carousel/owl.carousel.min.js'|appendAssetCache) }}"></script>
<script>
var mainProductsOwlObject = {
loop: false,
startPosition: 0,
dots: true,
checkVisibility: false,
nav: true,
navText: [
`<i class="fas fa-chevron-left"></i><span class="visually-hidden">{{ 'Previous slide'|trans }}</span>`,
`<i class="fas fa-chevron-right"></i><span class="visually-hidden">{{ 'Next slide'|trans }}</span>`
],
responsive: {
1330: {
nav: true,
items: 4,
stagePadding: 10,
margin: 0
},
990: {
items: 4,
nav: false,
stagePadding: 10,
margin: 20
},
576: {
items: 3,
nav: false,
dots: true,
stagePadding: 0
},
0: {
items: 2,
nav: false,
dots: true,
stagePadding: 0,
mergeFit: true
}
}
};
$(document).ready(function() {
$("#main-products-carousel").owlCarousel(mainProductsOwlObject);
$('#main-products-carousel').equation({
carousel: true,
selectors: [
'.product-list-item .product-list-details .product-list-name',
'.product-list-item .product-list-details .product-list-attributes'
]
});
$('#main-products-carousel .owl-dot').each(function(index) {
$(this).attr('aria-label', "{{ 'Go to slide'|trans }}" + (index + 1));
});
$.ajax({
method: 'GET',
url: '{{ path("homepage_bottom_content_ajax") }}',
success: function(response) {
let result = response.replace(/\s/g,' ');
$('#content-center').html(result).show();
setCarousels();
$('#preload-content-center').hide();
}
});
});
function owlInitialized () {
$(".product-list .row.preload").remove();
}
function setCarousels () {
$('#categorySelection .carousel-inner').owlCarousel({
items: 1,
dots: false,
nav: true,
loop: true,
navText: [
'<i class="fas fa-chevron-left"></i>',
'<i class="fas fa-chevron-right"></i>'
]
});
$("#homepage-blog-carousel").owlCarousel({
items: 3,
loop: false,
startPosition: 0,
nav: false,
dots: true,
responsive: {
990: {
items: 3,
dots: false,
stagePadding: 0
},
590: {
items: 2,
dots: true,
stagePadding: 0
},
0: {
items: 1,
dots: true,
stagePadding: 0
}
}
});
$("#under-amount-products-carousel").owlCarousel({
loop: false,
startPosition: 0,
checkVisibility: false,
margin: 20,
navText: [
'<i class="fas fa-chevron-left"></i>',
'<i class="fas fa-chevron-right"></i>'
],
responsive: {
1330: {
nav: true,
dots: true,
items: 3
},
767: {
items: 3,
nav: false,
dots: true
},
670: {
items: 2,
nav: false,
dots: true,
margin: 10,
stagePadding: 40
},
380: {
items: 1,
nav: false,
dots: true,
mergeFit: true,
margin: 10,
stagePadding: 12
},
0: {
items: 1,
nav: false,
dots: true,
mergeFit: true,
margin: 10,
stagePadding: 12
}
}
});
}
{% if banners is not null and banners.items|length > 1 %}
const myCarousel = document.getElementById("bannersCarouselIndicators");
const carouselIndicator = myCarousel.querySelector("#carousel-loader .current-percent");
let intervalID;
const carousel = new bootstrap.Carousel(myCarousel);
const carouselUpper = document.getElementById("featuredProduct-upper-carousel")
? new bootstrap.Carousel(document.getElementById("featuredProduct-upper-carousel"))
: null;
const carouselLower = document.getElementById("featuredProduct-lower-carousel")
? new bootstrap.Carousel(document.getElementById("featuredProduct-lower-carousel"))
: null;
window.addEventListener("load", function () {
fillCarouselIndicator();
});
myCarousel.addEventListener("slid.bs.carousel", function (e) {
fillCarouselIndicator();
});
function fillCarouselIndicator() {
carouselIndicator.style.width = 0;
clearInterval(intervalID);
carousel.pause();
if (carouselUpper)
{
carouselUpper.pause();
}
if (carouselLower)
{
carouselLower.pause();
}
let i = 0;
intervalID = setInterval(function () {
i++;
myCarousel.querySelector(".current-percent").style.width = i + "%";
if (i >= 100) {
carousel.next();
if (carouselUpper)
{
carouselUpper.next();
}
if (carouselLower)
{
carouselLower.next();
}
}
}, {{ banners.interval > 0 ? banners.interval : 3 }} * 10);
}
{% endif %}
</script>
{% endblock %}
{% block bodyClass %}is-bazaar{% endblock %}
{% block header %}
{{ include(template_from_string(header)) }}
{% endblock %}
{% block footer %}
{{ include(template_from_string(footer)) }}
{% endblock %}