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

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% trans_default_domain 'store' %}
  3. {% form_theme form 'form/front.html.twig' %}
  4. {% block title %}
  5.     {{ furnitureType.metaTitle }}
  6.     {% if app.request.attributes.get('customFilter') == '24h' %}
  7.         {{ 'products_in_24h_delivery'|trans({}, 'store', locale) }}
  8.     {% endif %}
  9.     {% if (app.request.query.get('page') == 1 or app.request.query.get('page') == null) %}
  10.     {% else %}
  11.         - {{ 'page'|trans }} {{ app.request.get('page') }}
  12.     {% endif %}
  13. {% endblock %}
  14. {% block meta_desc_key %}
  15.     {% if furnitureType.metaDescription is defined %}
  16.         <meta name="description" content="{{ furnitureType.metaDescription|raw }}">
  17.     {% else %}
  18.         <meta name="description" content="Centrum Krzeseł, Sprawdź krzesła i fotele do biura i domu. Niskie ceny, gwarancja oraz dostawa 24h. Kup teraz!">
  19.     {% endif %}
  20.     {% if furnitureType.metaKeywords is defined %}
  21.         <meta name="keywords" content="{{ furnitureType.metaKeywords|raw }}">
  22.     {% else %}
  23.         <meta name="keywords" content="krzesła, fotele, hokery, meble, sklep internetowy, zakupy, centrum krzeseł">
  24.     {% endif %}
  25.     {% if app.request.locale == 'pl' %}
  26.         {# veltis tag #}
  27.         {#
  28.         <script async src='https://app.veltis.io/uploads/veltis.js'></script><script>window.veltisData = window.veltisData || []; function veltisTag() { veltisData.push(arguments); } veltisTag('js', new Date()); veltisTag('config', '1aadaf84c154d3e3'); </script>
  29.         #}
  30.     {% endif %}
  31. {% endblock %}
  32. {% block facebook %}
  33.     {% if furnitureType.imageName %}
  34.         <meta property="og:image" content="{{ language.storeUrl }}/images/category/{{ furnitureType.imageName }}"/>
  35.     {% endif %}
  36.     {% autoescape %}
  37.         <meta property="og:title" content="{{ furnitureType.name }}"/>
  38.     {% endautoescape %}
  39.     <meta property="og:url" content="{{ language.storeUrl }}{{ path('furnitureType', {'slug':furnitureType.slug, 'furnitureTypeId':furnitureType.id}) }}"/>
  40.     {% if furnitureType.metaDescription is defined %}
  41.         <meta property="og:description" content="{{ furnitureType.metaDescription|raw }}">
  42.     {% else %}
  43.         <meta property="og:description" content="{{ furnitureType.metaTitle|raw }}">
  44.     {% endif %}
  45.     <meta property="og:type" content="product.group"/>
  46.     {% if furnitureType.getCanonical %}
  47.         <link rel="canonical" href="{{ furnitureType.getCanonical }}" />
  48.     {% else %}
  49.         {% if app.request.get('search') %}
  50.             {% if app.request.locale == 'pl' %}
  51.                 <link rel="canonical" href="https://www.centrumkrzesel.pl{{ path('furnitureType', {'furnitureTypeId':furnitureType.id, 'slug':furnitureType.slug}) }}" />
  52.             {% endif %}
  53.             {% if app.request.locale == 'cz' %}
  54.                 <link rel="canonical" href="https://www.ezidle.cz{{ path('furnitureType', {'furnitureTypeId':furnitureType.id, 'slug':furnitureType.slug}) }}" />
  55.             {% endif %}
  56.             {% if app.request.locale == 'sk' %}
  57.                 <link rel="canonical" href="https://www.stolicky24.sk{{ path('furnitureType', {'furnitureTypeId':furnitureType.id, 'slug':furnitureType.slug}) }}" />
  58.             {% endif %}
  59.             {% if app.request.locale == 'ro' %}
  60.                 <link rel="canonical" href="https://www.mobila24.ro{{ path('furnitureType', {'furnitureTypeId':furnitureType.id, 'slug':furnitureType.slug}) }}" />
  61.             {% endif %}
  62.         {% elseif app.request.attributes.get('customFilter') == '24h' %}
  63.             {% if app.request.locale == 'pl' %}
  64.                 <link rel="canonical" href="https://www.centrumkrzesel.pl{{ path('furnitureType', {'furnitureTypeId':furnitureType.id, 'slug':furnitureType.slug}) }}" />
  65.             {% endif %}
  66.             {% if app.request.locale == 'cz' %}
  67.                 <link rel="canonical" href="https://www.ezidle.cz{{ path('furnitureType', {'furnitureTypeId':furnitureType.id, 'slug':furnitureType.slug}) }}" />
  68.             {% endif %}
  69.             {% if app.request.locale == 'sk' %}
  70.                 <link rel="canonical" href="https://www.stolicky24.sk{{ path('furnitureType', {'furnitureTypeId':furnitureType.id, 'slug':furnitureType.slug}) }}" />
  71.             {% endif %}
  72.             {% if app.request.locale == 'ro' %}
  73.                 <link rel="canonical" href="https://www.mobila24.ro{{ path('furnitureType', {'furnitureTypeId':furnitureType.id, 'slug':furnitureType.slug}) }}" />
  74.             {% endif %}
  75.         {% endif %}
  76.     {% endif %}
  77. {% endblock %}
  78. {% block css %}
  79.     {{ parent() }}
  80.     <style>
  81.         /* Kolory w bocznym menu rozwijanym dzialaja, ale problem jest w tym ze input typu checkbox nie ma backgrounda i trzeba z osobna dodawac kazdy background image z kazdym kolorem/tkanina. Checkbox dodaje sie sam. Jezeli tkanina jest jasna, checkbox musi byc czarny*/
  82.         #kolory  label.kolor-czerowny:before {
  83.             background: url(/images/red-bg.png)center center no-repeat;
  84.         }
  85.         #kolory input[type=checkbox]:checked + label.kolor-czerowny:before {
  86.             background:url(/images/check.png)center center no-repeat, url(/images/red-bg.png)center center no-repeat;
  87.         }
  88.         #kolory  label.kolor-zielony:before {
  89.             background: url(/images/zielony-bg.png)center center no-repeat;
  90.         }
  91.         #kolory input[type=checkbox]:checked + label.kolor-zielony:before {
  92.             background:url(/images/check-czarny.png)center center no-repeat, url(/images/zielony-bg.png)center center no-repeat;
  93.         }
  94.         @media (min-width: 900px) {
  95.             #search_functions, #search_execution {
  96.                 height: 470px;
  97.                 overflow-y: auto;
  98.                 overflow-x: hidden;
  99.             }
  100.             .image img {
  101.                 width:auto;
  102.                 margin-left: auto;
  103.                 margin-right: auto;
  104.             }
  105.         }
  106.         #search_color .checkbox {
  107.             display: block;
  108.             position: relative;
  109.             padding-left: 35px;
  110.             margin-bottom: 12px;
  111.             cursor: pointer;
  112.             -webkit-user-select: none;
  113.             -moz-user-select: none;
  114.             -ms-user-select: none;
  115.             user-select: none;
  116.         }
  117.         /* Hide the browser's default checkbox */
  118.         #search_color .checkbox input {
  119.             position: absolute;
  120.             opacity: 0;
  121.             cursor: pointer;
  122.             height: 0;
  123.             width: 0;
  124.         }
  125.         /* Create a custom checkbox */
  126.         #search_color .checkmark {
  127.             position: absolute;
  128.             top: 0;
  129.             left: 0;
  130.             height: 22px;
  131.             width: 22px;
  132.             background-color: #ebebeb;
  133.         }
  134.         /* Create the checkmark/indicator (hidden when not checked) */
  135.         #search_color .checkmark:after {
  136.             content: "";
  137.             position: absolute;
  138.             display: none;
  139.         }
  140.         /* Show the checkmark when checked */
  141.         #search_color .checkbox input:checked ~ .checkmark:after {
  142.             display: block;
  143.         }
  144.         /* Style the checkmark/indicator */
  145.         #search_color .checkbox .checkmark:after {
  146.             left: 9px;
  147.             top: 5px;
  148.             width: 5px;
  149.             height: 10px;
  150.             border: solid white;
  151.             border-width: 0 3px 3px 0;
  152.             -webkit-transform: rotate(45deg);
  153.             -ms-transform: rotate(45deg);
  154.             transform: rotate(45deg);
  155.         }
  156.         /* MOBILE COLORS */
  157.         #search_colorMobile .checkbox {
  158.             display: block;
  159.             position: relative;
  160.             padding-left: 35px;
  161.             margin-bottom: 12px;
  162.             cursor: pointer;
  163.             -webkit-user-select: none;
  164.             -moz-user-select: none;
  165.             -ms-user-select: none;
  166.             user-select: none;
  167.         }
  168.         /* Hide the browser's default checkbox */
  169.         #search_colorMobile .checkbox input {
  170.             position: absolute;
  171.             opacity: 0;
  172.             cursor: pointer;
  173.             height: 0;
  174.             width: 0;
  175.         }
  176.         /* Create a custom checkbox */
  177.         #search_colorMobile .checkmark {
  178.             position: absolute;
  179.             top: 0;
  180.             left: 0;
  181.             height: 22px;
  182.             width: 22px;
  183.             background-color: #ebebeb;
  184.         }
  185.         /* Create the checkmark/indicator (hidden when not checked) */
  186.         #search_colorMobile .checkmark:after {
  187.             content: "";
  188.             position: absolute;
  189.             display: none;
  190.         }
  191.         /* Show the checkmark when checked */
  192.         #search_colorMobile .checkbox input:checked ~ .checkmark:after {
  193.             display: block;
  194.         }
  195.         /* Style the checkmark/indicator */
  196.         #search_colorMobile .checkbox .checkmark:after {
  197.             left: 9px;
  198.             top: 5px;
  199.             width: 5px;
  200.             height: 10px;
  201.             border: solid white;
  202.             border-width: 0 3px 3px 0;
  203.             -webkit-transform: rotate(45deg);
  204.             -ms-transform: rotate(45deg);
  205.             transform: rotate(45deg);
  206.         }
  207.     </style>
  208. {% endblock %}
  209. {% block javascripts %}
  210.     {{ parent() }}
  211.     <script>
  212.         $(document).ready(function () {
  213.             $('#search_sorting').on("change", function() {
  214.                 $('#submitButton').trigger("click");
  215.             });
  216.             $('.more-furniture-types').trigger("click");
  217.             if ($("#search_ergonomy > label").length <= 0) {
  218.                 $(".ergonomyElement").each(function() {
  219.                     $(this).hide();
  220.                 });
  221.             }
  222.             if ($("#search_functions > label").length <= 0) {
  223.                 $(".functionsElement").each(function() {
  224.                     $(this).hide();
  225.                 });
  226.             }
  227.             if ($("#search_execution > label").length <= 0) {
  228.                 $(".executionElement").each(function() {
  229.                     $(this).hide();
  230.                 });
  231.             }
  232.             {% if app.request.attributes.get('customFilter') == '24h' %}
  233.                 $('#search_availability_5').on("click", function() {
  234.                     if (!$(this).is(":selected")) {
  235.                         var url = $('#current_url').val();
  236.                         window.location.href = url;
  237.                         return;
  238.                     } else {
  239.                         var url = $('#current_url_24h').val();
  240.                         window.location.href = url;
  241.                         return;
  242.                     }
  243.                 });
  244.             {% else %}
  245.                 $('#search_availability_5').on("click", function() {
  246.                     if (!$(this).is(":selected")) {
  247.                         var url = $('#current_url_24h').val();
  248.                         window.location.href = url;
  249.                         return;
  250.                     } else {
  251.                         var url = $('#current_url').val();
  252.                         window.location.href = url;
  253.                         return;
  254.                     }
  255.                 });
  256.             {% endif %}
  257.             {% if app.request.attributes.get('customFilter') == '24h' %}
  258.                 $('#search_availability_5').prop("checked", true);
  259.             {% else %}
  260.             {% endif %}
  261.             $('.productsPerPage').on("change", function() {
  262.                 var productsPerPage = $(this).val();
  263.                 var url = $('#change_products_per_page_url').val();
  264.                 $.ajax({
  265.                     type: "POST",
  266.                     url: url,
  267.                     data: {'productsPerPage':productsPerPage},
  268.                     success: function (data) {
  269.                         window.location.reload();
  270.                     }
  271.                 });
  272.             });
  273.             $('#search_color label input').each(function() {
  274.                 var color = $(this).attr('color');
  275.                 $(this).parent().css("padding-top", "2px");
  276.                 if (color === '#ffffff' || color === '#FFFFFF') {
  277.                     $(this).next('span').css("border", '1px solid black');
  278.                 } else {
  279.                     $(this).next('span').css("background-color", color);
  280.                 }
  281.             });
  282.             $(document).on('click','.is-mobile',function(){
  283.                 $('#search_colorMobile label input').each(function() {
  284.                     var color = $(this).attr('color');
  285.                     $(this).parent().css("padding-top", "2px");
  286.                     if (color === '#ffffff' || color === '#FFFFFF') {
  287.                         $(this).next('span').css("border", '1px solid black');
  288.                     } else {
  289.                         $(this).next('span').css("background-color", color);
  290.                     }
  291.                 });
  292.             });
  293.         });
  294.     </script>
  295. {% endblock %}
  296. {% block content %}
  297.     <input type="hidden" id="current_url" value="{{ path('furnitureType', {'furnitureTypeId':furnitureType.id, 'slug':furnitureType.slug}) }}"/>
  298.     <input type="hidden" id="current_url_24h" value="{{ path('furnitureType', {'furnitureTypeId':furnitureType.id, 'customFilter':'24h', 'slug':furnitureType.slug}) }}"/>
  299.     <input type="hidden" id="change_products_per_page_url" value="{{ path('change_products_per_page') }}"/>
  300.     <!-- START OF CATEGORY NAME SECTION -->
  301.     <section class="section">
  302.         <div class="container" style="margin-top:-30px;">
  303.             <div class="columns is-multiline">
  304.                 <div class="column is-full">
  305.                     <h1 class="is-size-2 ">{{ furnitureType.name }} <span class="has-text-grey-light is-size-2">({{ products.getTotalItemCount() }})</span></h1>
  306.                 </div>
  307.                 <!-- START OF BREADCRUMBS -->
  308.                 <div class="no-top-padding column is-full">
  309.                     <nav class="breadcrumb has-arrow-separator" aria-label="breadcrumb">
  310.                         <ul vocab="https://schema.org/" typeof="BreadcrumbList">
  311.                             <li property="itemListElement" typeof="ListItem">
  312.                                 <a property="item" typeof="WebPage" href="{{ path('homepage') }}">{{ language.shopName }}</a>
  313.                                 <meta property="position" content="1">
  314.                             </li>
  315.                             <li class="is-active" property="itemListElement" typeof="ListItem">
  316.                                 <a property="item" typeof="WebPage">{{ furnitureType.name }}</a>
  317.                                 <meta property="position" content="2">
  318.                             </li>
  319.                         </ul>
  320.                     </nav>
  321.                 </div>
  322.                 <!-- END OF BREADCRUMBS -->
  323.             </div>
  324.         </div>
  325.     </section>
  326.     <!-- END OF CATEGORY NAME SECTION -->
  327.     <!-- START OF MAIN SECTION -->
  328.     {{ form_start(form, {'attr': {'method':'get', 'role':'form', 'novalidate': 'novalidate'}}) }}
  329.     <section class="section remove-padding-top">
  330.         <div class="container">
  331.             <div class="columns" style="margin-top:-30px;">
  332.                 {% include 'frontend/category/_leftSidebar.html.twig' %}
  333.                 <div class="columns is-multiline lista-produktow" v-match-heights="{ el: [ '.with-description' ] }">
  334.                     {% if products.getTotalItemCount == 0 %}
  335.                         <div style="text-align: center; width:100%; padding:40px;">
  336.                             <i class="fa fa-search-minus" style="font-size:40px; font-weight: bold; padding:20px;"></i>
  337.                             <br/>
  338.                             {{ 'no_results_category'|trans }}
  339.                         </div>
  340.                     {% else %}
  341.                         {% for productData in products %}
  342.                             {% set product = productData[0] %}
  343.                             {% include 'frontend/components/smallProduct.html.twig' with {'isOneThird':1, 'product':product, 'productData':productData} %}
  344.                         {% endfor %}
  345.                     {% endif %}
  346.                 </div>
  347.             </div>
  348.             <!-- END OF PRODUCT LIST -->
  349.         </div>
  350.         <div class="level-right">
  351.             <div class="level-item">
  352.                 {{ knp_pagination_render(products) }}
  353.             </div>
  354.         </div>
  355.     </section>
  356.     {{ form_end(form) }}
  357.     <!-- END OF MAIN SECTION -->
  358.     {% include 'frontend/category/_lastViewed.html.twig' %}
  359.     {% if furnitureType.getDescription and (app.request.query.get('page') == 1 or app.request.query.get('page') == null) %}
  360.         <div class="section">
  361.             <div class="container">
  362.                 <div id="js_cat-desc-content">
  363.                     <div class="cat-desc-excerpt ellipsis">
  364.                         {{ furnitureType.getDescription|raw }}
  365.                     </div>
  366.                     <a class="dotted-link read-more" style="margin-top:10px; float:right;" data-target="js_cat-desc-content" role="button">{{ 'read_more'|trans }}...</a>
  367.                 </div>
  368.             </div>
  369.         </div>
  370.     {% endif %}
  371. {% endblock %}