Skip to content

Instantly share code, notes, and snippets.

View sashabeep's full-sized avatar

Sasha Beep sashabeep

View GitHub Profile
@sashabeep
sashabeep / evoshop.module.php
Last active October 20, 2017 09:27
Evoshop view orders module
if(IN_MANAGER_MODE!='true' && !$modx->hasPermission('exec_module')) die('<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the MODX Content Manager instead of accessing this file directly.');
$moduleurl = 'index.php?a=112&id='.$_GET['id'].'&';
$txt = $modx->runSnippet('DocLister', array( 'controller' => 'onetable',
'table' => 'evoshop_orders',
'idField' => 'id',
'tpl' => '@CODE:<tr><td>[+id+]</td><td>[+orderdata+]</td><td><b>[+price+]</b></td><td>[+date+]</td><td>[+email+]</td><td>[+phone+]</td><td align="center"><a href="'.$moduleurl.'action=remove&amp;eid=[+id+]"><i class="fa fa-trash-o"></i></a></td></tr>',
'orderBy'=>'id ASC',
'selectFields'=>'id,price,date,email,phone,content',
@sashabeep
sashabeep / shoptable_prepare.php
Created October 20, 2017 09:27
prepare snippet for EvoShop orders view module
<?php
$content = $data['content'];
$itemsArr = json_decode($content, true);
foreach($itemsArr as $k => $v){
$evoShopItems .='<li><b><a target="_blank" href='.$modx->config['site_url'].$v['link'].'>'.$v['name'].'</a></b> x '.$v['quantity'].' шт, <b>'.$v['price'].'</b> руб</li>';
$total = $total + ($v['quantity']*$v['price']);
}
$evoShopItems .= '</ul>';
$data['orderdata'] = $evoShopItems;
<?php
if(!defined('MODX_BASE_PATH')) {die('What are you doing? Get out of here!');}
//параметры
$files = isset($files) ? $files : ''; // Список файлов (css, scss, less)
$minify = isset($minify) ? $minify : '1'; //сжымать и минифицировать файлы
$folder = isset($folder) ? $folder : ''; // папка для сгенерированных стилей по умолчанию в корень
//$inline = isset($inline) ? $inline : ''; // инлайн код стилей
//$parse = isset($parse) ? $parse : '0'; //обрабатывать ли теги MODX
@sashabeep
sashabeep / eg2sg.php
Last active April 2, 2018 07:36
Script for moving from EvoGallery to SimpleGallery
<?php
define('MODX_API_MODE', true);
define('MODX_BASE_PATH', __DIR__ . '/');
define('MODX_BASE_URL', '/');
define('MODX_SITE_URL', 'http://sitename.ru/');
include_once("index.php");
$modx->db->connect();
if (empty ($modx->config)) {
$modx->getSettings();
@sashabeep
sashabeep / zerobased.php
Created January 9, 2018 11:08
Zero based iteration placeholder for DocLister
<?php
/*USAGE:
DocLister?prepare=`zerobased`
call in @TPL: [+iteration_zerobased+]
*/
$data['iteration_zerobased'] = $data['iteration']-1;
return ($data);
@sashabeep
sashabeep / send.php
Last active June 15, 2020 08:32 — forked from webag/send.php
Добавление контакта и сделки в amocrm
see https://gist.github.com/sashabeep/401be029521c6a8c698c9bbd3dbc50a0
@sashabeep
sashabeep / sbpay.php
Created February 26, 2019 11:27
Sberbank payment
<?php
/**
* ДАННЫЕ ДЛЯ ПОДКЛЮЧЕНИЯ К ПЛАТЕЖНОМУ ШЛЮЗУ
*
* USERNAME Логин магазина, полученный при подключении.
* PASSWORD Пароль магазина, полученный при подключении.
* GATEWAY_URL Адрес платежного шлюза.
* RETURN_URL Адрес, на который надо перенаправить пользователя
* в случае успешной оплаты.
$('.owl-carousel-carousel').owlCarousel({
loop:true,
margin:20,
nav:true,
dots:false,
responsive:{
0:{
items:1
},
600:{
@sashabeep
sashabeep / BaseController_pagebuilder_part.php
Last active January 19, 2021 22:28
Evo 2.0 pagebuilder controller
...
$this->data['pagebuilder'] = $this->evo->runSnippet('PageBuilder', ['renderTo' => 'array'])[0];
...
@sashabeep
sashabeep / bootstrap3-flex.css
Created January 22, 2020 20:52
bootstrap 3 flex
@media only screen and (min-width: 481px) {
.grid-group-wrapper.row {
display: flex;
flex-wrap: wrap;
}
.grid-group-wrapper.row:after,
.grid-group-wrapper.row:before {
display: flex;
}