(☞ຈل͜ຈ)☞ Главная  Статьи  Загрузчик Домой

Ok!
Ok!
200
"CUSTOM_FILTER" => "{"CLASS_ID":"CondGroup","DATA":{"All":"AND","True":"True"},"CHILDREN":[{"CLASS_ID":"CondIBSection","DATA":{"logic":"Equal","value":995}}]}",
custom filter^ bitrix100Пример заполнения custom_filter в Битрикс
149
<?$APPLICATION->IncludeFile(SITE_DIR."catalog/sidebar_".$arResult['ID'].".php",Array(),Array("MODE"=>"php"));?>
include, bitrix, включаемая область120Включаемая область
148
$arFilter = Array("IBLOCK_ID"=>GOODS, "ACTIVE_DATE"=>"Y", "ACTIVE"=>"Y", "=PROPERTY_CML2_ARTIKUL_VALUE"=>$p_title);
bitrix filter value, filter bx, value1290Свойство элемента в Битрикс фильтре
144
$iterator = CIBlockElement::GetList(
   array(),
   array('IBLOCK_ID' => 2, '=AVAILABLE' => 'Y', '=TYPE' => 1, '>=PRICE' => 100, '<=PRICE' => 200, 'CURRENCY_FOR_SCALE' => 'USD'),
   false,
   false,
   array('ID', 'NAME', 'IBLOCK_ID')
);
итератор, iterator bitrix, iterator140Выборка элементов Битрикс из каталога или другого инфоблока. Итерация.
142
array("LOGIC"=>"OR","NAME"=>$q,"PREVIEW_TEXT"=>$q, "PROPERTY_CML2_ARTIKUL"=>$q),
фильтр с логикой, логика, битрикс, bitrix, logic500Фильтр с логикой в Битрикс
131
<? $APPLICATION->IncludeFile( SITE_TEMPLATE_PATH . "/bespl_kons.php", Array(), Array( "MODE" => "html" ) ); ?>
include, bitrix, включаемая область90Вставка включаемой области из html файла в Битрикс
122
$component = new CBitrixComponent();
$component->InitComponent('redesign:menu', 'mobile');
$component->initComponentTemplate();
$path = $component->__template->GetFolder();
путь к компоненту, битрикс, bitrix120Путь к шаблону компонента в папке components
105
<a id="ajaxaction=add&ajaxaddid=<?=$ar_fields['ID'];?>" rel="nofollow" class="catalog-item-buy input-basket-submit" href="?action=ADD2BASKET&id=<?=$ar_fields['ID'];?>">В корзину</a>
bitrix, в корзину560Код кнопки добавления в корзину итрикс
101
/bitrix/modules/main/include.php replace OLDSITEEXPIREDATE by (exmpl) time() + 86400 * 3
bitrix100replace old site expire date
79
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
$widthPreview = 300;
$heightPreview = 200;
$widthPreviewBig = 300*2;
$heightPreviewBig = 200*2;
foreach($arResult['ITEMS'] as $i => $arItem) {

        $file = CFile::ResizeImageGet($arItem['FIELDS']["DETAIL_PICTURE"]['ID'], array('width' => $widthPreviewBig, 'height' => $heightPreviewBig), BX_RESIZE_IMAGE_EXACT, true);
        $arResult['ITEMS'][$i]["FIELDS"]["DETAIL_PICTURE"]["SRC"] = $file["src"];
        $arResult['ITEMS'][$i]["FIELDS"]["DETAIL_PICTURE"]["WIDTH"] = $file["width"];
        $arResult['ITEMS'][$i]["FIELDS"]["DETAIL_PICTURE"]["HEIGHT"] = $file["height"];

        $file = CFile::ResizeImageGet($arItem["PREVIEW_PICTURE"]['ID'], array('width' => $widthPreview, 'height' => $heightPreview), BX_RESIZE_IMAGE_EXACT, true);
        $arResult['ITEMS'][$i]["PREVIEW_PICTURE"]["SRC"] = $file["src"];
        $arResult['ITEMS'][$i]["PREVIEW_PICTURE"]["WIDTH"] = $file["width"];
        $arResult['ITEMS'][$i]["PREVIEW_PICTURE"]["HEIGHT"] = $file["height"];
}
resizeImageGet, resize, bitrix2300Ресайз
76
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();

use BitrixIblock;

$sectionsID = array();
foreach ($arResult["ITEMS"] as $arItem) {
    if ($arItem["IBLOCK_SECTION_ID"]) {
        $sectionsID[] = $arItem["IBLOCK_SECTION_ID"];
    }
}
$sectionsID = array_unique($sectionsID);

$result = IblockSectionTable::getList(array(
    "select" => array(
        "ID",
        "NAME",
    ),
    "filter" => array(
        "ID" => $sectionsID,
        "IBLOCK_ID" => $arResult["IBLOCK_ID"],
    ),
));

$arResult["SECTIONS"] = array();
while ($row = $result->fetch()) {
    $arResult["SECTIONS"][$row["ID"]] = $row;
}

sections, bitrix, sections by id120Выбор секций каталога Битрикс по ID элемента
75
$widthPreview = 200;
$heightPreview = 200;

if ($arResult["DETAIL_PICTURE"]) {
    $file = CFile::ResizeImageGet($arResult["DETAIL_PICTURE"], array('width'=> $widthPreview, 'height'=> $heightPreview), BX_RESIZE_IMAGE_EXACT, true);
    $arResult["PREVIEW_PICTURE"]["SRC"] = $file["src"];
    $arResult["PREVIEW_PICTURE"]["WIDTH"] = $file["width"];
    $arResult["PREVIEW_PICTURE"]["HEIGHT"] = $file["height"];
} elseif($arResult["PREVIEW_PICTURE"]) {
    $file = CFile::ResizeImageGet($arItem["PREVIEW_PICTURE"], array('width'=> $widthPreview, 'height'=> $heightPreview), BX_RESIZE_IMAGE_EXACT, true);
    $arResult["PREVIEW_PICTURE"]["SRC"] = $file["src"];
    $arResult["PREVIEW_PICTURE"]["WIDTH"] = $file["width"];
    $arResult["PREVIEW_PICTURE"]["HEIGHT"] = $file["height"];
}
resizeImageGet, resize, bitrix250result_modifier для кеширования и ресайза картинок
45
<?
$str = "1234567890";
echo TruncateText($str, 7);
// результатом будет строка "1234567..."
?>
bitrix, truncate, text, truncate text3100Обрезка текста в Битрикс
17
if($arParams["PREVIEW_TRUNCATE_LEN"] > 0 && strlen($arItem["PREVIEW_TEXT"])>5)
            $arItem["PREVIEW_TEXT"] = $obParser->html_cut($arItem["PREVIEW_TEXT"], $arParams["PREVIEW_TRUNCATE_LEN"]);
truncate, bitrix, prewiew text400Функция Битрикс для обрезки превью текста, если обрезка автоматически не работает
12
$items_sel =  (new CIBlockElement())->GetList([], $filter, 0, 0, ['ID']);
$arResult['ITEMS_SELECTED'] = $items_sel->SelectedRowsCount();

if(!$arResult['ITEMS_SELECTED'])
    $ids = [];
else
    while($item = $items_sel->Fetch())
        $ids[] = $item['ID'];
select, iblock, bitrix100Выбор айблоков в Битрикс