This file contains hidden or 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 | |
/* | |
* Автоматическая подстановка фильтров для mfilter2 | |
* alias = 1 - для генерации алиасов фильтров | |
* Автор: Алексей Митин, viplexa@gmail.com | |
* | |
* $alias - 1 для генерации алиасов фильтров | |
*/ | |
$alias = $alias ?: false; |
This file contains hidden or 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 | |
/* | |
* Хук компонента FormIt для отправки сообщений в Telegram | |
* Автор: Алексей Митин, viplexa@gmail.com | |
*/ | |
// Токен бота | |
$token = ""; | |
// Кому отправлять сообщение |
This file contains hidden or 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 | |
/* | |
* Консольный скрипт для обновления превью картинок в minishop2 для компонента Console | |
*/ | |
$step = 5; | |
$offset = isset($_SESSION['galgenoffset']) && $_SESSION['galgenoffset'] ? $_SESSION['galgenoffset'] : 0; | |
$miniShop2 = $modx->getService('minishop2'); | |
$modx->setLogLevel(MODX_LOG_LEVEL_ERROR); | |
$q = $modx->newQuery('msProductFile', array('parent' => 0)); |
This file contains hidden or 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
/* | |
* Плагин добавляет новые модификаторы для Fenom | |
* Автор: Алексей Митин, viplexa@gmail.com | |
*/ | |
<?php | |
switch ($modx->event->name) { | |
case 'pdoToolsOnFenomInit': | |
// Модификатор phone для вывода телефона без лишних знаков, пример 79009009090 |
This file contains hidden or 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
/* | |
* Плагин для связки компонента mSync и msOptionPrice2 | |
* Автор: Алексей Митин, viplexa@gmail.com | |
*/ | |
<?php | |
switch($modx->event->name) { | |
case 'mSyncOnProductImport': | |
// Подмена pagetitle у товара, если в 1с используется не основное поле с названием |
This file contains hidden or 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 | |
/* | |
* Плагин добавляет в категорию "Новинки" товары помеченные как "новый" либо удаляет из этой категории, если флаг снят | |
* Автор: Алексей Митин, viplexa@gmail.com | |
*/ | |
switch($modx->event->name) { | |
case 'OnDocFormSave': | |
$categoryNewId = 1; // ID категории с новинками | |
This file contains hidden or 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 | |
/* | |
* Рекурсивный поиск родительской категории | |
* Автор: Алексей Митин, viplexa@gmail.com | |
* | |
* $mainId - конечная родительская категория | |
* $tvName - название не пустой TV с которой нужно получить данные | |
* $id - ID ресурса с которого начать поиск | |
*/ |
This file contains hidden or 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 | |
/* | |
* Рекурсивный поиск родительской категории в основном каталоге | |
* Автор: Алексей Митин, viplexa@gmail.com | |
* | |
* $mainId основной каталог | |
* $id айди с которого начать поиск | |
*/ | |
if(empty($mainId)) return ''; |
This file contains hidden or 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 | |
/* | |
* Сниппет для разбивки элементов на группы для pdoResources | |
* Автор: Алексей Митин, viplexa@gmail.com | |
*/ | |
// Количество элементов в группе, по умолчанию 2 | |
$numberInGroup = $numberInGroup ? $numberInGroup : 2; | |
// Snippet для обработки |
This file contains hidden or 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 | |
/* | |
* Быстрое изменение домена в конфигах при переносе modx | |
* Автор: Алексей Митин, viplexa@gmail.com | |
*/ | |
$domain = "ТЕКУЩИЙ ДОМЕН"; | |
$files = [ | |
"config.core.php", |
NewerOlder