templates/eshopBase.html.twig line 1

Open in your IDE?
  1. <!DOCTYPE html>
  2. <html lang="{{ app.request.locale }}">
  3.     <head>
  4.         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5.         {% set seoTitle = '' %}
  6.         {% if seoData.seoTitle is defined and seoData.seoTitle != '' %}
  7.             {% set seoTitle = seoData.seoTitle %}
  8.         {% endif %}
  9.         <title>{{ seoTitle }}</title>
  10.         {% set seoDescription = '' %}
  11.         {% if seoData.seoDescription is defined and seoData.seoDescription != '' %}
  12.             {% set seoDescription = seoData.seoDescription %}
  13.         {% endif %}
  14.         <meta name="description" content="{{ seoDescription }}">
  15.         <meta name="viewport" content="width=device-width, initial-scale=1">
  16.         <script src="{{ asset('assets/vendor/jquery/jquery.min.js') }}"></script>
  17.         <script src="{{ asset('assets/vendor/jquery.cycle.all.js') }}"></script>
  18.         <script language="JavaScript" src="{{ asset('assets/js/am.js') }}"></script>
  19.         <script src="https://www.google.com/recaptcha/api.js" async defer></script>
  20.         <!-- <script type='text/javascript' src='/assets/x3dom/x3dom.js'> </script>-->
  21.         
  22.         <!-- <script src="https://www.paypal.com/sdk/js?client-id=YOUR_CLIENT_ID"></script> -->
  23.         
  24.         <link href='https://fonts.googleapis.com/css?family=Almendra' rel='stylesheet'>
  25. {#        <?php $view['slots']->output('head'''?>#}
  26.         {% if eshop.eshopCss is defined and eshop.eshopCss != '' %}
  27.             {% set css = asset('css/' ~ eshop.eshopCss) %}
  28.         {% else %}
  29.             {% set css = asset('css/demo_standard.css') %}
  30.         {% endif %}
  31.         {% set flagImage = asset('images/flag_round_' ~ app.session.get('lang').langKey ~ '.png') %}
  32.         <link rel="stylesheet" href="{{ css }}" />
  33.     <script>
  34.         //resize x3d scene
  35.     $(document).ready(function() {
  36.       var $win = $(window);
  37.       var $discountHeight = 96;
  38.       $('#button_fullscreen').click(function() {
  39.         $('#x3d').animate({
  40.             height: ($win.height() - $discountHeight),
  41.             width: $win.width()
  42.         }, 500);
  43.         $('#x3d_section').animate({
  44.             height: ($win.height() - $discountHeight),
  45.             width: $win.width()
  46.         }, 500);
  47.         $('#x3dom-x3d_section-canvas').animate({
  48.             height: ($win.height() - $discountHeight),
  49.             width: '100%'
  50.         }, 500);     
  51.         $("#x3d_section").attr("height",($win.height() - $discountHeight));
  52.       });
  53.       
  54.       $('#button_defaultscreen').click(function() {
  55.         $('#x3d').animate({
  56.             height: "323px",
  57.             width: '100%'
  58.         }, 500);
  59.         $('#x3d_section').animate({
  60.           height: "323px",
  61.           width: '100%'
  62.         }, 500);      
  63.         $('#x3dom-x3d_section-canvas').animate({
  64.           height: "323px",
  65.           width: '100%'
  66.         }, 500);        
  67.         $("#x3d_section").attr("height","323px");  
  68.       });
  69.           
  70.       $('#button_product_detail_close').click(function() {
  71.         $('#x3d_product_detail').animate({
  72.           width: 0
  73.         }, 500);
  74.       });
  75.       $('#button_product_detail_close2').click(function() {
  76.         $('#x3d_product_detail').animate({
  77.           width: 0
  78.         }, 500);
  79.       });        
  80.       $('#x3d_button_addcart').click(function() {
  81.         $('#x3d_info_message').animate({
  82.           height: 35
  83.         }, 500);
  84.       });        
  85.       $('#x3d_info_message_close').click(function() {
  86.         $('#x3d_info_message_text').text('');   
  87.         $('#button_info_message_close').hide();
  88.         $('#infoMessageTable').hide();  
  89.         $('#infoMessageWrapper').hide();         
  90.         $('#x3d_info_message').animate({
  91.           height: 0
  92.         }, 500);  
  93.       });  
  94.       $('#x3d_quick_basket_close').click(function() {     
  95.         $('#x3d_quick_basket').animate({
  96.           height: 0
  97.         }, 500);
  98.       });       
  99.       $('#basketPanel').mouseover(function() {
  100.         $('#x3d_quick_basket').animate({
  101.           height: 150
  102.         }, 500);
  103.         $('#quickBasketTable').show();  
  104.         $('#x3d_quick_basket_close').show();
  105.         var full_url = document.URL; 
  106.         //var shopId = full_url.substring(full_url.lastIndexOf('/') + 1);
  107.         getQuickBasket({{ eshop.eshopId }});
  108.       });
  109.       $('#x3d_quick_basket').mouseleave(function() {
  110.         $('#x3d_quick_basket').animate({
  111.           height: 0
  112.         }, 500);
  113.         $('#quickBasketTable').hide();  
  114.       });    
  115.       $('#button_item_detail_close').click(function() {
  116.         $('#x3d_item_detail').animate({
  117.           width: 0
  118.         }, 500);
  119.       });
  120.       $('#button_item_detail_close2').click(function() {
  121.         $('#x3d_item_detail').animate({
  122.           width: 0
  123.         }, 500);
  124.       });     
  125.       $("#image_view_full").click( function() {
  126.           var modal = document.getElementById("myModal");
  127.           // Get the image and insert it inside the modal - use its "alt" text as a caption
  128.           var img = document.getElementById("image_view_full");
  129.           var modalImg = document.getElementById("img_modal");
  130.           var captionText = document.getElementById("caption");
  131.           //modal.show();
  132.           modal.style.display = "block";
  133.           modalImg.src = this.src;
  134.           captionText.innerHTML = this.alt;
  135.           // Get the <span> element that closes the modal
  136.           var span = document.getElementById("img_modal_close");
  137.           // When the user clicks on <span> (x), close the modal
  138.           span.onclick = function() { 
  139.             modal.style.display = "none";
  140.           }
  141.       });
  142.       
  143.       $(".galleryItemImage").click( function() {
  144.           var modal = document.getElementById("myModal");
  145.           // Get the image and insert it inside the modal - use its "alt" text as a caption
  146.           var img = document.getElementById("image_view_full");
  147.           var modalImg = document.getElementById("img_modal");
  148.           var captionText = document.getElementById("caption");
  149.           //modal.show();
  150.           modal.style.display = "block";
  151.           modalImg.src = this.src;
  152.           captionText.innerHTML = this.alt;
  153.           // Get the <span> element that closes the modal
  154.           var span = document.getElementById("img_modal_close");
  155.           // When the user clicks on <span> (x), close the modal
  156.           span.onclick = function() { 
  157.             modal.style.display = "none";
  158.           }
  159.       });
  160.     });
  161.     $(document).keydown(function(event) { 
  162.       if (event.keyCode == 27) { 
  163.         var modal = document.getElementById("myModal");
  164.         modal.style.display = "none";
  165.       }
  166.     })
  167.     function getQuickBasket(eshopId) 
  168.     {
  169.       //alert('getQuickBasket 23: ' + eshopId);
  170.       
  171.       var xmlhttp = new XMLHttpRequest();
  172.       //var url = '/app_dev.php/api/eshop/' + eshopId + '/product/' + productId;
  173.       
  174.       if (window.location.toString().indexOf('app_dev.php') !== -1) {
  175.         var url = '/app_dev.php/api/eshop/' + eshopId + '/getbasket';
  176.       } else {
  177.         var url = '/api/eshop/' + eshopId + '/getbasket';
  178.       }
  179.       //alert('getProductDetail url: ' + url);
  180.       console.log('getQuickBasket 01: ', url);
  181.       
  182.       var productName = '';
  183.       xmlhttp.open('GET', url);
  184.       xmlhttp.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
  185.       //alert('getProductDetail 25: ' + eshopId);
  186.       xmlhttp.onprogress = function () {
  187.         console.log('LOADING: ', xmlhttp.status);
  188.       };
  189.       xmlhttp.onload = function () {
  190.         console.log('DONE: ', xmlhttp.status);
  191.       };        
  192.       //alert('QQW-118 xmlhttp.status: ' + xmlhttp.status);
  193.       console.log('QQW-118 getQuickBasket 02 status: ', xmlhttp.status);
  194.       xmlhttp.onreadystatechange = function() {//Call a function when the state changes.
  195.           //alert('getQuickBasketDetail 108 :: eshopId: ' + eshopId);
  196.           console.log('QQW-119 getQuickBasket 03 eshopId: ', eshopId);
  197.           if(xmlhttp.readyState == 4 && xmlhttp.status == 200) {
  198.               alert('response 117: ' +xmlhttp.responseText);
  199.               var responseData = JSON.parse(xmlhttp.responseText);
  200.               basketItems = responseData.basketItems;
  201.               console.log('responseText: ', xmlhttp.responseText);
  202.               //productInfo = productData.product;
  203.               //productName = productInfo.productName;
  204.               //alert('window.location: ' + window.location + " :: url: " + url);
  205.               $('#x3d_quick_basket_text').html("");
  206.               for (let index = 0; index < basketItems.length; ++index) {
  207.                   const element = basketItems[index];
  208.                   console.log('element: ', element);
  209.                   $('#x3d_quick_basket_text').append('<div class="quickBasketRow">'
  210.                                                     +'<span class="quickBasketName">'+element.title+'</span>'
  211.                                                     +'<span class="quickBasketUnits">'+element.units+'</span>'
  212.                                                     +'<span class="quickBasketPrice">'+element.price+'</span>'
  213.                                                     +'</div>');
  214.                 }
  215.               //$('#x3d_quick_basket_text').text('basket content ...');
  216.           }
  217.       }
  218.       //alert('getProductDetail 27: ' + eshopId);
  219.     }          
  220.     </script>
  221.     </head>
  222.     <body>
  223.         {% for message in app.flashes('notice') %}
  224.             <div class="flash-notice">
  225.                 <div class='notice'>{{ message|raw }}</div>
  226.             </div>
  227.         {% endfor %}
  228.         {% for message in app.flashes('error') %}
  229.             <div class="flash-error">
  230.                 <div class='error'>{{ message|raw }}</div>
  231.             </div>
  232.         {% endfor %}
  233.         <!-- result info message -->
  234.         <div style="position: fixed; top: 0em; width: 100%; height: 0px; display:block; border-bottom: 1px solid #EFEFEF; background-color: Gray; opacity: 0.95; text-align:center; font-family: helvetica, sans-serif; font-weight: bold; font-size: 10px; color: #FFF; padding-top:0px; z-index: 177; " id="x3d_info_message">
  235.             <div style="width: 100%; border-bottom: 3px solid Green; display: none;" id="infoMessageWrapper">
  236.               <table border='0' id='infoMessageTable' class='infoMessageTable' align="center" cellpadding='0' cellspacing='0' style="display: none;">
  237.                 <tr>
  238.                   <td valign='top'>
  239.                   </td>
  240.                   <td valign='top'> 
  241.                       <div id="x3d_info_message_text" style="font-weight: bold; font-size: 16px; margin-top: 7px; margin-left:5px"></div>
  242.                   </td>
  243.                   <td valign='top'> 
  244.                       <div id="x3d_info_message_cart_link" style="font-weight: normal; font-size: 16px; margin-top: 4px; margin-left:5px">
  245.                         <button id="button_info_message_cart_button" style="font-family: helvetica, sans-serif; font-weight: bold; font-size: 12px; background-color: Gray; border: 1px solid #111; color: white;margin-left:12px; background-size: 25px 25px; height: 27px; width: 127px; margin-top: 2px; display: block" title="Go to Basket" VALUE="x" onclick="window.location.href='/eshop/{{ eshop.eshopId }}/basket';">{{ 'eshop.go_to_basket'|trans }}</button>
  246.                       </div>
  247.                   </td>                 
  248.                   <td valign='top'> 
  249.                       <div style="margin-top:2px; text-align: left; float: left;" id="x3d_info_message_close">
  250.                       <button id="button_info_message_close" style="font-family: helvetica, sans-serif; font-size: 12px; font-weight: bold; background-color: Gray; border: 1px solid #111; color: white ;margin-left:12px; background-size: 25px 25px; height: 27px; width: 27px; margin-top: 2px; display: none" title="close" VALUE="x">x</button>
  251.                       </div>  
  252.                   </td>                       
  253.                 </tr>
  254.               </table>    
  255.             </div>
  256.         </div>  
  257.       <!-- The Modal -->
  258.       <div id="myModal" style="display: none; position: fixed; z-index: 1; padding-top: 100px; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgb(0,0,0); background-color: rgba(0,0,0,0.8);">
  259.         <span id="img_modal_close" style="position: absolute; top: 35px; right: 45vw; color: #f1f1f1; font-size: 40px; font-weight: bold; transition: 0.3s;">&times;</span>
  260.         <img id="img_modal" style="margin: auto; display: block; width: 80%; max-width: 700px; animation-name: zoom; animation-duration: 0.6s;-webkit-animation-name: zoom; -webkit-animation-duration: 0.6s;transition: 0.5s;">
  261.         <div id="caption" style="margin: auto; display: block; width: 80%; max-width: 700px; text-align: center; color: #ccc; padding: 10px 0; height: 150px; animation-name: zoom; animation-duration: 0.6s;-webkit-animation-name: zoom; -webkit-animation-duration: 0.6s;transition: 0.5s;"></div>
  262.       </div>
  263.     
  264.         <div class="content">
  265.             {% block content %}{% endblock %}
  266.       </div>
  267.           <!-- quick basket  -->
  268.         <div style="position: absolute; top: 0px; width: 50%; height: 0px; display:block; background-color: Gray; opacity: 0.95; text-align:center; font-family: helvetica, sans-serif; font-weight: bold; font-size: 10px; color: #FFF; padding-top:0px; z-index: 1; margin-left: auto; margin-right: auto;" class="x3d_quick_basket" id="x3d_quick_basket">
  269.           <table border='0' id='quickBasketTable' class='quickBasketTable' align="center" cellpadding='0' cellspacing='0' style="display: none">
  270.            
  271.             <tr>
  272.               <td valign='top'>
  273.                 <div id="x3d_quick_basket_title" style="font-weight: normal; font-size: 16px; margin-top: 7px; margin-left:5px"><h4>{{ 'eshop.basket_quick'|trans }}</h4></div>
  274.               </td>
  275.             </tr>                       
  276.             <tr>
  277.               <td valign='top'>
  278.                 <div id="x3d_quick_basket_text" style="font-weight: normal; font-size: 16px; margin-top: 7px; margin-left:5px"></div>
  279.               </td> 
  280.             </tr> 
  281.             <tr>          
  282.               <td valign='top'>
  283.                 <div style="margin-top:1px; display: inline-block; text-align: left; float: left;" id="x3d_quick_basket_open">
  284.                 <button id="button_quick_basket_open" style="font-family: helvetica, sans-serif; font-weight: bold; font-size: 12px; background-color: Gray; border: 1px solid #111; color: white; margin-left:12px; background-size: 25px 25px; height: 27px; width: 150px; margin-top: 2px" title="Go to Basket" value="Go to Basket" onclick="window.location.href='/eshop/{{ eshop.eshopId }}/basket';">{{ 'eshop.go_to_basket'|trans }}</button>
  285.                 </div>                 
  286.                 <div style="margin-top:1px;text-align: left; display: inline-block; float: left; " id="x3d_quick_basket_close">
  287.                 <button id="button_quick_basket_close" style="font-family: helvetica, sans-serif; font-weight: bold; font-size: 12px; background-color: Gray; border: 1px solid #111; color: white; margin-left:12px; background-size: 25px 25px; height: 27px; width: 27px; margin-top: 2px" title="close quick basket panel" value="x">x</button>
  288.                 </div>  
  289.               </td>             
  290.             </tr>
  291.           </table>    
  292.         
  293.           </div>                        
  294.                 
  295.     </body>
  296. </html>