Параметр | Описание | Значение по умолчанию |
---|---|---|
$categoryId | id категории | Вывод из всех |
$tpl | шаблон для вывода | tpl.msCategoryOptions.row |
$active | Выводить только активные | Да(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
[[-Вывод и работа формы при помощи плагина formit в Modx Revo, где form_app_tpl чанк с самой формой]] | |
[[!FormIt? | |
&emailTpl=`form_app_tpl` | |
&formName=`Форма из приложения` | |
&hooks=`FormItSaveForm, email` | |
&emailSubject=`[[++site_name]]: Форма из приложения` | |
&emailTo=`[email protected]` | |
&emailFrom=`[email protected]` | |
&frontend_css=`` | |
]] |
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
// Весь js и masonry из CDN | |
// <script src="https://unpkg.com/masonry-layout@4/dist/masonry.pkgd.min.js"></script> | |
$(function(){ | |
// Адаптивная сетка товаров | |
// $('.block_products').masonry() | |
var $container = $(".rows") | |
$container.masonry() | |
// Адаптивная сетка товаров х | |
}) |
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
# Вытаскивание из базы | |
SELECT * FROM `modx_ms2_product_options` WHERE `key` = 'need_key' | |
# Поиск дублирующихся значений, мб разные и нужно что то с ними делать >.< | |
SELECT * FROM `modx_ms2_product_options` WHERE (`value` != '' AND `key` = 'key_from') AND (`value` != '' AND `key` = 'key_to') |
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 | |
// Перенос значений из одной опции в другую 0_о | |
// Параметры | |
$option_from = 'option_from_name'; # Из опции | |
$option_to = 'option_to_name'; # В опцию | |
// изсключаем из выборки значения опций которые не трогать | |
$sQuery = "SELECT product_id FROM `". $modx->getOption('table_prefix') ."ms2_product_options` WHERE `key` = '" . $option_to . "'"; | |
$strProdNoId = ''; # Исключаем из выборки |
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 | |
function text_error(){ | |
return false; | |
die(); | |
} | |
if(isset($_POST['org'])){ | |
if($hook->getValue('org')!=''){ | |
$modx->log(xPDO::LOG_LEVEL_ERROR, 'Ошибка заполнения формы: не пустое поле антиспама'); | |
$modx->log(xPDO::LOG_LEVEL_ERROR, print_r($_POST, 1)); | |
text_error(); |
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 | |
// msOnCreateOrder | |
// msOnChangeOrderStatus | |
switch ($modx->event->name) { | |
case 'msOnCreateOrder': | |
// Новый заказ | |
// $modx->log(xPDO::LOG_LEVEL_ERROR, 'msOnCreateOrder'); | |
$iOrderId = $msOrder->get('id'); | |
$oOrder = $order->get(); |
!Нид джекуери
Параметр | Описание | дефаулт |
---|---|---|
vrtpr_d | Задержка перед началом печати | 200 |
vrtpr_d_prev_del | Задержка перед началом удаления | 200 |
vrtpr_d_print | Максимум для рандомной задержки перед вводом буквы | 333 |
vrtpr_d_del | Максимум для рандомной задержки перед удалением буквы | 100 |
!Нид джекуери
Параметр | Описание | Что писать |
---|---|---|
secaftl | Блок к которому крутить, и который загружать | обое название без особых символов |
secaftl_show | К какой секции скролить | secaftl |
secaftl_show_find | К чему в секции скролить | id элемента |
secaftl_load | Откуда загрузить контент в секцию | url |
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
// После открытия окна, запускаем tinyMCE, с сейвом данных когда теряется фокус с поля | |
$(document).on('afterShow.fb', function( e, instance, slide ) { | |
if ( $(this).find('textarea').length > 0 ) | |
tinyMCE.init({ | |
'selector':'textarea', | |
'setup' : function (editor) { | |
editor.on('change', function () { | |
tinymce.triggerSave() | |
}) | |
} |