для начала лезем в этот файл
bitrix/modules/main/classes/general/component_engine.php
1 2 3 4 5 6 7 8 9 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 |
protected function __checkPath4Template($pageTemplate, $currentPageUrl, &$arVariables) { if (!empty($this->greedyParts)) { $pageTemplateReg = preg_replace("'#(?:".implode("|", $this->greedyParts).")#'", "(.+?)", $pageTemplate); $pageTemplateReg = preg_replace("'#[^#]+?#'", "([^/]+?)", $pageTemplateReg); } else { $pageTemplateReg = preg_replace("'#[^#]+?#'", "([^/]+?)", $pageTemplate); } if (substr($pageTemplateReg, -1, 1) == "/") $pageTemplateReg .= "index\\.php"; $re = '/^\/([^\/]*?\/)filter\/(.+?)\/apply\//m'; /* /decking/filter/brand-is-darvolex/s_depth-is-8/apply/sdfsdfsdfsdfsfsdf /decking/terrasnaya-doska-plastik/filter/s_color-is-8/apply/ /decking/filter/brand-is-darvolex/s_depth-is-8/apply/sdfsdfsdfsdfsfsdf */ $matches_f=array(); preg_match($re, $_SERVER['REQUEST_URI'], $matches_f ); if($matches_f){ $pageTemplateReg="filter\/(.+?)\/apply\/index\.php"; } $arValues = array(); if (preg_match("'^".$pageTemplateReg."$'", $currentPageUrl, $arValues)) { $arMatches = array(); if (preg_match_all("'#([^#]+?)#'", $pageTemplate, $arMatches)) { for ($i = 0, $cnt = count($arMatches[1]); $i < $cnt; $i++) $arVariables[$arMatches[1][$i]] = $arValues[$i + 1]; } return true; } return false; } |
и исплавляем работу без категорий
2) потом для вашего smart фильтер добавочку — проверку на страницу делаем, что бы не попали страницы с категориями
1 2 3 4 5 6 7 8 9 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 |
$re = '/^\/(?:.+?)filter\/(.+?)\/apply\//m'; /*$str = '/decking/filter/brand-is-darvolex/s_depth-is-8/apply/sdfsdfsdfsdfsfsdf /decking/herrr/filter/brand-is-darvolex/s_depth-is-8/apply/'; */ $matches_f=array(); preg_match($re, $_SERVER['REQUEST_URI'], $matches_f ); if($matches_f){ $arResult['VARIABLES']['SMART_FILTER_PATH']=$matches_f[1]; } $APPLICATION->IncludeComponent( 'bitrix:catalog.smart.filter', 'catalog', array( 'IBLOCK_TYPE' => $arParams['IBLOCK_TYPE'], 'IBLOCK_ID' => $arParams['IBLOCK_ID'], 'SECTION_ID' => $arSection['ID'], 'FILTER_NAME' => $arParams['FILTER_NAME'], 'PRICE_CODE' => $arParams['PRICE_CODE'], 'CACHE_TYPE' => $arParams['CACHE_TYPE'], 'CACHE_TIME' => $arParams['CACHE_TIME'], 'CACHE_GROUPS' => $arParams['CACHE_GROUPS'], 'SAVE_IN_SESSION' => 'N', 'FILTER_VIEW_MODE' => ($arTheme['FILTER_VIEW']['VALUE'] == 'HORIZONTAL' ? 'HORIZONTAL' : 'VERTICAL'), 'DISPLAY_ELEMENT_COUNT' => 'Y', 'POPUP_POSITION' => ($arTheme['SIDE_MENU']['VALUE'] == 'LEFT' ? 'right' : 'left'), 'INSTANT_RELOAD' => 'Y', 'XML_EXPORT' => 'N', 'HIDE_NOT_AVAILABLE' => 'N', 'TEMPLATE_THEME' => $arParams['TEMPLATE_THEME'], 'SEF_MODE' => strlen($arParams['FILTER_URL_TEMPLATE']) ? 'Y' : 'N', 'SEF_RULE' => $arResult['FOLDER'].$arParams['FILTER_URL_TEMPLATE'], 'SMART_FILTER_PATH' => $arResult['VARIABLES']['SMART_FILTER_PATH'], ), $component ); |