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 | |
// msOnCreateOrder | |
// msOnChangeOrderStatus | |
switch ($modx->event->name) { | |
case 'msOnCreateOrder': | |
// Новый заказ | |
// $modx->log(xPDO::LOG_LEVEL_ERROR, 'msOnCreateOrder'); | |
$iOrderId = $msOrder->get('id'); | |
$oOrder = $order->get(); |
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 | |
class taggerCustomFilter extends mse2FiltersHandler { | |
/** | |
* Retrieves values from Tagger table | |
* | |
* @param array $fields | |
* @param array $ids | |
* | |
* @return array |
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 | |
$tplProduct = 3; //номер шаблона для карточки товара | |
$tplParent = 2; //номер шаблона для категорий | |
$tplChildParent = 2; //номер шаблона для подкатегорий | |
$idParent = 6; //id каталога товаров | |
$fileProduct = 'product.xml'; //имя файла с товарами | |
$xpath_expression['pagetitle'] = '//Товары/Номенклатура'; //DOM структура в XML файле до имени | |
$xpath_expression['article'] = '//Товары/Артикул'; //DOM структура в XML файле до артикула | |
$xpath_expression['parents'] = '//Товары/Родитель'; //DOM структура в XML файле до родителей |
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 | |
$tplProduct = 3; //номер шаблона для карточки товара | |
$tplParent = 2; //номер шаблона для категорий | |
$tplChildParent = 2; //номер шаблона для подкатегорий | |
$idParent = 6; //id каталога товаров | |
$fileProduct = 'product.xml'; //имя файла с товарами | |
$xpath_expression['pagetitle'] = '//Товары/Номенклатура'; //DOM структура в XML файле до имени | |
$xpath_expression['article'] = '//Товары/Артикул'; //DOM структура в XML файле до артикула | |
$xpath_expression['parents'] = '//Товары/Родитель'; //DOM структура в XML файле до родителей |
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 | |
/** | |
* Плагин для переадресации с url с UpperCase на LoverCase | |
*/ | |
$eventName = $modx->event->name; | |
switch($eventName) { | |
case 'OnHandleRequest': | |
if($modx->context->get('key') != "mgr"){ | |
if(isset($_GET['rewrite-strtolower-url'])) { |
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 | |
if (empty($parent)) {$parent = $modx->resource->id;} | |
$pids = array_merge(array($parent), $modx->getChildIds($parent)); | |
$ids = array(); | |
$q = $modx->newQuery('msProduct'); | |
$q->where(array('class_key' => 'msProduct','parent:IN' => $pids,'published' => 1,'deleted' => 0)); | |
$q->select('`msProduct`.`id`'); | |
if ($q->prepare() && $q->stmt->execute()) { | |
$ids = $q->stmt->fetchAll(PDO::FETCH_COLUMN); |
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
this.value = sum(this.value); | |
function sum(str) { | |
str=str.trim().replace(/[^\d\.]+/gi,""); | |
var s=str.indexOf(".",str.indexOf(".")); | |
if(s>=0){ | |
str=str.substr(0,s+3); | |
var whole = str.substr(0,s); | |
var fractional = str.substr(s+1, s+3).replace(/[^\d]+/gi,""); | |
str = whole +'.'+ fractional; | |
} |
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 | |
define('MODX_API_MODE', true); // Gotta set this one constant. | |
// Сбрасывает пароль и email существующего пользователя | |
// и задаёт его группу | |
$username = 'theusername'; | |
$password = 'newpassword'; | |
$email = 'new@email.com'; | |
$user_group = 1; // 1 для Administrator |
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
apt install sudo | |
sudo apt update | |
sudo apt install curl | |
sudo apt install software-properties-common | |
sudo apt install python-software-properties | |
sudo apt install language-pack-ru-base | |
sudo echo "ru_RU.CP1251 CP1251" >>/var/lib/locales/supported.d/ru | |
sudo locale-gen | |
sudo locale-gen en_US.UTF-8 | |
export LANG=en_US.UTF-8 |
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
Это возникает из за аналитики в шапке | |
<!— Global site tag (gtag.js) - Google Analytics —> | |
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-111032207-1"></script> | |
<script> | |
window.dataLayer = window.dataLayer || []; | |
function gtag(){dataLayer.push(arguments);} | |
gtag('js', new Date()); | |
gtag('config', 'UA-XXXXXXXXX-X'); | |
</script> |
NewerOlder