templates/frontend/landingPage/landingPage.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% trans_default_domain 'store' %}
  3. {% block title %}
  4.     {% if landingPage.metaTitle %}
  5.         {{ landingPage.metaTitle }}
  6.     {% else %}
  7.         {{ parent() }}
  8.     {% endif %}
  9. {% endblock %}
  10. {% block facebook %}
  11.     {% if 'ckdev' in app.request.getSchemeAndHttpHost() %}
  12.         <meta name="robots" content="noindex, nofollow" />
  13.     {% endif %}
  14.     {% if app.request.locale == 'pl' %}
  15.         <meta property="og:image" content=""/>
  16.         <meta property="og:title" content="{{ landingPage.metaTitle }}"/>
  17.         <meta property="og:url" content="https://www.centrumkrzesel.pl{{ path('landing-page-front', {'id':landingPage.id, 'slug':landingPage.slug}, false) }}"/>
  18.         <meta property="og:description" content="{{ landingPage.metaDescription }}">
  19.     {% endif %}
  20.     {% if app.request.locale == 'cz' %}
  21.         {% if 'dev.ezidle' in app.request.getSchemeAndHttpHost() %}
  22.             <meta name="robots" content="noindex, nofollow" />
  23.         {% endif %}
  24.         <meta property="og:image" content=""/>
  25.         <meta property="og:title" content="{{ landingPage.metaTitle }}"/>
  26.         <meta property="og:url" content="https://www.ezidle.cz{{ path('landing-page-front', {'id':landingPage.id, 'slug':landingPage.slug}, false) }}"/>
  27.         <meta property="og:description" content="{{ landingPage.metaDescription }}">
  28.     {% endif %}
  29.     {% if app.request.locale == 'sk' %}
  30.         <meta property="og:image" content=""/>
  31.         <meta property="og:title" content="{{ landingPage.metaTitle }}"/>
  32.         <meta property="og:url" content="https://www.stolicky24.sk{{ path('landing-page-front', {'id':landingPage.id, 'slug':landingPage.slug}, false) }}"/>
  33.         <meta property="og:description" content="{{ landingPage.metaDescription }}">
  34.     {% endif %}
  35.     <meta property="og:type" content="website"/>
  36. {% endblock %}
  37. {% block meta_desc_key %}
  38.     {% if landingPage.metaDescription %}
  39.         <meta name="keywords" content="krzesła, fotele, hokery, meble, sklep internetowy, zakupy, centrum krzeseł">
  40.         <meta name="description" content="{{ landingPage.metaDescription }}">
  41.     {% else %}
  42.         {{ parent() }}
  43.     {% endif %}
  44. {% endblock %}
  45. {% block stylesheets %}
  46.     {{ parent() }}
  47.     <style>
  48.         #topBannerLp {
  49.             position:relative; width:100%; top:0px; height:35px; font-size:13px;
  50.         }
  51.         @media (min-width: 767px) {
  52.             .lista-produktow {
  53.                 display: contents!important;
  54.             }
  55.         }
  56.         @media (max-width: 767px) {
  57.             #topBannerLp {
  58.                 position: relative;
  59.                 width: 100%;
  60.                 top: 0px;
  61.                 height: 60px;
  62.                 font-size: 11px;
  63.             }
  64.         }
  65.     </style>
  66. {% endblock %}
  67. {% block javascripts %}
  68.     {{ parent() }}
  69.     <script>
  70.         function addToCart(product_id, sub) {
  71.             $('.cart-error-notification').hide();
  72.             var chosen = [];
  73.             let parameters = chosen;
  74.             let $variant = '';
  75.             ;
  76.             var quantity = 1;
  77.             var url = $('#add_to_cart_url').val();
  78.             var equipments = [];
  79.             console.log(sub);
  80.             console.log(product_id);
  81.             $.ajax({
  82.                 type: "POST",
  83.                 url: url,
  84.                 data: {'sub':sub, 'equipments':equipments, 'product_id':product_id, 'quantity':quantity, 'variant':$variant, 'parameters':parameters},
  85.                 success: function (data) {
  86.                     console.log(data);
  87.                     if (parseInt(data.error) === 1) {
  88.                         $('.cart-error-notification').show();
  89.                         $('.cart-error-notification').html(data.message);
  90.                         $('.ask-button').prop('disabled', false);
  91.                     } else {
  92.                         window.location.href = '/cart';
  93.                     }
  94.                 }
  95.             });
  96.         }
  97.         $('.ask-button').on("click", function(e) {
  98.             e.preventDefault();
  99.             var product_id = $(this).attr('product-id')
  100.             var sub = $(this).attr('product-sub');
  101.             addToCart(product_id, sub);
  102.         });
  103.     </script>
  104. {% endblock %}
  105. {% block content %}
  106.     <input type="hidden" name="add_to_cart_url" id="add_to_cart_url" value="{{ path('add_to_cart') }}"/>
  107.     <!-- START OF CATEGORY NAME SECTION -->
  108.     <section class="section">
  109.         <div class="container">
  110.             <div class="columns is-multiline">
  111.                 {#
  112.                 {% if landingPage.banner %}
  113.                     <div class="columns" style="margin-top:30px;">
  114.                         <div class="column is-full text-center">
  115.                             {% if landingPage.banner.url %}
  116.                             <a href="{{ landingPage.banner.url }}">
  117.                                 {% endif %}
  118.                                 <div class="image"><img src="/images/important/{{ landingPage.banner.imageName }}" alt=""></div>
  119.                                 {% if landingPage.banner.url %}
  120.                             </a>
  121.                             {% endif %}
  122.                         </div>
  123.                     </div>
  124.                 {% endif %}
  125.                 #}
  126.                 {% if landingPage.banner %}
  127.                     {% set banner = landingPage.banner %}
  128.                     <div class='carousel-item has-background carousel-desktop' style="height:100%; background: {{ banner.color }}!important;">
  129.                         {% if banner.title %}
  130.                             <div style="color: {{ banner.campaignTextColor }}!important; float: left; max-width: 45%;">
  131.                                 <h1 class="banner_h1">
  132.                                     {{ banner.title }}
  133.                                 </h1>
  134.                                 <div class="additionalText" style="padding-top:40px;">
  135.                                     {{ banner.additionalText }}
  136.                                 </div>
  137.                             </div>
  138.                         {% else %}
  139.                         {% endif %}
  140.                         <div style="width: 100%; background: {{ banner.color }}!important; {% if banner.title %}float:right; max-width: 55%;{% endif %}">
  141.                             <a href="{{ banner.url }}">
  142.                                 <img class="is-background" style="height:100%!important; float: right" src="/images/important/{{ banner.imageName }}" alt="{{ banner.title }}" />
  143.                             </a>
  144.                         </div>
  145.                     </div>
  146.                     <!-- mobile -->
  147.                     <div class='carousel-item has-background carousel-mobile' style="background: {{ banner.color }}!important;">
  148.                         <div>
  149.                             <a href="{{ banner.url }}">
  150.                                 <img class="is-background" src="/images/important/{{ banner.imageName }}" alt="{{ banner.title }}" width="640" height="310"  />
  151.                             </a>
  152.                             <div class="has-text-centered" style="background: {{ banner.color }}!important; margin-top:-10px;">
  153.                                 <h1 class="banner_h1 has-text-centered" style="color: {{ banner.campaignTextColor }}!important;">
  154.                                     {{ banner.title }}
  155.                                 </h1>
  156.                                 <div class="additionalText has-text-centered" style="color: {{ banner.campaignTextColor }}!important; margin-top:-10px;">
  157.                                     {{ banner.additionalText }}
  158.                                 </div>
  159.                             </div>
  160.                         </div>
  161.                     </div>
  162.                 {% endif %}
  163.                 {% if landingPage.topBanner %}
  164.                     {% set banner = landingPage.topBanner %}
  165.                     <div class="column is-full text-center">
  166.                         {% if banner.endDate %}
  167.                             <script>
  168.                                 // Set the date we're counting down to
  169.                                 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();
  170.                                 // Update the count down every 1 second
  171.                                 var y = setInterval(function() {
  172.                                     // Get today's date and time
  173.                                     var now = new Date().getTime();
  174.                                     // Find the distance_lp between now and the count down date
  175.                                     var distance_lp = countDownDateLp - now;
  176.                                     // Time calculations for days, hours, minutes and seconds
  177.                                     var days = Math.floor(distance_lp / (1000 * 60 * 60 * 24));
  178.                                     var hours = Math.floor((distance_lp % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
  179.                                     var minutes = Math.floor((distance_lp % (1000 * 60 * 60)) / (1000 * 60));
  180.                                     var seconds = Math.floor((distance_lp % (1000 * 60)) / 1000);
  181.                                     // Display the result in the element with id="demo"
  182.                                     document.getElementById("countdown_lp").innerHTML = '<strong>'+days + "</strong> {{ 'days'|trans }} <strong>" + hours + "</strong> {{ 'hours'|trans }} <strong>"
  183.                                         + minutes + "</strong> {{ 'minutes'|trans }} <strong>" + seconds + " </strong>{{ 'seconds'|trans }} ";
  184.                                     // If the count down is finished, write some text
  185.                                     if (distance_lp < 0) {
  186.                                         clearInterval(y);
  187.                                         document.getElementById("countdown_lp").innerHTML = "{{ 'promo_expired'|trans }}";
  188.                                     }
  189.                                 }, 1000);
  190.                             </script>
  191.                         {% endif %}
  192.                         {% if banner.url %}
  193.                             <a href="{{ banner.url }}">
  194.                         {% endif %}
  195.                         <div style="background: {{ banner.background }}; color: {{ banner.textColor }}" id="topBannerLp">
  196.                             {% set width = 50 %}
  197.                             {% if banner.endDate %}
  198.                                 {% set width = 33 %}
  199.                             {% endif %}
  200.                             <div style="float: left; width:{{ width }}%; text-align: right; padding:8px;">
  201.                                 {{ banner.textLeft|trans|raw }}
  202.                             </div>
  203.                             {% if banner.endDate %}
  204.                                 <div style="float: left; width:33%; text-align: center; padding:8px;">
  205.                                     {{ 'banner_to_end'|trans }}: <span id="countdown_lp"></span>
  206.                                 </div>
  207.                             {% endif %}
  208.                             <div style="float: left; width:{{ width }}%; text-align: left; padding:8px;">
  209.                                 {{ banner.textRight|trans|raw }}
  210.                             </div>
  211.                         </div>
  212.                         {% if banner.url %}
  213.                             </a>
  214.                         {% endif %}
  215.                     </div>
  216.                 {% endif %}
  217.                 {% if landingPage.header %}
  218.                     <div class="column is-full">
  219.                         <span class="is-size-2 ">{{ landingPage.header }}</span>
  220.                     </div>
  221.                 {% endif %}
  222.                 {% if landingPage.description %}
  223.                     <div class="column is-full">
  224.                         <span class="">
  225.                             {{ landingPage.description|raw }}
  226.                         </span>
  227.                     </div>
  228.                 {% endif %}
  229.                 {% set productsCounter = landingPage.products.count %}
  230.                 <div class="{% if productsCounter == 1 %}column is-full{% else %}columns{% endif %} is-multiline is-mobile lista-produktow" v-match-heights="{ el: [ '.with-description' ] }">
  231.                     {% for productData in productsForProducer %}
  232.                         {% set product = productData[0] %}
  233.                             {% include 'frontend/components/smallProduct.html.twig' with {'isOneQuarter':1, 'product':product, 'productData':productData} %}
  234.                     {% endfor %}
  235.                     {% if landingPage.products.count %}
  236.                         {% for productData in products %}
  237.                             {% set product = productData[0] %}
  238.                             {% include 'frontend/components/smallProduct.html.twig' with {'isOneQuarter':1, 'product':product, 'productData':productData} %}
  239.                         {% endfor %}
  240.                     {% endif %}
  241.                 </div>
  242.                 {% if products|length and landingPage.specialForBuyCheaper %}
  243.                     <table class="table" style="width: 100%;">
  244.                         <tr>
  245.                             <th style="vertical-align: middle">
  246.                                 {{ 'preview_picture'|trans }}
  247.                             </th>
  248.                             <th style="vertical-align: middle">
  249.                                 {{ 'name'|trans }}
  250.                             </th>
  251.                             <th style="vertical-align: middle">
  252.                                 {{ 'discount'|trans }}
  253.                             </th>
  254.                             <th style="vertical-align: middle">
  255.                                 {{ 'regular_price'|trans }}
  256.                             </th>
  257.                             <th style="color:red;">
  258.                                 {{ 'promotional_price'|trans }}
  259.                             </th>
  260.                             <th style="vertical-align: middle"></th>
  261.                         </tr>
  262.                     {% for productData in products %}
  263.                         {% set product = productData[0] %}
  264.                         {% set show = 0 %}
  265.                         {% if app.request.attributes.get('product') == null %}
  266.                             {% set show = 1 %}
  267.                         {% else %}
  268.                             {% set show = 0 %}
  269.                         {% endif %}
  270.                         {% if app.request.attributes.get('product') == product.id %}
  271.                             {% set show = 1 %}
  272.                         {% endif %}
  273.                         {% if show %}
  274.                             <tr>
  275.                                 <td style="vertical-align: middle;">
  276.                                     <img style="height: 70px;" src="{{ asset('/images/product/'~productData.mainPhoto~'') | imagine_filter('small') }}">
  277.                                 </td>
  278.                                 <td style="vertical-align: middle;">
  279.                                     <a href="{{ path('product', {'slug':product.slug, 'id':product.id}) }}">
  280.                                         <strong>{{ productData.subName }}</strong>
  281.                                     </a>
  282.                                 </td>
  283.                                 <td style="vertical-align: middle;">
  284.                                     {{ productData.subRebate }}
  285.                                 </td>
  286.                                 <td style="vertical-align: middle; min-width: 80px;">
  287.                                     <strike>
  288.                                     {{ productData.beforeDiscount|formatPrice(currency) }}
  289.                                     </strike>
  290.                                 </td>
  291.                                 <td style="vertical-align: middle;  min-width: 80px;">
  292.                                     {{ productData.subPrice|formatPrice(currency) }}
  293.                                 </td>
  294.                                 <td style="vertical-align: middle; width:20%;">
  295.                                     <div class="level-item">
  296.                                         <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;">
  297.                                             {{ 'order'|trans }} &nbsp;
  298.                                             <i class="fa fa-arrow-right"></i>
  299.                                         </button>
  300.                                     </div>
  301.                                 </td>
  302.                             </tr>
  303.                         {% endif %}
  304.                     {% endfor %}
  305.                     </table>
  306.                     {% if productEntity %}
  307.                         <br/> <br/>
  308.                         <strong>
  309.                         <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>&nbsp; {{ 'back_to_product_page'|trans }}</a>
  310.                         &nbsp; &nbsp;
  311.                         <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>&nbsp; {{ 'view_all_promotions'|trans }}</a>
  312.                         </strong>
  313.                     {% endif %}
  314.                 {% endif %}
  315.             </div>
  316.         </div>
  317.     </section>
  318.     <!-- END OF CATEGORY NAME SECTION -->
  319. {% endblock %}