Skip to content

Instantly share code, notes, and snippets.

@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);
[[!mFilter2?
&parents=`7`
&element=`msProducts`
&tpl=`_tpl.msProducts.row`
&filters=`
parent:categories
,ms|price:number
`
@finalfantasia
finalfantasia / fixing_text_anti_aliasing_in_fedora.md
Last active April 20, 2025 19:39
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
@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'])) {
@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'],