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 | |
| /** @var modx $modx */ | |
| switch ($modx->event->name) { | |
| case 'pdoToolsOnFenomInit': | |
| /** @var Fenom $fenom */ | |
| $fenom->addModifier('modName', function ($input) use ($modx) { | |
| /** @var modx $modx */ | |
| //here your code | |
| 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
| <svg class="icon icon--home"> | |
| <use xlink:href="home.svg#home"></use> | |
| </svg> |
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
| создаём плагин на событие - OnHandleRequest | |
| <?php | |
| if ($modx->event->name != "OnHandleRequest" || $modx->context->key == 'mgr') { | |
| return; | |
| } | |
| if ($_SERVER['REQUEST_URI'] != '/') { | |
| if(substr($_SERVER['REQUEST_URI'], -1) === '/'){ | |
| $new_url = preg_replace("#/$#", "", $_SERVER['REQUEST_URI']); | |
| $modx->sendRedirect('http://'.$_SERVER["SERVER_NAME"].$new_url,array('responseCode' => 'HTTP/1.1 301 Moved Permanently')); |
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
| https://modx.pro/solutions/10040-add-your-fields-in-the-order-form/ | |
| https://dart.agency/blog/modx/kak-dobavit-dopolnitelnoe-pole-k-zakazu-v-minishop2.html | |
| https://modx.pro/solutions/7037-expanding-any-table-modx/#comment-84315 | |
| Инструкция: | |
| 1)В системных настройках добавляем свои поля в ms2_order_address_fields | |
| 2)Создаём плагин на событие OnMODXInit для расширения модели БД | |
| <?php | |
| switch ($modx->event->name) { |
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
| Расширение любых таблиц MODX - https://modx.pro/solutions/7037-expanding-any-table-modx/ |
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
| $_lang['autotag'] = 'Авто-метка'; | |
| $_lang['text'] = 'Текст'; | |
| $_lang['textarea'] = 'Текстовая область'; | |
| $_lang['textareamini'] = 'Текстовая область (мини)'; | |
| $_lang['richtext'] = 'Текстовый редактор'; | |
| $_lang['dropdown'] = 'Выпадающий список'; | |
| $_lang['listbox'] = 'Список (одиночный выбор)'; | |
| $_lang['listbox-multiple'] = 'Список (множественный выбор)'; | |
| $_lang['list-multiple-legacy'] = 'Устаревший список множественного выбора'; | |
| $_lang['option'] = 'Переключатели (radio)'; |
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 | |
| switch ($modx->event->name) { | |
| case 'msOnManagerCustomCssJs': | |
| if ($page != 'orders') return; | |
| $modx->controller->addHtml(" | |
| <script type='text/javascript'> | |
| Ext.ComponentMgr.onAvailable('minishop2-grid-orders', function(){ | |
| Ext.override(miniShop2.grid.Orders , { | |
| getMenu: function (grid, rowIndex) { |
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
| Вывести все доступные объекты в плагине | |
| $modx->log(1, print_r(array_keys($scriptProperties),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
| $address = $modx->getObject('msOrderAddress', $id); |