Created
October 13, 2017 07:59
-
-
Save SergeyZaigraev/54d700134c6013fe6750949e4d8ae632 to your computer and use it in GitHub Desktop.
Smart filter. Build smart url
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SMART FILTER LINK // | |
$arSectionInfo = CIBlockSection::GetByID($arSmartFilter['SECTION_ID'])->GetNext(); | |
$sefSmartUrl = $arSectionInfo['SECTION_PAGE_URL'] . "filter/#SMART_FILTER_PATH#/"; | |
foreach($arResult["ITEMS"] as $PID => $arItem) | |
{ | |
$code = null; | |
if ($arItem["CODE"]){ | |
$code = toLower($arItem["CODE"]); | |
}else{ | |
$code = $arItem["ID"]; | |
} | |
if($arItem["PROPERTY_TYPE"] != "N" && $arItem["DISPLAY_TYPE"] != "U") | |
foreach($arItem["VALUES"] as $key => $ar) | |
{ | |
$arResult["ITEMS"][$PID]['VALUES'][$key]['SMART_URL'] = str_replace("#SMART_FILTER_PATH#", implode("/", $this->__component->encodeSmartParts(array(array($code,$ar["URL_ID"])))), $sefSmartUrl); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Создание чпу ссылок для параметров фильтра