Skip to content

Instantly share code, notes, and snippets.

<?php
/* define package */
define('PKG_NAME','LexiconMini');
define('PKG_NAME_LOWER',strtolower(PKG_NAME));
define('PKG_VERSION','0.0.1');
define('PKG_RELEASE','beta1');
/* define paths */
.col-ms-1,
.col-ms-2,
.col-ms-3,
.col-ms-4,
.col-ms-5,
.col-ms-6,
.col-ms-7,
.col-ms-8,
.col-ms-9,
.col-ms-10,
@maxpoletaev
maxpoletaev / msVendors.php
Created November 22, 2013 09:17
Snippet for MiniShop2. Get vendors from category.
<?php
$pdo = $modx->getService('pdoTools');
$fieldName = $modx->getOption('fieldName', $scriptProperties, 'vendor');
$fieldClass = $modx->getOption('fieldClass', $scriptProperties, '');
$firstOption = $modx->getOption('firstOption', $scriptProperties, '');
$parent = $modx->getOption('parent', $scriptProperties, 0);
$depth = $modx->getOption('depth', $scriptProperties, 10);
$limit = $modx->getOption('limit', $scriptProperties, 100);
$tplOuter = $modx->getOption('tplOuter', $scriptProperties, '@INLINE <select name="[[+name]]" class="[[+class]]">[[+rows]]</select>');
@firepol
firepol / bootstrap_ms.css
Last active September 23, 2020 19:14 — forked from andyl/bootstrap_ms.css
updated max-width: 767px to avoid breaking the existing behavior on col-sm
.col-ms-1,
.col-ms-2,
.col-ms-3,
.col-ms-4,
.col-ms-5,
.col-ms-6,
.col-ms-7,
.col-ms-8,
.col-ms-9,
.col-ms-10,
@codedokode
codedokode / js-task-1.md
Last active May 18, 2025 16:40
Задания на яваскрипт (простые)
@grachov
grachov / msOrder
Created May 3, 2015 21:14
Простой способ для пересчета стоимости заказа после его изменения
<?php
class msOrder extends xPDOSimpleObject
{
public function updateProducts()
{
$originalContext = $this->xpdo->context->get('key');
$this->xpdo->switchContext($this->get('context'));
$originalMiniShop = isset($this->xpdo->services['minishop2']) ? $this->xpdo->services['minishop2'] : null;
$cart = array();
foreach ($this->getMany('Products') as $product) {
@iftee
iftee / bootstrap-480-767-grid.css
Last active June 30, 2017 11:51
Custom Bootstrap 3 Grid for 480-767px Layout
/**
* Custom Bootstrap 3 grid for 480-767px layout
* Author: Iftakhar Hasan
*
* A new set of column classes (with class prefix .col-ms- ) for Bootstrap 3
* to make Medium Small grids for supporting 480-767px
*
* This will push the default Bootstrap 3 Extra Small column (class prefix .col-xs- )
* to support 1-479px instead of 1-767px
*/
@cod3cow
cod3cow / svg.js
Created June 3, 2015 13:59
Replace all SVG images with inline SVG using jQuery
/*
* Replace all SVG images with inline SVG
*/
jQuery('img.svg').each(function(){
var $img = jQuery(this);
var imgID = $img.attr('id');
var imgClass = $img.attr('class');
var imgURL = $img.attr('src');
jQuery.get(imgURL, function(data) {
@davidpede
davidpede / xpdo-where
Last active February 5, 2025 16:24
pdoResources where examples
&where=`{ "template:IN" : [ 1,2,3 ] }
&where=`{ "template:NOT IN" : [ 1,2,3 ] }
&where=`[{"alias:LIKE":"foo%", "OR:alias:LIKE":"%bar"},{"OR:pagetitle:=":"foobar", "AND:description:=":"raboof"}]`
@OlegShchavelev
OlegShchavelev / index.js
Last active December 22, 2020 00:57
Стоимость доставки отдельной строкой в Minishop2 (после </body>)
<script>
miniShop2.Order.deliveryCost = '#ms2_delivery_cost';
miniShop2.Callbacks.Order.getcost.response.success = function(response) {
var rdc = response.data['delivery_cost'];
if(rdc) $(miniShop2.Order.deliveryCost, miniShop2.Order.order).text(miniShop2.Utils.formatPrice(rdc));
else $(miniShop2.Order.deliveryCost, miniShop2.Order.order).text('0');
}