if ($_where) {
$where[] = '("' . implode(' OR ', $_where) . '")';
}
<?php
$params = array(
'parents' => $parents,
'includeTVs' => $includeTVs,
'limit' => $limit,
'tpl' => $tpl,
'toPlaceholder' => $toPlaceholder,
'showLog' => 1
);
$where = array();
if(isset($_GET['price-from']) && isset($_GET['price-to'])) {
$where[] = 'price >= ' . $_GET['price-from'];
$where[] = 'price <= ' . $_GET['price-to'];
}
if(isset($_GET['tip-kuzova']) && !empty($_GET['tip-kuzova'])) {
$where[] = 'body_type IN (' . implode(',', $_GET['tip-kuzova']) . ')';
}
if(isset($_GET['tip-topliva']) && !empty($_GET['tip-topliva'])) {
$_where = array();
foreach ($_GET['tip-topliva'] as $fuel_type) {
$_where[] = 'FIND_IN_SET(' . $fuel_type . ', replace(`fuel_type`, "||", ",")) > 0';
}
if ($_where) {
$where[] = '("' . implode(' OR ', $_where) . '")';
}
}
$where[] = 'template = 4';
$childrens = array();
$params['where'] = '["' . implode(' AND ', $where) . '"]';
return $modx->runSnippet('pdoResources', $params);
[[!filterConfigurator?
&parents=`[[+id]]`
&tpl=`models_item`
&limit=`20`
&includeTVs=`image, price,price,body_type,fuel_type,rwd,transmission`
&toPlaceholder=`models`
]]
echo "<pre>";
print_r($_POST);
echo "</pre>";
die;
if ($_REQUEST['IBLOCK_CODE'] == 'skidka') {
require($_SERVER["DOCUMENT_ROOT"] . '/beginners/skidka/index.php');
return;
}
{
"overclocking.value:>=":6.8,
"overclocking.value:<=":10.9,
"template:=":12
}
{
"overclocking.value:>=":6.8,
"template:=":12
}