Skip to content

Instantly share code, notes, and snippets.

# все на https, кроме файла обмена с 1С (не работает он по https)
RewriteCond %{HTTP:X-HTTPS} !1
RewriteCond %{REQUEST_URI} !^/bitrix/admin/1c_exchange\.php$ [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
AddEventHandler("catalog", "OnBeforeProductUpdate", "OnBeforeProductUpdateHandler");
function OnBeforeProductUpdateHandler($id, $arFields) {
global $DB;
$arMail = array();
// Если кол-во товара больше 0
if ($arFields["QUANTITY"] > 0) {
// Есть ли подписчики
$tableName = \Bitrix\Catalog\SubscribeTable::getTableName();
// init.php
\Bitrix\Main\EventManager::getInstance()->addEventHandler(
'fileman',
'OnBeforeHTMLEditorScriptRuns',
'OnBeforeHTMLEditorScriptRunsHandler'
);
function OnBeforeHTMLEditorScriptRunsHandler() {
$path = '/local/templates/.default/';
\CJSCore::RegisterExt('citfact_html_edit', [
<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");
use Bitrix\Main\Mail\Event,
Bitrix\Main\Application,
\Bitrix\Main\Loader;
Loader::includeModule("iblock");
$request = Application::getInstance()->getContext()->getRequest();