{% extends 'base.html.twig' %}
{% trans_default_domain 'store' %}
{% block title %}
{% if landingPage.metaTitle %}
{{ landingPage.metaTitle }}
{% else %}
{{ parent() }}
{% endif %}
{% endblock %}
{% block facebook %}
{% if 'ckdev' in app.request.getSchemeAndHttpHost() %}
<meta name="robots" content="noindex, nofollow" />
{% endif %}
{% if app.request.locale == 'pl' %}
<meta property="og:image" content=""/>
<meta property="og:title" content="{{ landingPage.metaTitle }}"/>
<meta property="og:url" content="https://www.centrumkrzesel.pl{{ path('landing-page-front', {'id':landingPage.id, 'slug':landingPage.slug}, false) }}"/>
<meta property="og:description" content="{{ landingPage.metaDescription }}">
{% endif %}
{% if app.request.locale == 'cz' %}
{% if 'dev.ezidle' in app.request.getSchemeAndHttpHost() %}
<meta name="robots" content="noindex, nofollow" />
{% endif %}
<meta property="og:image" content=""/>
<meta property="og:title" content="{{ landingPage.metaTitle }}"/>
<meta property="og:url" content="https://www.ezidle.cz{{ path('landing-page-front', {'id':landingPage.id, 'slug':landingPage.slug}, false) }}"/>
<meta property="og:description" content="{{ landingPage.metaDescription }}">
{% endif %}
{% if app.request.locale == 'sk' %}
<meta property="og:image" content=""/>
<meta property="og:title" content="{{ landingPage.metaTitle }}"/>
<meta property="og:url" content="https://www.stolicky24.sk{{ path('landing-page-front', {'id':landingPage.id, 'slug':landingPage.slug}, false) }}"/>
<meta property="og:description" content="{{ landingPage.metaDescription }}">
{% endif %}
<meta property="og:type" content="website"/>
{% endblock %}
{% block meta_desc_key %}
{% if landingPage.metaDescription %}
<meta name="keywords" content="krzesła, fotele, hokery, meble, sklep internetowy, zakupy, centrum krzeseł">
<meta name="description" content="{{ landingPage.metaDescription }}">
{% else %}
{{ parent() }}
{% endif %}
{% endblock %}
{% block stylesheets %}
{{ parent() }}
<style>
#topBannerLp {
position:relative; width:100%; top:0px; height:35px; font-size:13px;
}
@media (min-width: 767px) {
.lista-produktow {
display: contents!important;
}
}
@media (max-width: 767px) {
#topBannerLp {
position: relative;
width: 100%;
top: 0px;
height: 60px;
font-size: 11px;
}
}
</style>
{% endblock %}
{% block javascripts %}
{{ parent() }}
<script>
function addToCart(product_id, sub) {
$('.cart-error-notification').hide();
var chosen = [];
let parameters = chosen;
let $variant = '';
;
var quantity = 1;
var url = $('#add_to_cart_url').val();
var equipments = [];
console.log(sub);
console.log(product_id);
$.ajax({
type: "POST",
url: url,
data: {'sub':sub, 'equipments':equipments, 'product_id':product_id, 'quantity':quantity, 'variant':$variant, 'parameters':parameters},
success: function (data) {
console.log(data);
if (parseInt(data.error) === 1) {
$('.cart-error-notification').show();
$('.cart-error-notification').html(data.message);
$('.ask-button').prop('disabled', false);
} else {
window.location.href = '/cart';
}
}
});
}
$('.ask-button').on("click", function(e) {
e.preventDefault();
var product_id = $(this).attr('product-id')
var sub = $(this).attr('product-sub');
addToCart(product_id, sub);
});
</script>
{% endblock %}
{% block content %}
<input type="hidden" name="add_to_cart_url" id="add_to_cart_url" value="{{ path('add_to_cart') }}"/>
<!-- START OF CATEGORY NAME SECTION -->
<section class="section">
<div class="container">
<div class="columns is-multiline">
{#
{% if landingPage.banner %}
<div class="columns" style="margin-top:30px;">
<div class="column is-full text-center">
{% if landingPage.banner.url %}
<a href="{{ landingPage.banner.url }}">
{% endif %}
<div class="image"><img src="/images/important/{{ landingPage.banner.imageName }}" alt=""></div>
{% if landingPage.banner.url %}
</a>
{% endif %}
</div>
</div>
{% endif %}
#}
{% if landingPage.banner %}
{% set banner = landingPage.banner %}
<div class='carousel-item has-background carousel-desktop' style="height:100%; background: {{ banner.color }}!important;">
{% if banner.title %}
<div style="color: {{ banner.campaignTextColor }}!important; float: left; max-width: 45%;">
<h1 class="banner_h1">
{{ banner.title }}
</h1>
<div class="additionalText" style="padding-top:40px;">
{{ banner.additionalText }}
</div>
</div>
{% else %}
{% endif %}
<div style="width: 100%; background: {{ banner.color }}!important; {% if banner.title %}float:right; max-width: 55%;{% endif %}">
<a href="{{ banner.url }}">
<img class="is-background" style="height:100%!important; float: right" src="/images/important/{{ banner.imageName }}" alt="{{ banner.title }}" />
</a>
</div>
</div>
<!-- mobile -->
<div class='carousel-item has-background carousel-mobile' style="background: {{ banner.color }}!important;">
<div>
<a href="{{ banner.url }}">
<img class="is-background" src="/images/important/{{ banner.imageName }}" alt="{{ banner.title }}" width="640" height="310" />
</a>
<div class="has-text-centered" style="background: {{ banner.color }}!important; margin-top:-10px;">
<h1 class="banner_h1 has-text-centered" style="color: {{ banner.campaignTextColor }}!important;">
{{ banner.title }}
</h1>
<div class="additionalText has-text-centered" style="color: {{ banner.campaignTextColor }}!important; margin-top:-10px;">
{{ banner.additionalText }}
</div>
</div>
</div>
</div>
{% endif %}
{% if landingPage.topBanner %}
{% set banner = landingPage.topBanner %}
<div class="column is-full text-center">
{% if banner.endDate %}
<script>
// Set the date we're counting down to
var countDownDateLp = new Date("{{ banner.endDate|date('M') }} {{ banner.endDate|date('d') }}, {{ banner.endDate|date('Y') }} {{ banner.endDate|date('H') }}:{{ banner.endDate|date('i') }}:{{ banner.endDate|date('s') }}").getTime();
// Update the count down every 1 second
var y = setInterval(function() {
// Get today's date and time
var now = new Date().getTime();
// Find the distance_lp between now and the count down date
var distance_lp = countDownDateLp - now;
// Time calculations for days, hours, minutes and seconds
var days = Math.floor(distance_lp / (1000 * 60 * 60 * 24));
var hours = Math.floor((distance_lp % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((distance_lp % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((distance_lp % (1000 * 60)) / 1000);
// Display the result in the element with id="demo"
document.getElementById("countdown_lp").innerHTML = '<strong>'+days + "</strong> {{ 'days'|trans }} <strong>" + hours + "</strong> {{ 'hours'|trans }} <strong>"
+ minutes + "</strong> {{ 'minutes'|trans }} <strong>" + seconds + " </strong>{{ 'seconds'|trans }} ";
// If the count down is finished, write some text
if (distance_lp < 0) {
clearInterval(y);
document.getElementById("countdown_lp").innerHTML = "{{ 'promo_expired'|trans }}";
}
}, 1000);
</script>
{% endif %}
{% if banner.url %}
<a href="{{ banner.url }}">
{% endif %}
<div style="background: {{ banner.background }}; color: {{ banner.textColor }}" id="topBannerLp">
{% set width = 50 %}
{% if banner.endDate %}
{% set width = 33 %}
{% endif %}
<div style="float: left; width:{{ width }}%; text-align: right; padding:8px;">
{{ banner.textLeft|trans|raw }}
</div>
{% if banner.endDate %}
<div style="float: left; width:33%; text-align: center; padding:8px;">
{{ 'banner_to_end'|trans }}: <span id="countdown_lp"></span>
</div>
{% endif %}
<div style="float: left; width:{{ width }}%; text-align: left; padding:8px;">
{{ banner.textRight|trans|raw }}
</div>
</div>
{% if banner.url %}
</a>
{% endif %}
</div>
{% endif %}
{% if landingPage.header %}
<div class="column is-full">
<span class="is-size-2 ">{{ landingPage.header }}</span>
</div>
{% endif %}
{% if landingPage.description %}
<div class="column is-full">
<span class="">
{{ landingPage.description|raw }}
</span>
</div>
{% endif %}
{% set productsCounter = landingPage.products.count %}
<div class="{% if productsCounter == 1 %}column is-full{% else %}columns{% endif %} is-multiline is-mobile lista-produktow" v-match-heights="{ el: [ '.with-description' ] }">
{% for productData in productsForProducer %}
{% set product = productData[0] %}
{% include 'frontend/components/smallProduct.html.twig' with {'isOneQuarter':1, 'product':product, 'productData':productData} %}
{% endfor %}
{% if landingPage.products.count %}
{% for productData in products %}
{% set product = productData[0] %}
{% include 'frontend/components/smallProduct.html.twig' with {'isOneQuarter':1, 'product':product, 'productData':productData} %}
{% endfor %}
{% endif %}
</div>
{% if products|length and landingPage.specialForBuyCheaper %}
<table class="table" style="width: 100%;">
<tr>
<th style="vertical-align: middle">
{{ 'preview_picture'|trans }}
</th>
<th style="vertical-align: middle">
{{ 'name'|trans }}
</th>
<th style="vertical-align: middle">
{{ 'discount'|trans }}
</th>
<th style="vertical-align: middle">
{{ 'regular_price'|trans }}
</th>
<th style="color:red;">
{{ 'promotional_price'|trans }}
</th>
<th style="vertical-align: middle"></th>
</tr>
{% for productData in products %}
{% set product = productData[0] %}
{% set show = 0 %}
{% if app.request.attributes.get('product') == null %}
{% set show = 1 %}
{% else %}
{% set show = 0 %}
{% endif %}
{% if app.request.attributes.get('product') == product.id %}
{% set show = 1 %}
{% endif %}
{% if show %}
<tr>
<td style="vertical-align: middle;">
<img style="height: 70px;" src="{{ asset('/images/product/'~productData.mainPhoto~'') | imagine_filter('small') }}">
</td>
<td style="vertical-align: middle;">
<a href="{{ path('product', {'slug':product.slug, 'id':product.id}) }}">
<strong>{{ productData.subName }}</strong>
</a>
</td>
<td style="vertical-align: middle;">
{{ productData.subRebate }}
</td>
<td style="vertical-align: middle; min-width: 80px;">
<strike>
{{ productData.beforeDiscount|formatPrice(currency) }}
</strike>
</td>
<td style="vertical-align: middle; min-width: 80px;">
{{ productData.subPrice|formatPrice(currency) }}
</td>
<td style="vertical-align: middle; width:20%;">
<div class="level-item">
<button product-id="{{ product.id }}" product-sub="{{ productData.subId }}" type="button" id="" class="ask-button button is-success has-text-weight-bold" style="opacity: 1;">
{{ 'order'|trans }}
<i class="fa fa-arrow-right"></i>
</button>
</div>
</td>
</tr>
{% endif %}
{% endfor %}
</table>
{% if productEntity %}
<br/> <br/>
<strong>
<a style="font-size:1rem;" href="{{ path('product', {'slug':productEntity.slug, 'id':productEntity.id}) }}" class="button is-small is-info"><i class="fa fa-arrow-left"></i> {{ 'back_to_product_page'|trans }}</a>
<a href="https://www.centrumkrzesel.pl/lp/228/strefa-okazji" style="font-size:1rem; background-color: #ef1b2b" class="button is-small is-info"><i class="fa fa-arrow-right"></i> {{ 'view_all_promotions'|trans }}</a>
</strong>
{% endif %}
{% endif %}
</div>
</div>
</section>
<!-- END OF CATEGORY NAME SECTION -->
{% endblock %}