Перейти до вмісту
Пошук в
  • Детальніше...
Шукати результати, які ...
Шукати результати в ...

Долго грузит страница с контактами


Ch0oJoy

Recommended Posts

Добрый день! Подскажите пожалуйста почему долго грузится страница с контактами, многие посетители жалуются. 

https://alishop.kiev.ua/contact

Подскажите в чем может быть проблема.

Надіслати
Поділитися на інших сайтах


14 минут назад, smartcoder сказал:

И яндекс и гугл карты сразу грузятся, наверное что-то одно надо оставить?

яндекс полностью отключил в админке, его можно как-то убрать с этой страницы? 

 

Надіслати
Поділитися на інших сайтах


7 минут назад, deim сказал:

Может в коде шаблона?

Подскажите пожалуйста что здесь удалить

{{ header }}
<div id="information-contact" class="container">
   <ul class="breadcrumb">
      {% for breadcrumb in breadcrumbs %}
      <li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
      {% endfor %}
   </ul>
   <h1 class="m-t-0 m-b-3 h3 custom-title">{{ heading_title }}</h1>
   {{ content_top }}
   <div id="content">
      {% if geocode and map_status %}
      <div>
         <div id="map" style=" height: 245px;"></div>
      </div>
      {% endif %}
      <div class="content-default flexbox-xs-out m-b-3-xs-out btn-block-xs">
         {{ column_left }}
         {% if column_left and column_right %}
         {% set class = 'col-sm-6' %}
         {% elseif column_left or column_right %}
         {% set class = 'col-sm-9' %}
         {% else %}
         {% set class = 'col-xs-12 col-sm-12' %}
         {% endif %}
         <div  class="{{ class }}">
            <div class="row">
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d349.57138396005075!2d30.522173976583332!3d50.45419637160626!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x0%3A0xd26969a28559f84b!2zQWxpU2hvcCAtIFZhcGUgU2hvcCAo0LzQsNCz0LDQt9C40L0g0Y3Qu9C10LrRgtGA0L7QvdC90YvRhSDRgdC40LPQsNGA0LXRgik!5e0!3m2!1sru!2sua!4v1544439555680" width="100%" height="270" frameborder="0" style="border:0" allowfullscreen></iframe>
               <div class="content-default flexbox-xs-out">
                  <div class="block-center btn-block f-w-5 text">
                     <div class="row">
                        <div class="col-sm-3 p-t-3">
                           <div class="icon-contact"><i class="icon icon-info-point"></i></div>
                           <div class="m-b-3 p-b-3">
                              <div class="box-title f-s-5">{{ text_location }}:</div>
                              <div class="m-t f-s-3 m-b">
                                 <span>{{ address }}</span> 
                              </div>
                              {% if geocode and map_status %}
                              <i class="fa fa-map-marker marker-map"></i><a class="cursor-p f-s-3" onclick="getPoint('0')">{{ button_map }}</a>
                              {% endif %}
                           </div>
                        </div>
                        
                        <div class="col-sm-3 p-t-3">
                           <div class="icon-contact"><i class="icon icon-info-telephone"></i></div>
                           <div class="m-b-3 p-b-3">
                              <div class="box-title f-s-5">{{ text_telephone }}:</div>
                              <div class="m-t f-s-3">
                                 <div><a href="tel:{{ telephone|replace({' ': ''}) }}" title="{{ telephone }}" class="text-base"><strong>{{ telephone }}</strong></a></div>
								<div> <a class="text-base" title="+38(068)118-17-15" href="tel:+38 (068) 118-17-15"><strong> +38 (068) 118-17-15</strong></a></div>
                              </div>
                              {% if fax %}
                              <div class="box-title f-s-5 m-t-2">{{ text_fax }}:</div>
                              <div class="m-t f-s-3">
                                 <span>{{ fax }}</span>
                              </div>
                              {% endif %}
                           </div>
                        </div>
                        <div class="col-sm-3 p-t-3">
                           <div class="icon-contact"><i class="icon icon-info-mail"></i></div>
                           <div class="m-b-3 p-b-3">
                              <div class="box-title f-s-5">{{ text_email }}:</div>
                              <div class="m-t f-s-3">
                                 <a style="text-decoration: underline;" href="mailto:{{ email_store|replace({' ': ''}) }}">{{ email_store }}</a> 
                              </div>
                           </div>
                        </div>
                        <div class="col-sm-3 p-t-3">
                           <div class="icon-contact"><i class="icon icon-info-clock-white"></i></div>
                           <div class="m-b-3 p-b-3">
                              <div class="box-title f-s-5">{{ text_open }}:</div>
                              <div class="m-t f-s-3">
                                 <span>{{ open }}</span> 
                              </div>
                              {% if comment %}
                              <div class="box-title f-s-5 m-t-2">{{ text_comment }}:</div>
                              <div class="m-t f-s-3">
                                 <span>{{ comment }}</span>
                              </div>
                              {% endif %}
                           </div>
                        </div>
                     </div>
                     <hr>
                     <div class="row">
                        <div class="col-xs-12 col-sm-12 col-md-8 col-lg-6 m-t-2">
                           <h3 class="m-b-3 h4">{{ text_contact }}</h3>
                           <form id="form-contact" method="post" enctype="multipart/form-data">
                              <div class="row">
                                 <div class="col-xs-12 col-sm-6 m-b">
                                    <div class="form-group required">
                                       <label class="control-label" for="input-name">{{ entry_name }}</label>
                                       <input type="text" name="name"  id="input-name" class="form-control" />
                                       <div id="error-name-contact-form" style="display:none"></div>
                                    </div>
                                 </div>
                                 <div class="col-xs-12 col-sm-6 m-b">
                                    <div class="form-group required">
                                       <label class=" control-label" for="input-email">{{ entry_email }}</label>
                                       <input type="text" name="email"  id="input-email" class="form-control" />
                                       <div id="error-email-contact-form" style="display:none">
                                       </div>
                                    </div>
                                 </div>
                                 <div class="col-xs-12 col-sm-12 m-b">
                                    <div class="form-group required">
                                       <label class=" control-label" for="input-subject">{{ entry_subject }}</label>
                                       <input type="text" name="subject" value="" id="input-subject" class="form-control" />
                                       <div id="error-subject-contact-form" style="display:none"></div>
                                    </div>
                                 </div>
                              </div>
                              <div class="form-group m-b-2 required">
                                 <label class="control-label" for="input-enquiry">{{ entry_enquiry }}</label>
                                 <textarea name="enquiry" rows="5" id="input-enquiry" class="form-control"></textarea>
                                 <div id="error-enquiry-contact-form" style="display:none"></div>
                              </div>
                              <div class="clearfix">
                                 <div class="pull-left">
                                    {{ captcha }}
                                 </div>
                              </div>
                              <div class="buttons">
                                 <div class="pull-left btn-block-xs">
                                    <button class="btn btn-primary btn-lg btn-block-xs" id="button-send">{{ button_submit }}</button>
                                 </div>
                              </div>
                           </form>
                        </div>
                        {% if locations %}
                        <div class="col-sm-6 m-t-2">
                           <h3 class="m-b h4">{{ text_store }}</h3>
                           <div class="panel-group" id="accordion">
                              {% for location in locations %}
                              <div class="panel p-t p-b">
                                 <div>
                                    <h4><a href="#collapse-location{{ location.location_id }}" class="accordion-toggle text-base" data-toggle="collapse" data-parent="#accordion">{{ location.name }} <i class="fa fa-caret-down"></i></a></h4>
                                 </div>
                                 <div class="panel-collapse collapse" id="collapse-location{{ location.location_id }}">
                                    <div class="p-t p-b">
                                       <div class="row">
                                          {% if location.image %}
                                          <div class="col-sm-2"><img src="{{ location.image }}" alt="{{ location.name }}" title="{{ location.name }}" class="img-thumbnail" /></div>
                                          {% endif %}
                                          <div class="col-sm-4">
                                             <strong>{{ location.name }}</strong><br />
                                             <address>
                                                {{ location.address }}
                                             </address>
                                             {% if location.geocode and map_status %}
                                             <i class="fa fa-map-marker marker-map"></i><a class="cursor-p" onclick="getPoint('{{ location.location_id }}')">{{ button_map }}</a>
                                             {% endif %}
                                          </div>
                                          <div class="col-sm-3"> <strong>{{ text_telephone }}</strong><br>
                                             {{ location.telephone }}<br />
                                             <br />
                                             {% if location.fax %}
                                             <strong>{{ text_fax }}</strong><br>
                                             {{ location.fax }}
                                             {% endif %}
                                          </div>
                                          <div class="col-sm-3">
                                             {% if location.open %}
                                             <strong>{{ text_open }}</strong><br />
                                             {{ location.open }}<br />
                                             <br />
                                             {% endif %}
                                             {% if location.comment %}
                                             <strong>{{ text_comment }}</strong><br />
                                             {{ location.comment }}
                                             {% endif %}
                                          </div>
                                       </div>
                                    </div>
                                 </div>
                              </div>
                              {% endfor %}
                           </div>
                        </div>
                        {% endif %}
                     </div>
                  </div>
               </div>
            </div>
         </div>
         {{ column_right }}  
      </div>
      {{ content_bottom }}
   </div>
</div>
<script>
   function getPoint(mobject) {
   locationsMap.setCenter(objectManager.objects.getById(mobject).geometry.coordinates, 15, {
   });
   fullscreenControl.enterFullscreen();
   objectManager.objects.balloon.open(mobject);
   return false;
   };
</script>
{% if geocode and map_status %}
<script type="text/javascript"><!--
   $('#button-send').on('click', function() {
      $.ajax({
          url: 'index.php?route=information/contact/send',
          type: 'post',
          dataType: 'json',
          data: $("#form-contact").serialize(),
          beforeSend: function() {
              $('#button-send').button('loading');
          },
          complete: function() {
              $('#button-send').button('reset');
          },
          success: function(json) {
              ClearError();
              if (json['error']) {
               if (json['warning_notification']) {
        ErrorAlertFixed(json['warning_notification']);
   	 	 }
                  $.each(json['error'], function(i, item) {
                      var input = $('#form-contact #error-' + i + '-contact-form');
                      ErrorAlert(input, item)
                  });
                  if (json['error']['captcha']) {
   	                ErrorCaptcha($('#form-contact .error-captcha'), json['error']['captcha'])
                   
                  }
              }
              if (json['success']) {
                  $('#form-contact').html('<div class="alert alert-success m-b-0"><div><i class="fa fa-check-circle f-s-5 m-r"></i><span class="success f-s-3 f-w-5">' + json['success']['message'] + '</span></div></div>');
                  $('input[name=\'name\']').val('');
                  $('input[name=\'email\']').val('');
                  $('input[name=\'subject\']').val('');
                  $('textarea[name=\'enquiry\']').val('');
              }
          }
      });
      return false;
   });
   var locationsMap = false;
   
   function mapinit() {
      locationsMap = new ymaps.Map('map', {
              center: [{{ geocode }}],
              zoom: 13,
              controls: ['geolocationControl']
          }, {
    
              searchControlProvider: 'yandex#search'
          }),
   
    // Создание макета балуна на основе Twitter Bootstrap.
        MyBalloonLayout = ymaps.templateLayoutFactory.createClass(
            '<div class="popover top">' +
                '<a class="close" href="#">&times;</a>' +
                '<div class="arrow"></div>' +
                '<div class="popover-inner">' +
                '$[[options.contentLayout observeSize minWidth=200 maxWidth=650 maxHeight=350]]' +
                '</div>' +
                '</div>', {
                /**
                 * Строит экземпляр макета на основе шаблона и добавляет его в родительский HTML-элемент.
                 * @see https://api.yandex.ru/maps/doc/jsapi/2.1/ref/reference/layout.templateBased.Base.xml#build
                 * @function
                 * @name build
                 */
                build: function () {
                    this.constructor.superclass.build.call(this);
   
                    this._$element = $('.popover', this.getParentElement());
   
                    this.applyElementOffset();
   
                    this._$element.find('.close')
                        .on('click', $.proxy(this.onCloseClick, this));
                },
   
                /**
                 * Удаляет содержимое макета из DOM.
                 * @see https://api.yandex.ru/maps/doc/jsapi/2.1/ref/reference/layout.templateBased.Base.xml#clear
                 * @function
                 * @name clear
                 */
                clear: function () {
                    this._$element.find('.close')
                        .off('click');
   
                    this.constructor.superclass.clear.call(this);
                },
   
                /**
                 * Метод будет вызван системой шаблонов АПИ при изменении размеров вложенного макета.
                 * @see https://api.yandex.ru/maps/doc/jsapi/2.1/ref/reference/IBalloonLayout.xml#event-userclose
                 * @function
                 * @name onSublayoutSizeChange
                 */
                onSublayoutSizeChange: function () {
                    MyBalloonLayout.superclass.onSublayoutSizeChange.apply(this, arguments);
   
                    if(!this._isElement(this._$element)) {
                        return;
                    }
   
                    this.applyElementOffset();
   
                    this.events.fire('shapechange');
                },
   
                /**
                 * Сдвигаем балун, чтобы "хвостик" указывал на точку привязки.
                 * @see https://api.yandex.ru/maps/doc/jsapi/2.1/ref/reference/IBalloonLayout.xml#event-userclose
                 * @function
                 * @name applyElementOffset
                 */
                applyElementOffset: function () {
                    this._$element.css({
                        left: -(this._$element[0].offsetWidth / 2),
                        top: -(this._$element[0].offsetHeight + this._$element.find('.arrow')[0].offsetHeight)
                    });
                },
   
                /**
                 * Закрывает балун при клике на крестик, кидая событие "userclose" на макете.
                 * @see https://api.yandex.ru/maps/doc/jsapi/2.1/ref/reference/IBalloonLayout.xml#event-userclose
                 * @function
                 * @name onCloseClick
                 */
                onCloseClick: function (e) {
                    e.preventDefault();
   
                    this.events.fire('userclose');
                },
   
                /**
                 * Используется для автопозиционирования (balloonAutoPan).
                 * @see https://api.yandex.ru/maps/doc/jsapi/2.1/ref/reference/ILayout.xml#getClientBounds
                 * @function
                 * @name getClientBounds
                 * @returns {Number[][]} Координаты левого верхнего и правого нижнего углов шаблона относительно точки привязки.
                 */
                getShape: function () {
                    if(!this._isElement(this._$element)) {
                        return MyBalloonLayout.superclass.getShape.call(this);
                    }
   
                    var position = this._$element.position();
   
                    return new ymaps.shape.Rectangle(new ymaps.geometry.pixel.Rectangle([
                        [position.left, position.top], [
                            position.left + this._$element[0].offsetWidth,
                            position.top + this._$element[0].offsetHeight + this._$element.find('.arrow')[0].offsetHeight
                        ]
                    ]));
                },
   
                /**
                 * Проверяем наличие элемента (в ИЕ и Опере его еще может не быть).
                 * @function
                 * @private
                 * @name _isElement
                 * @param {jQuery} [element] Элемент.
                 * @returns {Boolean} Флаг наличия.
                 */
                _isElement: function (element) {
                    return element && element[0] && element.find('.arrow')[0];
                }
            }),
   
    // Создание вложенного макета содержимого балуна.
        MyBalloonContentLayout = ymaps.templateLayoutFactory.createClass(
            '<h3 class="popover-title">$[properties.balloonContentHeader]</h3>' +
                '<div class="popover-content border-0">$[properties.balloonContent]</div>'
        ),
          objectManager = new ymaps.ObjectManager({
              clusterize: true,
              gridSize: 68
          });
    
    		  fullscreenControl = new ymaps.control.FullscreenControl();
    locationsMap.controls.add(fullscreenControl);
      objectManager.clusters.options.set({
          preset: 'islands#ClusterIcons',
          clusterIconColor: '#fd3c44'
      });
      locationsMap.geoObjects.add(objectManager);
   
      $.ajax({
          url: "index.php?route=information/contact/getMapsData",
          type: "post",
          dataType: "json",
      }).done(function(data) {
          objectManager.add(data);
          objectManager.objects.options.set({
     balloonShadow: false,
            balloonLayout: MyBalloonLayout,
            balloonContentLayout: MyBalloonContentLayout,
      });
    {% if locations %}
          locationsMap.setBounds(objectManager.getBounds(), {
     checkZoomRange: true,
              zoomMargin: 50
          });
   {% endif %}
      });
   
   
   }
   
   ymaps.ready(mapinit);
   $(window).resize(function() {
      if (locationsMap) {
          locationsMap.container.fitToViewport();
      }
   });
   //-->
</script>
{% endif %}
{{ footer }}

 

Надіслати
Поділитися на інших сайтах


1 час назад, Ch0oJoy сказал:

 

50 минут назад, smartcoder сказал:

И яндекс и гугл карты сразу грузятся, наверное что-то одно надо оставить?

Все сервисы яндекса заблокированы в Украине. Причина в этом.

  • +1 1
Надіслати
Поділитися на інших сайтах

3 минуты назад, Tom сказал:

 

Все сервисы яндекса заблокированы в Украине. Причина в этом.

я их отключил по всей админке, заменил картой гугл. Но как оказывается карта все равно грузится, за счет чего посетители не могут попасть на страницу. Подскажите как правильно ее вырезать со страницы контактов.

Надіслати
Поділитися на інших сайтах


6 минут назад, john67 сказал:

проверял ваш сайт, у меня страница контакта грузится быстро 5-6 сек

у меня тоже все открывается как и должно быть, вот у посетителей не грузит. Раньше и у меня не грузило и зависал целый браузер..

Даже не знаю с чем связано, но как понял проблема у некоторых осталась. 

Надіслати
Поділитися на інших сайтах


4 часа назад, Ch0oJoy сказал:

Даже не знаю с чем связано

Том уже выше написал с чем связано.

 

5 часов назад, Ch0oJoy сказал:

Подскажите пожалуйста что здесь удалить

Начиная со строки

var locationsMap = false;

 

И до вот этого блока включительно:

ymaps.ready(mapinit);
   $(window).resize(function() {
      if (locationsMap) {
          locationsMap.container.fitToViewport();
      }
   });

 

Хотя, если вы в админке действительно отключили, то должно было бы сработать это условие:
 

{% if geocode and map_status %}

 

Надіслати
Поділитися на інших сайтах


15 часов назад, Dotrox сказал:

Том уже выше написал с чем связано.

 

Начиная со строки


var locationsMap = false;

 

И до вот этого блока включительно:


ymaps.ready(mapinit);
   $(window).resize(function() {
      if (locationsMap) {
          locationsMap.container.fitToViewport();
      }
   });

 

Хотя, если вы в админке действительно отключили, то должно было бы сработать это условие:
 


{% if geocode and map_status %}

 

В админке все выключено в настройках шаблона. Удалил этот код, при проверке нашел tit такой скрипт в коде страницы <script src="//api-maps.yandex.ru/2.1/?lang=ru-ru"></script>

Посмотрел в header и других файлах, его нигде нет. Где он может быть чтоб убрать со страницы? 

Надіслати
Поділитися на інших сайтах


2 часа назад, Ch0oJoy сказал:

Посмотрел в header и других файлах, его нигде нет. Где он может быть чтоб убрать со страницы?

Смотрите в кеше модификаторов.

Если найдёте, то ищите, какой модификатор мог добавить.

  • +1 1
Надіслати
Поділитися на інших сайтах


26 минут назад, Dotrox сказал:

Смотрите в кеше модификаторов.

Если найдёте, то ищите, какой модификатор мог добавить.

В модификаторе нашел еще такой код. его можно удалить? 

<file path="admin/view/template/localisation/location_form.twig">

	<operation>

		<search><![CDATA[{{ footer }}]]></search>

		<add position="before"><![CDATA[

		<!-- Bodysport Theme [START] -->

		<script>

		ymaps.ready(init);

		function init() {

			var yandexPlacemark,

				yandexMap = new ymaps.Map('map', {

				center: [{% if geocode %}{{ geocode }}{% else %}55.75387766501658, 37.627392349243166{% endif %}],

				zoom: 14,

				controls: []

				});

			var searchControl = new ymaps.control.SearchControl({

				options: {

					provider: 'yandex#search'

				}

			});

			yandexMap.controls.add(searchControl);

			var coords = [{% if geocode %}{{geocode}}{% else %}55.7532, 37.6225{% endif %}];

			var yandexPlacemark = new ymaps.Placemark([{% if geocode %}{{ geocode }}{% else %}55.7532, 37.6225{% endif %}], {

				iconCaption: 'поиск...'}, {

					preset: 'islands#blueDotIconWithCaption',

					draggable: true

				});

				yandexMap.geoObjects.add(yandexPlacemark);

				getAddress(coords);

				yandexPlacemark.events.add('dragend', function() {

					getAddress(yandexPlacemark.geometry.getCoordinates());

				});

				yandexMap.events.add('click', function(e) {

					var coords = e.get('coords');

					if (yandexPlacemark) {

						yandexPlacemark.geometry.setCoordinates(coords);

					} else {

						yandexPlacemark = createPlacemark(coords);

						yandexMap.geoObjects.add(yandexPlacemark);

						yandexPlacemark.events.add('dragend', function() {

							getAddress(yandexPlacemark.geometry.getCoordinates());

						});

					}

					getAddress(coords);

				});

				function createPlacemark(coords) {

					return new ymaps.Placemark(coords, {

						iconCaption: 'поиск...'

					}, {

						hasBalloon: false,

						preset: 'islands#blueDotIconWithCaption',

						draggable: true

					});

				}

				searchControl.events.add('resultselect', function(e) {

					var index = e.get('index');

					searchControl.getResult(index).then(function(res) {

						var coords = res.geometry.getCoordinates();

						yandexPlacemark.geometry.setCoordinates(coords);

						getAddress(coords);

					});

				});

				yandexMap.events.add('boundschange', function(event) {

					//   document.getElementById("input-geocode-center").value = yandexMap.getCenter();

					//  document.getElementById("input-geocode-zoom").value = yandexMap.getZoom();

				});

                        

				function getAddress(coords) {

					savecoordinats(coords);

					ymaps.geocode(coords).then(function(res) {

						var firstGeoObject = res.geoObjects.get(0);

						yandexPlacemark.properties.set({

							iconCaption: [

								firstGeoObject.getLocalities().length ? firstGeoObject.getLocalities() : firstGeoObject.getAdministrativeAreas(),

								firstGeoObject.getThoroughfare() || firstGeoObject.getPremise()

								].filter(Boolean).join(', '),

								balloonContent: firstGeoObject.getAddressLine()

							});

						});

				}

                        

				function savecoordinats(coords) {

					var new_coords = [

						coords[0].toPrecision(6),

						coords[1].toPrecision(6)

					].join(', ');

					document.getElementById("input-geocode").value = new_coords;

				}

			}

			</script>

			<!-- Bodysport Theme [END] -->

      ]]></add>

    </operation>

Это оно: 

   <file path="catalog/controller/information/contact.php">

      <operation>

         <search><![CDATA[$data['breadcrumbs'] = array();]]></search>

         <add position="before"><![CDATA[

			// Bodysport Theme [START]

			$this->document->addScript('//api-maps.yandex.ru/2.1/?lang='.$this->session->data['language'].'');

			// Bodysport Theme [END]

		 ]]></add>

      </operation>

 

Надіслати
Поділитися на інших сайтах


Створіть аккаунт або увійдіть для коментування

Ви повинні бути користувачем, щоб залишити коментар

Створити обліковий запис

Зареєструйтеся для отримання облікового запису. Це просто!

Зареєструвати аккаунт

Вхід

Уже зареєстровані? Увійдіть тут.

Вхід зараз
  • Зараз на сторінці   0 користувачів

    • Ні користувачів, які переглядиють цю сторінку

×
×
  • Створити...

Important Information

На нашому сайті використовуються файли cookie і відбувається обробка деяких персональних даних користувачів, щоб поліпшити користувальницький інтерфейс. Щоб дізнатися для чого і які персональні дані ми обробляємо перейдіть за посиланням . Якщо Ви натиснете «Я даю згоду», це означає, що Ви розумієте і приймаєте всі умови, зазначені в цьому Повідомленні про конфіденційність.