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
В init.php, а лучше в подключаемом в нем файле: | |
подписываемся на событие OnAdminTabControlBegin (событие OnAdminTabControlBegin вызывается в функции CAdminTabControl::Begin() при выводе в административном интерфейсе формы редактирования). | |
подписываемся на событие OnAdminListDisplay (Событие OnAdminListDisplay вызывается в функции CAdminList::Display() при выводе в административном разделе списка элементов). | |
use \Bitrix\Main\EventManager; | |
$eventManager = EventManager::getInstance(); | |
$eventManager->addEventHandler('main', 'OnAdminTabControlBegin', ['\LocalNamespase\Handlers', 'onAdminTabControlBegin']); | |
$eventManager->addEventHandler('main', 'OnAdminListDisplay', ['\LocalNamespase\Handlers', 'onAdminListDisplay']); |
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( | |
'sale', | |
'OnSaleComponentOrderJsData', | |
'OnSaleComponentOrderJsData_twinpx_yadelivery_hack' | |
); | |
function OnSaleComponentOrderJsData_twinpx_yadelivery_hack(&$arResult,&$arParams) | |
{ | |
if(\Bitrix\Main\Loader::includeModule('twinpx.yadelivery')){ | |
$headStings = \Bitrix\Main\Page\Asset::getInstance()->getStrings(); |
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
<? | |
class __WebSiteHelp{ | |
public static function getComponent($object){ | |
$component = false; | |
if($object instanceof CBitrixComponentTemplate){ | |
$component = $object->getComponent(); | |
}elseif($object instanceof CBitrixComponent){ | |
$component = $object; | |
} | |
return $component; |
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
<? | |
namespace Bas; | |
use Bitrix\Main\IO; | |
use Bitrix\Main\Application; | |
use CFile; | |
class Pict { | |
private static $isPng = true; |
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
<?php | |
class makeIblockElementUnion{ | |
static function GetListFilter($IBLOCK_ID, $arFilter, $arUnionBy, $limit, $arInputSort = array()){ | |
\Bitrix\Main\Loader::includeModule('iblock'); | |
$CIBlockElement = \Bitrix\Iblock\Iblock::wakeUp($IBLOCK_ID)->getEntityDataClass(); | |
if($CIBlockElement){ | |
if(empty($arInputSort)){ | |
$arInputSort["ID"] = "ASC"; |
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
// sku_id=>element_id | |
function GetLastViewed($limit = false){ | |
// \bitrix\components\bitrix\catalog.viewed.products\class.php #657 | |
$map = array(); | |
if (!Bitrix\Main\Loader::includeModule('catalog')){ | |
return array(); | |
} | |
if (!Bitrix\Main\Loader::includeModule('sale')){ | |
return array(); |
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
<? | |
$eventManager = \Bitrix\Main\EventManager::getInstance(); | |
$eventManager->addEventHandler('sale', '\Bitrix\Sale\Cashbox\Internals\CashboxCheck::OnBeforeAdd', 'StopPrintCheckForEmptyDeliveryService'); | |
function StopPrintCheckForEmptyDeliveryService(\Bitrix\Main\Event $event){ | |
$BITRIX_EMPTY_DELIVERY_ID = \Bitrix\Sale\Delivery\Services\EmptyDeliveryService::getEmptyDeliveryServiceId(); | |
$arParameters = $event->getParameters(); | |
$arFields = $arParameters['fields']; | |
if("sell" == $arFields['TYPE']){ |
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
<? | |
/* | |
* выбрать ID SKU для установки SKU по умолчанию, исходя из умного фильтра. | |
* */ | |
function getOffersSelectedByFilter(&$arResult, &$arParams, $component){ | |
//https://pai-bx.com/wiki/1c-bitrix/2357-filtered-sku-in-products-list/ | |
if(!empty($arParams['FILTER_NAME'])){ | |
global ${$arParams['FILTER_NAME']}; | |
$FILTER = ${$arParams['FILTER_NAME']}; | |
if(!empty($FILTER) && !empty($FILTER['OFFERS']) ) { |
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
Если перед вами встала задача по переносу пользователей из одного Битрикс в другой, то сделать это достаточно просто. | |
Для начала составьте таблицу соответствия групп пользователей, где ключи - id группы пользователей на первом сайте, а значения id соответствующей ему группы пользователей на втором. Примерно так: | |
$tableOfGroups = [ | |
'1' => 1, | |
'2' => 2, | |
'3' => 3, | |
'4' => 4, | |
'5' => 9, |
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
.youtube_auto_wrap{ | |
position:relative; | |
} | |
.youtube_auto_wrap .youtube_auto_wrap__preview{ | |
z-index: 10; | |
top: 0; | |
bottom: 0px; | |
left: 0px; | |
right: 0px; |
NewerOlder