- Создаём страницу типа XML с пустым шаблоном, в содержимое пихаем
Содержимое страницы.xml
и указываем в &parents id ресурсов откуда выводить материал - Добавляем сниппет
htmlspecialchars
с кодом изhtmlspecialchars.php
для экранизации символов и добавление полного пути к картинкам, указываем папку с картинками - Добавляем чанк
tpl_turborss
с кодом изrss_tpl.tpl
для вывода элементов, заменяем код для вывода картинок на нужные tv и тд
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 | |
// Создаём снипет, например geolocation | |
// тут его содержимое, а выводим его так | |
// [!geolocation? &need=`phone` &html=`1`!] | |
// $need - Запрос на вывод | |
if (!$need) | |
$need = 'phone'; // По умолчанию выводим телефон | |
// Нужные параметры | |
$cityDefault = 'Санкт-Петербург'; # город по умолчанию |
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 | |
$context = $modx->context->get('key'); | |
if ($context == 'mgr' || empty($_POST['quick_order']) || empty($_POST['id']) || empty($_POST['customer'])) { | |
return; | |
} | |
/** | |
* @var miniShop2 $miniShop2 | |
*/ | |
$miniShop2 = $modx->getService('minishop2'); | |
$miniShop2->initialize($context, array( |
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 | |
// Параметры | |
// $html = ''; Вывод с html | |
// $need = ''; Что нужно вывести, телефон или тд | |
if (!$need) | |
$need = 'phone'; // По умолчанию выводим телефон | |
$arrParam = array( | |
'google' => array( | |
'title' => 'Google good!', |
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
{if $payment.id != 1 } | |
<form action="https://money.yandex.ru/eshop.xml" method="post"> | |
<input name="shopId" value="" type="hidden"/> | |
<input name="scid" value="" type="hidden"/> | |
<input name="sum" value="{$total.cost | replace : ' ' : '' | number : 2 : '.' : ''}" type="hidden" min="1"> | |
<input name="customerNumber" value="{$address.phone}" type="hidden"/> | |
<input name="orderNumber" value="{$order.num}" type="hidden"/> | |
<input name="custAddr" value="{$order.address}" type="hidden"/> | |
<input name="cps_phone" value="{$address.phone}" type="hidden"/> | |
<input name="cps_email" value="{$user.email}" type="hidden"/> |
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
/*_____________________ VeryLazy ______________________*/ | |
function VeryLazy(){ | |
$(document).find('.home ._block').each(function(index, element){ | |
if ($(document).scrollTop() > $(this).offset().top - $(window).height()){ | |
$(this).addClass('active').find('img[data-src]').each(function() { | |
if ($('html').hasClass('webp') && $(this).data().webp) | |
$(this).attr('src', $(this).data().webp) | |
else | |
$(this).attr('src', $(this).data().src) | |
}) |
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 для валидатора html | |
//Создаём новый плагин "validate_html_fix", подключаем обработчик события OnWebPagePrerender и далее код плагина | |
<?php | |
$content = &$modx->resource->_output; | |
$content = str_replace('type="text/javascript"','', $content); | |
$modx->Event->output($content); |
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://docs.modx.pro/komponentyi/msearch2/snippetyi/mfilter2 | |
// https://masonry.desandro.com/methods.html | |
$('#mse2_results').masonry({ | |
// options | |
itemSelector: '.item4', | |
singleMode: false, | |
percentPosition: true, | |
horizontalOrder: true | |
}) |
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
<? | |
switch($modx->event->name) { | |
# Добавление или удаление товара, расчёт полной цены | |
case 'OnSHKbeforeCartLoad': # Перед загрузкой корзины, чтобы отследить изменение количества товара, события далее их не могут уловить (: | |
case 'OnSHKaddProduct': # Добавление товара | |
case 'OnSHKAfterRemoveProduct': # Удаление товара | |
# Если пользователь залогинен | |
$modx->log('Чего то добавили'); | |
$iId = $modx->user->get('id'); | |
if ($iId > 0) { |