This file contains 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
<? | |
if (CModule::IncludeModule('sale')) { | |
$dbBasketItems = CSaleBasket::GetList(array(),array( | |
'FUSER_ID' => CSaleBasket::GetBasketUserID(), | |
'LID' => SITE_ID, | |
'ORDER_ID' => 'NULL', | |
'PRODUCT_ID' => $ID)); | |
if ($arBasket = $dbBasketItems->Fetch()) { | |
CSaleBasket::Delete($arBasket['ID']); | |
} |
This file contains 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
\Bitrix\Main\EventManager::getInstance()->addEventHandler("main", "OnEndBufferContent", "removeSpacesAndTabs"); | |
/** | |
* Удаляет табы и лишние пробелы из html кода | |
* | |
* @param $content | |
*/ | |
function removeSpacesAndTabs (&$content) { | |
global $APPLICATION; | |
$page = $APPLICATION->GetCurPage(); |
This file contains 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
<!DOCTYPE html> | |
<html lang="ru"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
<script src="https://code.jquery.com/jquery-3.5.0.min.js" integrity="sha256-xNzN2a4ltkB44Mc/Jz3pT4iU1cmeR0FkXs4pru/JxaQ=" crossorigin="anonymous"></script> | |
</head> | |
<body> | |
<div class="blocks"> | |
<div class="block"> |
This file contains 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
<?$rsResult = CIBlockSection::GetList(array("SORT" => "ASC"), array("IBLOCK_ID" => $arParams["IBLOCK_ID"], "ID" => $arResult['SECTION']['ID']), false, $arSelect = array("UF_*")); | |
while ($arResult = $rsResult -> GetNext()) | |
{?> | |
<?//echo '<pre>'; print_r($arResult); echo '<pre>';?> | |
<?}?> |
This file contains 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
// В шаблоне bitrix:catalog.smart.filter редактируем script.js | |
//ищим функцию JCSmartFilter.prototype.postHandler и вписываем следующее | |
$.get( | |
BX.util.htmlspecialcharsback(result.FILTER_AJAX_URL), | |
function (data) { | |
history.pushState(null, null, result.FILTER_AJAX_URL);//подставляем адрес в адресную строку | |
$('.catalog-list').html($(data).find('.catalog-list').html()); | |
} | |
); |
This file contains 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
<div class="loader">Loade...</div> | |
<div class="step"></div> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script> | |
<script type="text/javascript"> | |
function func(i) | |
{ | |
var form_data = new FormData(); | |
form_data.append('ITER', i); | |
$.ajax({ |
This file contains 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
<? | |
$dbItems = \Bitrix\Iblock\ElementTable::getList(array( | |
'select' => array('ID', 'NAME', 'IBLOCK_ID'), | |
'filter' => array('IBLOCK_ID' => $arParams['IBLOCK_ID']) | |
)); | |
while ($arItem = $dbItems->fetch()){ | |
$dbProperty = \CIBlockElement::getProperty( | |
$arItem['IBLOCK_ID'], | |
$arItem['ID'] | |
); |
This file contains 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
<?$resB = CIBlock::GetList( | |
Array(), | |
Array( | |
'TYPE'=>'catalog' | |
), false | |
); | |
while($ar_res_blo = $resB->Fetch()) | |
{ | |
$iblon[] = $ar_res_blo['ID']; | |
} |
This file contains 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
<?//обновление свойства элемента | |
$result = \Bitrix\Iblock\ElementPropertyTable::update( | |
$arProp[ID],// ID в таблице | |
[ | |
'IBLOCK_PROPERTY_ID'=>50, // ID свойства | |
'VALUE'=>$arProp['VALUE'] // новое значение свойства | |
]); | |
?> |
This file contains 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
#html | |
<a class="toTop hidden" href="#top"><i class="fas fa-chevron-up"></i></a> | |
#style | |
.toTop{ | |
position: fixed; | |
right: 50px; | |
bottom: 20px; | |
} | |
.toTop.hidden{ |