Skip to content

Instantly share code, notes, and snippets.

View megamosk's full-sized avatar
🎯
Focusing

megamosk

🎯
Focusing
View GitHub Profile
@shoman4eg
shoman4eg / footerasset.php
Created March 22, 2017 11:36
Bitrix js in footer
<?php
use Bitrix\Main\Page\Asset;
class FooterAsset
{
const LOCATION = 'FOOTER_LOCATION';
public static function addJs($src, $options = [])
{
@glooer
glooer / select_now.php
Created November 22, 2017 21:43
bitrix d7 orm выбор только активных элементов (с учетом даты)
<php
\Bitrix\Iblock\ElementTable::GetList([
'filter' => [
'ACTIVE' => 'Y',
[
"LOGIC" => "OR",
'<ACTIVE_FROM' => new \Bitrix\Main\DB\SqlExpression("NOW()"),
'ACTIVE_FROM' => null,
],
@FlameInTheDark
FlameInTheDark / include.discount.city.name.php
Last active April 7, 2024 17:14
Добавление кастомных условий для модуля скидок в 1C Bitrix
<?php
/**
* Добавление кастомного условия для скидок.
* Подключить данный файл в init.php
*
* В данном примере устанавливается проверка города сохраненного в сессии
*/
use Bitrix\Main\Loader;
Loader::includeModule('catalog');
@andrei99
andrei99 / Debug;
Last active July 26, 2023 14:30
d7 bitrix
\Bitrix\Main\Diag\Debug::writeToFile($signatureValue, '$signatureValue', '__#params_1.log');
//php 8.1
https://www.sng-it.ru/snippet/oshibki-pri-perekhode-sayta-na-bitrikse-na-php-8-1.html
//платежка
https://g-rain-design.ru/blog/posts/payment-handlers-bitrix-d7/
@SeRGei93
SeRGei93 / bitrix remove all orders
Created August 6, 2021 10:40
Битрикс удалить все заказы
<?
if (!isset($_SERVER['DOCUMENT_ROOT']) || !$_SERVER['DOCUMENT_ROOT']) {
$_SERVER['DOCUMENT_ROOT'] = dirname(__DIR__);
}
require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php");
\Bitrix\Main\Loader::includeModule('sale');
use Bitrix\Sale;