Skip to content

Instantly share code, notes, and snippets.

View ASDAFF's full-sized avatar
🏠
Working from home

ASDAFF ASDAFF

🏠
Working from home
View GitHub Profile
<?
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();
<?
class YoutubeVideo
{
function __construct($video)
{
$this->video = $video;
}
private function Prefix()
AddEventHandler("catalog", "OnBeforeProductUpdate", "OnBeforeProductUpdateHandler");
function OnBeforeProductUpdateHandler($id, $arFields) {
global $DB;
$arMail = array();
// Если кол-во товара больше 0
if ($arFields["QUANTITY"] > 0) {
// Есть ли подписчики
$tableName = \Bitrix\Catalog\SubscribeTable::getTableName();
@ASDAFF
ASDAFF / fx_getSectionList.php
Created May 27, 2018 18:45 — forked from di7spider/fx_getSectionList.php
1С-bitrix :: Возвращает разделы и вложенные подразделы в иерархическом виде
<?php
/** Возвращает разделы и вложенные подразделы в иерархическом виде */
function getSectionList($filter, $select)
{
$dbSection = CIBlockSection::GetList(
Array(
'DEPTH_LEVEL' => 'ASC',
'SORT' => 'ASC'
),
@ASDAFF
ASDAFF / LICENCE SUBLIME TEXT
Created March 12, 2018 13:06 — forked from cprakashagr/LICENCE SUBLIME TEXT
Sublime Text 3 Serial key build is 3143
## Sublime Text 3 Serial key build is 3103
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
B085E65E 2F5F5360 8489D422 FB8FC1AA
@ASDAFF
ASDAFF / SublimeTextKey
Created March 12, 2018 13:04 — forked from Robbyzhaxx/SublimeTextKey
Sublime Text Licence Key
—– BEGIN LICENSE —–
TwitterInc
200 User License
EA7E-890007
1D77F72E 390CDD93 4DCBA022 FAF60790
61AA12C0 A37081C5 D0316412 4584D136
94D7F7D4 95BC8C1C 527DA828 560BB037
D1EDDD8C AE7B379F 50C9D69D B35179EF
2FE898C4 8E4277A8 555CE714 E1FB0E43
D5D52613 C3D12E98 BC49967F 7652EED2
@ASDAFF
ASDAFF / gist:6406cb9f52a7538b2666ed24376dcbcc
Created November 30, 2017 21:32 — forked from anonymous/gist:e54c8a2951d6e8c03f25db60646061de
Преобразование upd в модуль
<?php
//Полный путь к папке, в которой лежат "UPD" Последний слеш не нужен!
$dir = '/home/bitrix.dev/www/bitrix/your.upd.folder';
if ($handle = opendir($dir)) {
while (false !== ($entry = readdir($handle))) {
if($entry == "." || $entry == ".."){continue;}
$string = file_get_contents($dir."/".$entry);
$('.order').click(function(){
var ide = $(this).parent().find('input:hidden').val();
$.ajax({
type: "POST",
data: 'action=ADD2BASKET&ajax_basket=Y&id='+ide,
url: '/',
success: function(data){
data = data.split('\'').join('\u0022');
var obj = JSON && JSON.parse(data) || $.parseJSON(data);
if (obj.STATUS == 'OK'){
@ASDAFF
ASDAFF / hexagon-loader-pure-css.markdown
Created May 22, 2017 15:28
Hexagon Loader (Pure CSS)

Hexagon Loader (Pure CSS)

Decided to play around with Sass loops and see what kind of fun I could come up with. Just made a cool looking hexagon shaped loader. Don't forget to mess around with the SCSS settings!

A Pen by ASDAFF on CodePen.

License.

@ASDAFF
ASDAFF / Sort Fields
Last active April 4, 2017 15:17
Sort Fields
<!-- Sort Fields -->
<input name="sortby" value="pagetitle" type="hidden">
<input name="sortdir" value="asc" type="hidden">
<!-- Sort End -->