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 | |
use Bitrix\Main\ArgumentException; | |
use Bitrix\Main\Loader; | |
use Bitrix\Main\LoaderException; | |
use Bitrix\Main\ObjectPropertyException; | |
use Bitrix\Main\SystemException; | |
/** | |
* Отформатированный вывод массива |
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
<? require_once($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_before.php'); | |
use Bitrix\Main\Application; | |
use Bitrix\Main\Loader; | |
use Bitrix\Main\LoaderException; | |
use Bitrix\Sale\Order; | |
use Bitrix\Sale\Delivery; | |
use Bitrix\Sale\PaySystem; | |
use Bitrix\Sale\Basket; | |
use Bitrix\Currency\CurrencyManager; |
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 | |
use \Bitrix\Main\Loader; | |
use \Bitrix\Main\SystemException; | |
use \Bitrix\Sale; | |
use \Bitrix\Main\UserTable; | |
use \Bitrix\Main\EventManager; | |
$eventManager = EventManager::getInstance(); | |
$eventManager->addEventHandler('sale', 'OnOrderNewSendEmail', 'customSaleMails'); |
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
Для создания кастомизированного правила работы с корзиной на сайт необходимо: | |
1. Скопировать файл saleactiondiscountfromdirectory.php в папку сайта рядом с init.php (либо в /local/php_interface/init.php либо /bitrix/php_interface/init.php либо /bitrix/php_interface/ID сайта/init.php). | |
2. Подключить файл saleactiondiscountfromdirectory.php в init.php: | |
include "saleactiondiscountfromdirectory.php"; | |
3. Создать Highload блок. Импортировать файл discount_hlb.xml со структурой hl-блока на странице ваш-сайт/bitrix/admin/highloadblock_import.php | |
4. Создать записи в 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
<?php | |
use \Bitrix\HighLoadblock as HL; | |
use \Bitrix\Main\Loader; | |
use \Bitrix\Main\SystemException; | |
use \Bitrix\Main\ObjectPropertyException; | |
define('CATALOG_IBLOCK_ID', 17); // ID Инфоблока Каталога. | |
define('SKU_CATALOG_IBLOCK_ID', 20); // ID Инфоблока Торговые предложения. | |
define('BRAND_IBLOCK_ID', 12); // 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
<?php | |
use Bitrix\Main\Loader; | |
use Bitrix\Main\LoaderException; | |
const CATALOG_IBLOCK_ID = 17; // ID Инфоблока Каталога | |
function fetchAllProducts() | |
{ | |
try { |
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 | |
/** | |
* Beautiful display var_export. | |
* Вывести в отформатированном формате var_export. | |
* | |
* @return mixed | |
*/ | |
function pre_export($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
<?php | |
/*** | |
* Get info data from Highload block | |
* @param $HighLoadBlockID | |
* @param array $selectArray | |
* @param array $filterArray | |
* @param array $orderArray | |
* @param $limit | |
* @return \Bitrix\Main\ORM\Query\Result | |
* @throws \Bitrix\Main\ArgumentException |
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 | |
use Bitrix\Main\Application; | |
use Bitrix\Main\Diag\Debug; | |
use Bitrix\Main\Loader; | |
use Bitrix\Main\LoaderException; | |
$request = Application::getInstance()->getContext()->getRequest(); | |
function is_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
<? | |
$cacheId = 'flowersSKU'; | |
$cacheTtl = '604800000'; // 7 дней срок в миллисекундах. | |
$cache = \Bitrix\Main\Application::getInstance()->getManagedCache(); | |
/*** | |
* Проверка на наличие слуществующего кэша с таким ID, | |
* если есть, то записываем в переменную $resOffers, | |
* иначе cохраняем результат функции в кэш. | |
*/ |
NewerOlder