Skip to content

Instantly share code, notes, and snippets.

@davidkryzaniak
davidkryzaniak / gist:5109218
Created March 7, 2013 16:18
Articles Plugin for MODx
//inside both create.js and update.js
xtype: 'superboxselect'
,fieldLabel: _('articles.article_tags')
,description: _('articles.article_tags_help')
,name: 'tags'
,id: 'modx-resource-tags'
,anchor: '100%'
,store: [
['Tag 1','Tag 1'],
@shvind
shvind / gist:8273223
Created January 5, 2014 20:14
getViewed - Сниппет вывода просмотренных товаров для minishop2
<?php
$id = $modx->resource->id;
$tpls = explode(',', $modx->getOption('ms2_template_product_default'));
if (!isset($limit)) {$limit = 10;}
if (!isset($tpl)) {$tpl = 'tpl.msProducts.row';}
// Вносим ID просмотренных товаров
if (in_array($modx->resource->template, $tpls)) {
if (!isset($_SESSION['viewed'])) {
@finalfantasia
finalfantasia / fixing_text_anti_aliasing_in_fedora.md
Last active March 20, 2024 22:53
Fixing Text Anti-aliasing in Fedora
  1. Add the RPMFusion repositories (both free and non-free) to the YUM repository directory (/etc/yum.repos.d/):
sudo dnf localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
  1. Install the patched version of FreeType with subpixel rendering enabled:
sudo dnf install -y freetype-freeworld
[[!mFilter2?
&parents=`7`
&element=`msProducts`
&tpl=`_tpl.msProducts.row`
&filters=`
parent:categories
,ms|price:number
`
@antk25
antk25 / Вывод количества товаров в категории.php
Created September 5, 2016 14:15
Вывод количества товаров в категории minishop2 Сниппет получает сумму всех товаров в категории, с учетом мультикатегорий MS2. Можно указать нужную категорию параметром $parent.
<?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);
@ig0r74
ig0r74 / tvfilter.tpl
Last active September 8, 2019 19:58
Как в MODX (pdoResources) сортировать/выводить данные по диапазону чисел в TV-параметре?
[[pdoResources?
&tpl=`showList`
&includeTVs=`number,image`
&limit=`10`
&prepareTVs=`number`
&where=`{"number:>=":"010","number:<=":"100"}`
]]
[[!pdoPage?
&limit=`5`
@Rachind
Rachind / modx-minishop2-carttable-row-cost-update.txt
Created May 1, 2017 08:48
Обновление суммы в строчке корзины miniShop2
Обновление суммы в строчке корзины miniShop2
Javascript:
---------------------------------
change: function () {
var callbacks = miniShop2.Cart.callbacks;
callbacks.change.response.success = function (response) {
var num_v = $('#'+response.data.key).find('input[name=count]').val();
var pri = $('#'+response.data.key).find('input[name=price]').val();
var td_pri = parseFloat(pri)*num_v;
<script src="https://api-maps.yandex.ru/2.1/?lang=ru_RU" type="text/javascript"></script>
<div id="map" style="width: 100%; height: 600px"></div>
<script type="text/javascript">
var elementExists = document.getElementById("map");
if (elementExists != null) {
ymaps.ready(init);
var myMap,
myPlacemark;
<?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) {
<?php
switch ($modx->event->name) {
case 'OnMODXInit':
$modx->loadClass('msOrderAddress');
$modx->map['msOrderAddress']['fields']['porch'] = 0;
$modx->map['msOrderAddress']['fieldMeta']['porch'] = array(
'dbtype' => 'varchar',
'precision' => 10,
'attributes' => '',