Skip to content

Instantly share code, notes, and snippets.

Avatar

Володя vgrish

View GitHub Profile
View msopOnModificationSave.php
<?php
if ($modx->event->name != 'msopOnModificationSave') {
return;
}
$modification = $modx->getOption('modification', $scriptProperties);
if (!$modification) {
return;
}
View psOnSubscriptionSave.php
<?php
/* @var array $scriptProperties */
if ($modx->event->name != "psOnSubscriptionSave") {
return;
}
$mode = $modx->getOption('mode', $scriptProperties);
$subscription = $modx->getOption('subscription', $scriptProperties);
View tpl.msListOrders.tpl
<div id="mslistorders">
{if !count($orders)}
{'mslistorders_orders_empty' | lexicon}
{else}
<div class="table-responsive">
<table class="table table-striped">
<tr class="header">
<th class="num">{'mslistorders_num' | lexicon}</th>
<th class="createdon">{'mslistorders_createdon' | lexicon}</th>
<th class="updatedon">{'mslistorders_updatedon' | lexicon}</th>
View gist:5851415d53a1f452107fef931d2b1409
if (!window.FB) window.FB = {
_apiKey: null,
_session: null,
_userStatus: "unknown",
_logging: true,
_inCanvas: window.location.search.indexOf("fb_sig_in_iframe=1") > -1 || window.location.search.indexOf("session=") > -1 || window.location.search.indexOf("signed_request=") > -1 || window.name.indexOf("iframe_canvas") > -1 || window.name.indexOf("app_runner") > -1,
_https: window.name.indexOf("_fb_https") > -1,
_domain: {
api: "https://api.facebook.com/",
api_read: "https://api-read.facebook.com/",
@vgrish
vgrish / msOptionsPrice.modification.tpl
Last active Dec 14, 2018
tpl.msOptionsPrice.modification processOptions
View msOptionsPrice.modification.tpl
<div class="row ms2_product">
<div class="col-md-8">
<form method="post" class="ms2_form">
<a href="{$rid | url}">{$product_pagetitle}</a>
{if $_pls['small']?}
<img src="{$_pls['small']}" alt="{$product_pagetitle}" title="{$product_pagetitle}"/>
{else}
<img src="{'assets_url' | option}components/minishop2/img/web/ms2_small.png"
srcset="{'assets_url' | option}components/minishop2/img/web/ms2_small@2x.png 2x"
View msOptions.php
<?php
/** @var modX $modx */
/** @var array $scriptProperties */
$tpl = $modx->getOption('tpl', $scriptProperties, 'tpl.msOptions');
if (!empty($input) && empty($product)) {
$product = $input;
}
if (!empty($name) && empty($options)) {
$options = $name;
}
@vgrish
vgrish / 1.md
Created Jan 29, 2017
msOptionsColor
View 1.md

Вызов на странице продукта

[[msOptionsColor?options=`color`]]

Вызов в чанке корзине

{if $product.options?}
	{set $colors = $_modx->runSnippet('!msOptionsColor',[
		'product' => $product.id,
View checkbox.tpl
```
[[!msOptions?
&options=`tags`
&tpl=`tpl.msOptions.pasta`
]]
```
tpl.msOptions.pasta
```
View tpl.msOptionsPrice.modification.tpl
<div class="row ms2_product">
<div class="col-md-8">
<form method="post" class="ms2_form">
<a href="{$rid | url}">{$product_pagetitle}</a>
{if $_pls['120x90']?}
<img src="{$_pls['120x90']}" alt="{$product_pagetitle}" title="{$product_pagetitle}"/>
{else}
<img src="{'assets_url' | option}components/minishop2/img/web/ms2_small.png"
srcset="{'assets_url' | option}components/minishop2/img/web/ms2_small@2x.png 2x"
@vgrish
vgrish / msGetOrder.php
Last active May 11, 2018
add payment link
View msGetOrder.php
<?php
/** @var modX $modx */
/** @var array $scriptProperties */
/** @var miniShop2 $miniShop2 */
$miniShop2 = $modx->getService('miniShop2');
$miniShop2->initialize($modx->context->key);
/** @var pdoFetch $pdoFetch */
if (!$modx->loadClass('pdofetch', MODX_CORE_PATH . 'components/pdotools/model/pdotools/', false, true)) {
return false;
}