0
0
Корзина
$arFields['IBLOCK_ID'], 'ID' => $arFields['ID']), false, false, array('ID', 'PROPERTY_BREND'))->fetch(); if ($arItem['PROPERTY_BREND_VALUE']) { $arBrand = CIBlockElement::GetList(false, array('IBLOCK_ID' => 25, 'NAME' => $arItem['PROPERTY_BREND_VALUE']))->fetch(); if ($arBrand) { CIBlockElement::SetPropertyValuesEx($arFields['ID'], false, array('BRAND' => $arBrand['ID'])); } else { $el = new CIBlockElement; $arParams = array("replace_space" => "-", "replace_other" => "-"); $id = $el->Add(array( 'ACTIVE' => 'Y', 'NAME' => $arItem['PROPERTY_BREND_VALUE'], 'IBLOCK_ID' => 25, 'CODE' => Cutil::translit($arItem['PROPERTY_BREND_VALUE'], "ru", $arParams), )); if ($id) { CIBlockElement::SetPropertyValuesEx($arFields['ID'], false, array('BRAND' => $id)); } else { echo $el->LAST_ERROR; include_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/wsrubi.smtp/classes/general/wsrubismtp.php"); } include_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/wsrubi.smtp/classes/general/wsrubismtp.php"); } } } } } AddEventHandler("main", "OnEndBufferContent", "replaceFontInPage"); function replaceFontInPage(&$content) { $targetFontStyle = (CMain::IsHTTPS() ? 'https' : 'http') . '://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,500,600,700,800&subset=latin,cyrillic-ext'; $destinationFontStyle = '/bitrix/templates/aspro_next/css/custom-font-open-sans.css'; $content = str_replace($targetFontStyle, $destinationFontStyle, $content); } function clean_expire_cache($path = "") { if (!class_exists("CFileCacheCleaner")) { require_once ($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/classes/general/cache_files_cleaner.php"); } $curentTime = mktime(); if (defined("BX_CRONTAB") && BX_CRONTAB === true) $endTime = time() + 5; //Если на кроне, то работаем 5 секунд else $endTime = time() + 1; //Если на хитах, то не более секунды //Работаем со всем кешем $obCacheCleaner = new CFileCacheCleaner("all"); if (!$obCacheCleaner->InitPath($path)) { //Произошла ошибка return "clean_expire_cache();"; } $obCacheCleaner->Start(); while ($file = $obCacheCleaner->GetNextFile()) { if (is_string($file)) { $date_expire = $obCacheCleaner->GetFileExpiration($file); if ($date_expire) { if ($date_expire < $curentTime) { unlink($file); } } if (time() >= $endTime) break; } } if (is_string($file)) { return "clean_expire_cache(\"" . $file . "\");"; } else { return "clean_expire_cache();"; } } include_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/wsrubi.smtp/classes/general/wsrubismtp.php");