- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
<?php
if (isset($_GET['display']) && $_GET['display'] != '') {
$display = $_GET['display'];
} else { $display = 12; }
if (isset($_GET['sortby']) && $_GET['sortby'] != '') {
$sortby = $_GET['sortby'];
} else { $sortby = 'pagetitle';}
if (isset($_GET['sortdir']) && $_GET['sortdir'] != '') {
$sortDir = $_GET['sortdir'];
} else { $sortDir = 'DESC';}
if (isset($_GET['producer']) && $_GET['producer'] != '') {
$producer = '|producer,'.$_GET['producer'].',1';
} else { $producer = '';}
if ($modx->documentIdentifier == 56) {
if (isset($_GET['mont']) && $_GET['mont'] != '') {
$mont = '|type-mont,'.$_GET['mont'].',1';
} else { $mont = ''; }
if (isset($_GET['vwidth']) && $_GET['vwidth'] != '') {
$vwidth = '|type-width,'.$_GET['vwidth'].',1';
} else { $vwidth = ''; }
}
if ($modx->documentIdentifier == 20) {
if (isset($_GET['fhol']) && $_GET['fhol'] != '') {
$fhol = '|type-hol,'.$_GET['fhol'].',1';
} else { $fhol = ''; }
}
if ($modx->documentIdentifier == 27 || $modx->documentIdentifier == 62 || $modx->documentIdentifier == 778) {
if (isset($_GET['moi']) && $_GET['moi'] != '') {
$moi = '|type-moi,'.$_GET['moi'].',1';
} else { $moi = ''; }
}
if (isset($_GET['minval']) && $_GET['minval'] != '') {
$sql = 'SELECT contentid, value FROM `modx_site_tmplvar_contentvalues` WHERE tmplvarid = 9';
$result = mysql_query($sql);
if ($result) {
while ($row = mysql_fetch_array($result)) {
$curPrice = intval(str_replace(array(',', ' '), '', $row['value']));
if ($curPrice >= $_GET['minval'] && $curPrice <= $_GET['maxval']) {
$preDocs[] = $row['contentid'];
}
}
if (count($preDocs) > 0) {
$preDitto = $modx->runSnippet("Ditto", array(
"tpl" => "product-inner-tpl",
"parents" => $modx->documentIdentifier,
"noResults" => "",
"depth" => 4,
"filter" => "template,7,1".$producer.$mont.$vwidth.$fhol.$moi
));
$preDitto = trim($preDitto, ',');
if ($preDitto != '') {
$preDittoDocs = explode(',', $preDitto);
$documents = array_intersect($preDittoDocs, $preDocs);
if (count($documents) != 0) {
$dittoOutput = $modx->runSnippet("Ditto", array(
"tpl" => "product-grid-tpl",
"documents" => implode(',', $documents),
"sortDir" => $sortDir,
"sortBy" => $sortby,
"noResults" => "",
"paginate" => 1,
"display" => $display,
"id" => "catditto"
));
$dittoOutput = $modx->parseDocumentSource($dittoOutput);
$dittoOutput2 = $modx->runSnippet("Ditto", array(
"tpl" => "product-tpl",
"documents" => implode(',', $documents),
"sortDir" => $sortDir,
"sortBy" => $sortby,
"noResults" => "",
"paginate" => 1,
"display" => $display,
"tplPaginatePrevious" => "prev-tpl",
"tplPaginateNext" => "next-tpl",
"tplPaginatePage" => "page-tpl",
"tplPaginateCurrentPage" => "page-current-tpl",
"id" => "catditto"
));
$dittoOutput2 = $modx->parseDocumentSource($dittoOutput2);
$pagination = $modx->runSnippet("PagesWrapper");
echo '
<div class="tovars_cont">
<ul class="tovars catBody active">'.$dittoOutput.'</ul>
<ul class="tovars_list catBody">'.$dittoOutput2.'</ul>
</div>
<div class="clear"></div>
'.$pagination;
} else {
echo 'Товаров не найдено.';
}
} else {
echo 'Товаров не найдено.';
}
} else {
echo 'Товаров не найдено.';
}
} else { echo '-1'; }
}
мегафильтрация для интернет магазина на modx evo (при фильтрации минуту страница грузится)
guest 27.12.2016 15:10 # 0
guest 27.12.2016 15:44 # 0
guest 27.12.2016 16:24 # 0
roman_gemini 27.12.2016 17:36 # 0