View all_product_price_add_upd.php
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
<?CModule::IncludeModule("catalog"); | |
$arSelect = Array("ID", "IBLOCK_ID", "CATALOG_PRICE_1"); | |
$arFilter = Array("IBLOCK_ID"=>17); | |
//ID инфоблока с ТП, а не с простыми товарами | |
$resw = CIBlockElement::GetList(Array(), $arFilter, false, Array("nPageSize"=>1000000), $arSelect); | |
while($ob = $resw->GetNextElement()){ | |
$arFields = $ob->GetFields(); | |
$arProps = $ob->GetProperties(); | |
{ | |
echo $arFields[ID].' - '.$arFields['CATALOG_PRICE_1'].'</br>'; |
View init.php
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
<? | |
$em = Bitrix\Main\EventManager::getInstance(); | |
$em->addEventHandler('iblock', 'OnBeforeIBlockElementAdd', [ | |
EventHandlers::class, | |
'on1CUserAddElement' | |
]); | |
$em->addEventHandler('iblock', 'OnBeforeIBlockElementUpdate', [ | |
EventHandlers::class, |
View HL Выборка
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
use Bitrix\Main\Loader; | |
Loader::includeModule("highloadblock"); | |
use Bitrix\Highloadblock as HL; | |
use Bitrix\Main\Entity; | |
$hlbl = 1; // Указываем ID нашего highloadblock блока к которому будет делать запросы. | |
$hlblock = HL\HighloadBlockTable::getById($hlbl)->fetch(); |
View CUrl
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
$url = 'https://domain.pr/anything'; | |
$headers = ['Content-Type: application/json']; // заголовки нашего запроса | |
$post_data = [ // поля нашего запроса | |
'field1' => 'val_1', | |
'field2' => 'val_2', | |
]; | |
$data_json = json_encode($post_data); // переводим поля в формат JSON |
View toTop
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{ |
View loader.php
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({ |
View update.php
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'] // новое значение свойства | |
]); | |
?> |
View gist:88bb697ff0d99a8b817edb0c7592a04e
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']; | |
} |
View template.php
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'] | |
); |
NewerOlder