фильтр ресурсов по тв чз ajax не срабатывает

прикрепил к товарам твшки все настроил вроде правильно а не работает сволочуга, может я чтото упустил?

такой фильтр верстка

<div class="filterbox filter_content p-4 row">
     <form class="filter_plan ajax-form">
         <input type="hidden" name="sortby" value="pagetitle">
		<input type="hidden" name="sortdir" value="asc">
    <h2 class="text-center">Фильтр</h2>
        <div class="area_form_box">
            <h4 class="text-left">тип</h4>
            <div class="form-check">
              <input class="form-check-input checkbox-stage" value="ready" type="radio" name="types" >
              <label class="form-check-label" >
                готовое решение
              </label>
            </div>
            <div class="form-check">
              <input class="form-check-input checkbox-stage" value="modul" type="radio" name="types" >
              <label class="form-check-label">
                модульная кухня
              </label>
            </div>
           
        </div>
<div class="area_form_box">
<h4 class="text-left">конфигурация</h4>
<div class="form-check">
  <input class="form-check-input checkbox_stage" type="radio" name="config" value="line">
  <label class="form-check-label">
    прямая
  </label>
</div>
<div class="form-check">
  <input class="form-check-input checkbox_stage" type="radio" name="config" value="ugol"> 
  <label class="form-check-label">
    угловая
  </label>
</div>

</div>
<div class="area_form_box">
<h4 class="text-left">стиль</h4>
<div class="form-check">
  <input class="form-check-input checkbox_stage" type="radio" name="style" value="classic">
  <label class="form-check-label">
    классика
  </label>
</div>
<div class="form-check">
  <input class="form-check-input checkbox_stage" type="radio" name="style" value="sovr">
  <label class="form-check-label">
    современный
  </label>
</div>
<div class="form-check">
  <input class="form-check-input checkbox_stage" type="radio" name="style" value="hitec">
  <label class="form-check-label">
    хай-тек
  </label>
</div>
<div class="form-check">
  <input class="form-check-input checkbox_stage" type="radio" name="style" value="loft">
  <label class="form-check-label">
    лофт
  </label>
</div>
<div class="form-check">
  <input class="form-check-input checkbox_stage" type="radio" name="style" value="scand">
  <label class="form-check-label">
   скандинавский
  </label>
</div>

</div>


<div class="area_form_box">
<h4 class="text-left">материал фасада</h4>

<div class="form-check">
  <input class="form-check-input checkbox_stage" type="radio" name="fasad" value="dsp">
  <label class="form-check-label">
   дсп
  </label>
</div>
<div class="form-check">
  <input class="form-check-input checkbox_stage" type="radio" name="fasad" value="massive">
  <label class="form-check-label">
   массив
  </label>
</div>
<div class="form-check">
  <input class="form-check-input checkbox_stage" type="radio" name="fasad" value="plastic">
  <label class="form-check-label">
   пластик
  </label>
</div>
<div class="form-check">
  <input class="form-check-input checkbox_stage" type="radio" name="fasad" value="steklo">
  <label class="form-check-label">
   стекло
  </label>
</div>
<div class="form-check">
  <input class="form-check-input checkbox_stage" type="radio" name="fasad" value="mdfplenka">
  <label class="form-check-label">
   мдф пленка
  </label>
</div>
<div class="form-check">
  <input class="form-check-input checkbox_stage" type="radio" name="fasad" value="mdfkraska">
  <label class="form-check-label">
   мдф краска
  </label>
</div>

</div>

<div class="submit_btn mt-4">
<input class='reset_form ajax-reset mx-2 px-4' type="submit" value="Сбросить фильтр">
<input class='show mx-2 px-5 ajax-start' type="submit" value="Подобрать">
</div>


</form>
</div>
сниппет

<?php
//Filter Fields Settings
$filter = array();
 
//Radio, Select & Text Fields Type
if($_GET['types']) {
	$filter[] = 'types='.$_GET['types'];
}
if($_GET['config']) {
	$filter[] = 'config='.$_GET['config'];
}
if($_GET['style']) {
	$filter[] = 'style='.$_GET['style'];
}
if($_GET['fasad']) {
	$filter[] = 'fasad='.$_GET['fasad'];
}

//Two Text Fields From To
/*if($_GET['plot_area_from']) {
	$filter[] = 'plot_area>='.$_GET['plot_area_from'];
}
if($_GET['plot_area_to']) {
	$filter[] = 'plot_area<='.$_GET['plot_area_to'];
}


if($_GET['area_house_from']) {
	$filter[] = 'area_house>='.$_GET['area_house_from'];
}
if($_GET['area_house_to']) {
	$filter[] = 'area_house<='.$_GET['area_house_to'];
}
*/
//Checkbox Type
/*if($_GET['garage']) {
	$filter[] = 'garage=1';
}*/
 
//End Settings
 
//Sort
if($_GET['sortby']) {
	$sortby = $_GET['sortby'];
} else {
	$sortby = 'pagetitle';
}
if($_GET['sortdir']) {
	$sortdir = $_GET['sortdir'];
} else {
	$sortdir = 'asc';
}
//End Sort
 
//Offset
$offset = 0;
if($_GET['offset']){
	$offset = $_GET['offset'];
}
 
if($filter) {
	$where = $modx->toJSON(array($filter));
} else {
	$where = '';
}
 
$params_count = array(
	'parents' => $parents,
	'limit' => 0,
	'tpl' => '@INLINE ,',
	'select' => 'id',
	'includeTVs' => $fields,
	'showHidden' => '1',
	'where' => $where
);
 
$count = $modx->runSnippet('msProducts',$params_count);
$count = count(explode(',',$count))-1;
$modx->setPlaceholder('count',$count);
 
$params = array(
	'parents' => $parents,
	'limit' => $limit,
	'offset' => $offset,
	'tpl' => $tpl,
	'select' => 'id,pagetitle,introtext,content',
	'includeTVs' => $fields,
	'showHidden' => '1',
	'sortby' => $sortby,
	'sortdir' => $sortdir,
	'where' => $where
);
 
$more = $count - $offset - $limit;
$lim = $more > $limit ? $limit : $more;
 
$button = '';
if($more > 0){
	$button = '<div class="ajax-filter-count" data-count="'.$count.'"><a href="#" class="ajax-more">Загрузить еще '.$lim.' из '.$more.'</a></div>';
}
 
return $modx->runSnippet('msProducts',$params).$button;
и сам скрипт js

$(function() {

	//MODx pdoResources Ajax Filter
	//Filter Settings
	var fadeSpeed             = 200, // Fade Animation Speed
			ajaxCountSelector     = '.ajax-count', // CSS Selector of Items Counter
			ajaxContainerSelector = '.ajax-container', // CSS Selector of Ajax Container
			ajaxItemSelector      = '.ajax-item', // CSS Selector of Ajax Item
			ajaxFormSelector      = '.ajax-form', // CSS Selector of Ajax Filter Form
			ajaxFormButtonStart   = '.ajax-start', // CSS Selector of Button Start Filtering
			ajaxFormButtonReset   = '.ajax-reset', // CSS Selector of Button Reset Ajax Form
			sortDownText          = 'По убыванию',
			sortUpText            = 'По возрастанию';

	$('' + ajaxFormSelector + '').submit(function() {
		return false;
	});

	function ajaxCount() {
		if($('.ajax-filter-count').length) {
			var count = $('.ajax-filter-count').data('count');
			$(ajaxCountSelector).text(count);
		} else {
			$(ajaxCountSelector).text($(ajaxItemSelector).length);
		}
	}ajaxCount();

	function ajaxMainFunction() {
		$.ajax({
			data: $(ajaxFormSelector).serialize()
		}).done(function(response) {
			var $response = $(response);
			$(ajaxContainerSelector).fadeOut(fadeSpeed);
			setTimeout(function() {
				$(ajaxContainerSelector).html($response.find(ajaxContainerSelector).html()).fadeIn(fadeSpeed);
				ajaxCount();
			}, fadeSpeed);
		});
	}

	$(ajaxContainerSelector).on('click', '.ajax-more', function(e) {
		e.preventDefault();
		var offset = $(ajaxItemSelector).length;
		$.ajax({
			data: $(ajaxFormSelector).serialize()+'&offset='+offset
		}).done(function(response) {
			$('.ajax-more').remove();
			var $response = $(response);
			$response.find(ajaxItemSelector).hide();
			$(ajaxContainerSelector).append($response.find(ajaxContainerSelector).html());
			$(ajaxItemSelector).fadeIn();
		});
	})

	$(ajaxFormButtonStart).click(function(e) {
		e.preventDefault();
		ajaxMainFunction();
	})

	$(ajaxFormButtonReset).click(function(e) {
		e.preventDefault();
		$(ajaxFormSelector).trigger('reset');
		$('input[name=sortby]').val('pagetitle');
		$('input[name=sortdir]').val('asc');
		setTimeout(function() {
			$('[data-sort-by]').data('sort-dir', 'asc').toggleClass('button-sort-asc').text(sortUpText);
		}, fadeSpeed);
		ajaxMainFunction();
		ajaxCount();
	})

	$(''+ajaxFormSelector+' input').change(function() {
		ajaxMainFunction();
	})

	$('[data-sort-by]').data('sort-dir', 'asc').click(function() {
		var ths = $(this);
		$('input[name=sortby]').val($(this).data('sort-by'));
		$('input[name=sortdir]').val($(this).data('sort-dir'));
		setTimeout(function() {
			$('[data-sort-by]').not(this).toggleClass('button-sort-asc').text(sortUpText);
			ths.data('sort-dir') == 'asc' ? ths.data('sort-dir', 'desc').text(sortDownText) : ths.data('sort-dir', 'asc').text(sortUpText);
			$(this).toggleClass('button-sort-asc');
		}, fadeSpeed);
		ajaxMainFunction();
	});

});
что с ним не так? не заводится собака — вот оно
Евгений
03 октября 2022, 15:43
modx.pro
880
-1

Комментарии: 46

Артур Шевченко
03 октября 2022, 21:37
+1
Куда ты отправляешь данные? Почему у label нет for, а у чекбоксов нет id?
    deleted
    04 октября 2022, 01:27
    +1
    надо чекбоксы тогда внутри label, чтоб без id и for работало
      Евгений
      04 октября 2022, 09:23
      0
      внутри тоже не работает и даже и с id и for
        Роман
        04 октября 2022, 11:00
        0
        Вот про что вам говорят:
        <div class="form-check">
        	<input class="form-check-input checkbox_stage" type="radio" name="fasad" id="fasad-massive" value="massive">
        	<label for="fasad-massive" class="form-check-label">массив</label>
        </div>
        или так
        <label class="form-check">
        	<input class="form-check-input checkbox_stage" type="radio" name="fasad" value="massive">
        	<span class="form-check-label">массив</span>
        </label>
      Евгений
      04 октября 2022, 09:11
      0
      тут вот работает, тоже самое вроде как
      for и id были из стандартного бутстраповского примера — не работало )))))
        Артур Шевченко
        04 октября 2022, 11:32
        0
        В общем, по-моему, должен быть приёмник ajax запросов. Я такого не вижу
      Роман
      04 октября 2022, 09:42
      0
      А вы в курсе такого тэга как cut?
        Евгений
        04 октября 2022, 09:44
        0
        нет, а что это?
        сделал как в рабочем примере разметку и все равно не работает :(
        <div class="filterbox filter_content p-4 row">
             <form class="filter_plan ajax-form">
                 <input type="hidden" name="sortby" value="pagetitle">
        		<input type="hidden" name="sortdir" value="asc">
            <h2 class="text-center">Фильтр</h2>
                
        <h4 class="text-left"><label>тип</label></h4>
        <div class="area_form_box">
        <div><input class="form-check-input checkbox-stage" value="ready" type="radio" name="types">готовое решение</div>
        <div><input class="form-check-input checkbox-stage" value="modul" type="radio" name="types">модульная кухня</div>
        </div>
                    
        
        <h4 class="text-left"><label>конфигурация</label></h4>
        <div class="area_form_box">
            <div><input class="form-check-input checkbox_stage" type="radio" name="config" value="line">прямая</div>
            <div><input class="form-check-input checkbox_stage" type="radio" name="config" value="ugol">угловая</div>
        </div>
        
        <h4 class="text-left"><label>стиль</label></h4>
        <div class="area_form_box">
            <div><input class="form-check-input checkbox_stage" type="radio" name="style" value="classic">классика</div>
            <div><input class="form-check-input checkbox_stage" type="radio" name="style" value="sovr">современный</div>
            <div><input class="form-check-input checkbox_stage" type="radio" name="style" value="hitec">хай-тек</div>
            <div><input class="form-check-input checkbox_stage" type="radio" name="style" value="loft">лофт</div>
            <div><input class="form-check-input checkbox_stage" type="radio" name="style" value="scand">скандинавский</div>
        </div>
        
        
        
        <h4 class="text-left"><label>материал фасада</label></h4>
        
        <div class="area_form_box">
            <div><input class="form-check-input checkbox_stage" type="radio" name="fasad" value="dsp">дсп</div>
            <div><input class="form-check-input checkbox_stage" type="radio" name="fasad" value="massive">массив</div>
            <div><input class="form-check-input checkbox_stage" type="radio" name="fasad" value="plastic">пластик</div>
            <div><input class="form-check-input checkbox_stage" type="radio" name="fasad" value="steklo">стекло</div>
            <div><input class="form-check-input checkbox_stage" type="radio" name="fasad" value="mdfplenka">мдф пленка</div>
            <div><input class="form-check-input checkbox_stage" type="radio" name="fasad" value="mdfkraska">мдф краска</div>
        </div>
        
        <div class="submit_btn mt-4">
        <input class='reset_form ajax-reset mx-2 px-4' type="submit" value="Сбросить фильтр">
        <input class='show mx-2 px-5 ajax-start' type="submit" value="Подобрать">
        </div>
        
        
        </form>
        </div>
          Роман
          04 октября 2022, 09:50
          0
          Просто убрать портянку с главной страницы вопросов. Обрезайте текст для вывода на главной тегом cut.
            Евгений
            04 октября 2022, 10:10
            0
            а, сорян, поставил якорь
        Роман
        04 октября 2022, 10:14
        +1
        Где у вас $fields объявлено? Затем для TV нужно писать запросы так:
        TVfasad.value
        Ну и как минимум упростить код:
        $fields = ['types', 'config', 'style', 'fasad'];
        foreach ($fields as $field) {
        	if(isset($_GET[$field])) $filter[] = $field . '=' . $_GET[$field];
        }
        includeTVs:
        'includeTVs' => implode(",", $fields)
          Евгений
          04 октября 2022, 13:09
          0
          [[!filter? &tpl=`tovartplcat` &limit=`32` &parents=`2` &fields=`types,config,style,fasad`]]
            Евгений
            04 октября 2022, 14:26
            0
            а для чего писать tv запросы? не понял…
              Роман
              04 октября 2022, 15:17
              +1
              $filter[] = 'TVconfig.value='.$_GET['config'];
                Евгений
                04 октября 2022, 15:30
                0
                красиво но не работает
                  Роман
                  04 октября 2022, 15:33
                  +1
                  У вас выдает пустоту, значит снипет не работает:
                  https://maltipuhome.ru/test?config=line
                  Сортировка работает, значит проблема с where, ее нужно решать.
                  Возможно проблема в этом:
                  $where = $modx->toJSON(array($filter));
                  заменить на 
                  $where = $modx->toJSON($filter);
                    Евгений
                    04 октября 2022, 17:05
                    0
                    попробовал но и оно не срабатывает
                    может хостер чтото не поддерживает? или в чем может быть проблема?
                      Алексей Смирнов
                      04 октября 2022, 17:10
                      +2
                      Думаю тут проще нанять разработчика. потому что гадать вы будете долго.
                        Евгений
                        04 октября 2022, 17:23
                        0
                        вечерком проверю на другом хосте
                      Евгений
                      05 октября 2022, 12:19
                      0
                      как определил что сортировка работает? вижу что не выгружаются блоки с ресурсами
                        Роман
                        05 октября 2022, 12:26
                        +1
                        /test?sortby=pagetitle&sortdir=asc
                        /test?sortby=pagetitle&sortdir=desc
                        /test?sortby=price&sortdir=asc
                        /test?sortby=price&sortdir=desc
                          Евгений
                          05 октября 2022, 13:01
                          0
                          ага, понятно
                          но оба варианта не работают
                          $where = $modx->toJSON(array($filter));
                          заменить на 
                          $where = $modx->toJSON($filter);
                            Евгений
                            05 октября 2022, 13:16
                            0
                            а вообще вот отсюда оно
                              Роман
                              05 октября 2022, 14:13
                              0
                              У карточек заполнены характеристики?
                              В catalogFilter нужно добавить &showLog=`1`, чтобы посмотреть, какой запрос идет в базу
                                Евгений
                                05 октября 2022, 14:30
                                0
                                да
                                сейчас поглядимс
                                а где смотреть лог?
                Евгений
                10 октября 2022, 09:43
                0
                что с этим where не так?
                if($filter) {
                	$where = $modx->toJSON(array($filter));
                } else {
                	$where = '';
                }
                как проверить что за массив он получает и вообще получает ли из

                //Filter Fields Settings
                $filter = array();
                 
                //Radio, Select & Text Fields Type
                
                if($_GET['types']) {
                	$filter[] = 'types='.$_GET['types'];
                }
                if($_GET['config']) {
                	$filter[] = 'config='.$_GET['config'];
                }
                if($_GET['style']) {
                    $filter[] = 'style='.$_GET['style'];
                }
                if($_GET['fasad']) {
                	$filter[] = 'fasad='.$_GET['fasad'];
                }
                  Константин Ильин
                  10 октября 2022, 10:27
                  0
                  <?
                  if($filter) {
                          $modx->log(1,print_r($filter,1));
                  	$where = $modx->toJSON(array($filter));
                  } 
                  ....
                  Результат смотрите в журнале ошибок модх
                    Евгений
                    10 октября 2022, 12:02
                    0
                    [2022-10-10 09:01:03] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/cache/includes/elements/modsnippet/35.include.cache.php : 48) Array
                    (
                        [0] => types=
                    )
                    
                    [2022-10-10 09:01:03] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/components/pdotools/model/pdotools/pdofetch.class.php : 178) [pdoTools] Error 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND  ( `msProduct`.`parent` IN (2,24,5,6,7,8,9,10,11,12,13,14,21,64,62,65,66,67,' at line 1
                    [2022-10-10 09:01:03] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/components/pdotools/model/pdotools/pdofetch.class.php : 178) [pdoTools] Error 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND  ( `msProduct`.`parent` IN (2,24,5,6,7,8,9,10,11,12,13,14,21,64,62,65,66,67,' at line 1
                    оставил в запросе только одно поле, думаю иначе бы по каждому были ошибки подобные
                      Евгений
                      10 октября 2022, 12:07
                      0
                      хмммм

                      [2022-10-10 09:06:13] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/cache/includes/elements/modsnippet/35.include.cache.php : 7) PHP warning: Undefined array key "types"
                      [2022-10-10 09:06:13] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/cache/includes/elements/modsnippet/35.include.cache.php : 24) PHP warning: Undefined array key "sortby"
                      [2022-10-10 09:06:13] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/cache/includes/elements/modsnippet/35.include.cache.php : 29) PHP warning: Undefined array key "sortdir"
                      [2022-10-10 09:06:13] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/cache/includes/elements/modsnippet/35.include.cache.php : 38) PHP warning: Undefined array key "offset"
                      [2022-10-10 09:06:13] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/components/minishop2/handlers/storage/session/cartsessionhandler.class.php : 15) PHP warning: Undefined array key "minishop2"
                      [2022-10-10 09:06:13] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/components/minishop2/handlers/storage/session/cartsessionhandler.class.php : 15) PHP warning: Trying to access array offset on value of type null
                      [2022-10-10 09:06:13] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/components/minishop2/handlers/storage/session/ordersessionhandler.class.php : 22) PHP warning: Undefined array key "minishop2"
                      [2022-10-10 09:06:13] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/components/minishop2/handlers/storage/session/ordersessionhandler.class.php : 22) PHP warning: Trying to access array offset on value of type null
                      deleted
                      10 октября 2022, 20:23
                      0
                      if($_GET['fasad']) {
                      	$filter[] = 'fasad='.$_GET['fasad'];
                      }
                      Значение должно быть в кавычках.

                      Попробуй htmx для фронта, не надо будет писать js.
                      Евгений
                      10 октября 2022, 12:17
                      0
                      вот такое при обновлении страницы и потом нажатии чекбоксов в фильтре, что это?
                      [2022-10-10 09:15:12] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/cache/includes/elements/modsnippet/35.include.cache.php : 7) PHP warning: Undefined array key "types"
                      [2022-10-10 09:15:12] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/cache/includes/elements/modsnippet/35.include.cache.php : 10) PHP warning: Undefined array key "config"
                      [2022-10-10 09:15:12] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/cache/includes/elements/modsnippet/35.include.cache.php : 13) PHP warning: Undefined array key "style"
                      [2022-10-10 09:15:12] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/cache/includes/elements/modsnippet/35.include.cache.php : 16) PHP warning: Undefined array key "fasad"
                      [2022-10-10 09:15:12] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/cache/includes/elements/modsnippet/35.include.cache.php : 23) PHP warning: Undefined array key "sortby"
                      [2022-10-10 09:15:12] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/cache/includes/elements/modsnippet/35.include.cache.php : 28) PHP warning: Undefined array key "sortdir"
                      [2022-10-10 09:15:12] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/cache/includes/elements/modsnippet/35.include.cache.php : 37) PHP warning: Undefined array key "offset"
                      [2022-10-10 09:15:12] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/components/minishop2/handlers/storage/session/cartsessionhandler.class.php : 15) PHP warning: Undefined array key "minishop2"
                      [2022-10-10 09:15:12] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/components/minishop2/handlers/storage/session/cartsessionhandler.class.php : 15) PHP warning: Trying to access array offset on value of type null
                      [2022-10-10 09:15:12] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/components/minishop2/handlers/storage/session/ordersessionhandler.class.php : 22) PHP warning: Undefined array key "minishop2"
                      [2022-10-10 09:15:12] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/components/minishop2/handlers/storage/session/ordersessionhandler.class.php : 22) PHP warning: Trying to access array offset on value of type null
                      [2022-10-10 09:15:34] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/cache/includes/elements/modsnippet/35.include.cache.php : 10) PHP warning: Undefined array key "config"
                      [2022-10-10 09:15:34] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/cache/includes/elements/modsnippet/35.include.cache.php : 13) PHP warning: Undefined array key "style"
                      [2022-10-10 09:15:34] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/cache/includes/elements/modsnippet/35.include.cache.php : 16) PHP warning: Undefined array key "fasad"
                      [2022-10-10 09:15:34] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/cache/includes/elements/modsnippet/35.include.cache.php : 37) PHP warning: Undefined array key "offset"
                      [2022-10-10 09:15:34] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/cache/includes/elements/modsnippet/35.include.cache.php : 47) Array
                      (
                          [0] => types=1
                      )
                        Константин Ильин
                        10 октября 2022, 13:08
                        0
                        слишком много ошибок для простого поднятия сайта.

                        Напишите какие у вас версии пакетов модх и конфиг сервера(пхп, мускл)
                          Евгений
                          10 октября 2022, 13:20
                          0
                          modx 2.8.4
                          PHP Version 8.0.24 была ранее 7,4 это ничего не меняло
                          mysql 5.7.36-39

                          pdotools 2.13.2-pl
                          minishop 3.0.6-pl

                          в целом на хосте несколько сайтов, но там нет такого фильтра
                            Роман
                            10 октября 2022, 17:50
                            0
                            На PHP Version 8.0.24 работать не будет, вернитесь на 7,4.
                              Евгений
                              12 октября 2022, 11:03
                              0
                              вернулся
                              сайт где работает на 7.4.28
                              на сайте где 7.4.32 не работает
                              пробовал и старее весрии ставить не помогло
                                Роман
                                12 октября 2022, 11:41
                                0
                                Смотрите логи php. Какие там ошибки и исправляйте.
                        deleted
                        10 октября 2022, 20:26
                        0
                        pastebin.com/Y3G6g18h
                        Вот мой сниппет для фильтров в минишопе, может поможет
                          Евгений
                          12 октября 2022, 11:03
                          0
                          добавил правки под новую
                          if(isset($_GET['types'])){$filterz[] = 'types=' . $_GET['types'];}
                          if(isset($_GET['config'])){$filterz[] = 'config=' . $_GET['config'];}
                          if(isset($_GET['style'])){$filterz[] = 'style=' . $_GET['style'];}
                          if(isset($_GET['fasad'])){$filterz[] = 'fasad=' . $_GET['fasad'];}
                          и where

                          if(isset($filterz)) { $where = $modx->toJSON(array($filterz)); } else { $where = ''; }
                          if(isset($filterz)) {
                                  $modx->log(1,print_r($filterz,1));
                          	$where = $modx->toJSON(array($filterz));
                          }
                          в итоге получаю в лог такое
                          [2022-10-12 06:31:26] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/cache/includes/elements/modsnippet/37.include.cache.php : 28) Array
                          (
                              [0] => types=1
                              [1] => config=1
                              [2] => style=1
                              [3] => fasad=1
                          )
                          ну и в результатах фильтрации 0
                            Роман
                            12 октября 2022, 11:45
                            0
                            в вызове сниппета включите показывать логи:
                            &showLog=`1`
                            B там смотрите, что передается в mysql какой запрос.
                          Евгений
                          18 октября 2022, 11:48
                          0
                          пришел к такому решению:
                          [[!msProducts? &tpl=`tovartplCat` &limit=`64` &parents=`2` &tvFilters=`[[!where]]` &includeTVs=`types,config,style,fasad` ]]
                          <?php
                          $filterz = '';
                          if(isset($_GET['types'])) $filterz['types'] = $_GET['types'];
                          if(isset($_GET['config'])) $filterz['config'] = $_GET['config'];
                          if(isset($_GET['style'])) $filterz['style'] = $_GET['style'];
                          if(isset($_GET['fasad'])) $filterz['fasad'] = $_GET['fasad'];
                          if($filterz !=='') $filterz = substr($filterz,0,-1);
                          
                          //if(!empty($filterz)) {$where = json_encode($filterz);} else {$where = '';}
                          
                          return $filterz;
                          но чтото не завелось :(
                            Евгений
                            18 октября 2022, 12:18
                            0
                            подправил для поле tvFilters
                            <?php
                            $filterz = '';
                            if(isset($_GET['types'])) $filterz = $filterz.'types=='.$_GET['types'].',';
                            if(isset($_GET['config'])) $filterz = $filterz.'config=='.$_GET['config'].',';
                            if(isset($_GET['style'])) $filterz = $filterz.'style=='.$_GET['style'].',';
                            if(isset($_GET['fasad'])) $filterz = $filterz.'fasad=='.$_GET['fasad'].',';
                            
                            if($filterz !=='') $filterz = substr($filterz,0,-1);
                            
                            return $filterz;
                            словил такую ошибку
                            [pdoTools] Error 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"`TVtypes`.`value` LIKE '1\"' AND  ( `msProduct`.`parent` IN (2,24,5,6,7,8,9,10,' at line 1
                            Авторизуйтесь или зарегистрируйтесь, чтобы оставлять комментарии.
                            46