Skip to content

Instantly share code, notes, and snippets.

View Advanc8d's full-sized avatar
🏠
Working from home

Andrey Advanc8d

🏠
Working from home
View GitHub Profile
@Advanc8d
Advanc8d / README.md
Created August 14, 2017 08:05 — forked from grachov/README.md
Снятие с публикации купленных товаров для miniShop2

Установка:

  • файл unpublish.class.php разместить в директории core/components/product_unpublish/processors/resource/
  • создать плагин, скопировав содержимое файла plugin.php. Если необходимо снимать с публикации товары сразу после покупки, отмечаем для плагина событие msOnCreateOrder. Если необходимо снимать с публикации товары при получении заказом определенного статуса, необходимо отметить событие msOnChangeOrderStatus для плагина и поменять в коде 99 на ID статуса заказа.
@Advanc8d
Advanc8d / modx-snippets.php
Created December 8, 2017 17:58 — forked from christianhanvey/modx-snippets.php
Useful snippets for MODX Revo
Snippet: [[SnippetName]]
Chunk: [[$ChunkName]]
System Setting: [[++SettingName]]
TV: [[*fieldName/TvName]]
Link tag: [[~PageId? &paramName=`value`]]
Placeholder: [[+PlaceholderName]]
<?php
@Advanc8d
Advanc8d / msDisplayFields.php
Created January 17, 2018 13:57 — forked from zhabinka/msDisplayFields.php
Скрываем поля и закладки [MiniShop2] в зависимости от шаблона - http://2geek.pro/solutions/70-skryivaem-polya-minishop2-v-zavisimosti-ot-shablona
<?php
/* OnManagerPageBeforeRender */
switch ($modx->event->name) {
case 'OnDocFormPrerender':
if ($mode !== 'upd') {
return '';
}
if (!$template = $resource->get('template')) {
return '';
@Advanc8d
Advanc8d / msCart.tpl
Created July 10, 2018 14:37 — forked from vgrish/msCart.tpl
msopModification
{$_modx->lexicon->load('minishop2:product')}
<div id="msCart">
{if !count($products)}
{'ms2_cart_is_empty' | lexicon}
{else}
<div class="table-responsive">
<table class="table table-striped">
<tr class="header">
<th class="image">&nbsp;</th>
@Advanc8d
Advanc8d / gist:db7c2f5280832b602f5c12b19453292d
Last active April 8, 2020 11:34 — forked from vgrish/gist:b6998560c6a64c0f34109a9e632b9b56
msOptions & msProductOptions sort example
[[!msOptionsPrice.initialize?]]
<h1>[[*pagetitle]]</h1>
<div id="msProduct" class="row">
<div class="col-md-6">
[[!msGallery]]
</div>
<div class="col-md-6">
<form class="form-horizontal ms2_form msoptionsprice-product" method="post">
<h3 class="msoptionsprice-name msoptionsprice-[[*id]]">[[*pagetitle]]</h3>
@Advanc8d
Advanc8d / MIGX fenom
Created October 30, 2018 10:35 — forked from Sentinel-7/MIGX fenom
MIGX fenom
{foreach $_modx->resource['adv.Index'] | fromJSON as $item}
<div class="col-xs-12 col-sm-6 col-md-4">
<div class="icon-box left media p-0 mb-40">
<div class="media-left pull-left"><i class="{$item['icon']} text-theme-colored"></i></div>
<div class="media-body">
<p class="media-heading heading h5">{$item['title']}</p>
<p>{$item['desc']}</p>
</div>
</div>
</div>
@Advanc8d
Advanc8d / ral_standard.csv
Created March 27, 2019 16:50 — forked from lunohodov/ral_classic.csv
RAL Standard Color Table (CSV)
RAL RGB HEX German English French Spanish Italian Nederlands
RAL 1000 190-189-127 #BEBD7F Grünbeige Green beige Beige vert Beige verdoso Beige verdastro Groenbeige
RAL 1001 194-176-120 #C2B078 Beige Beige Beige Beige Beige Beige
RAL 1002 198-166-100 #C6A664 Sandgelb Sand yellow Jaune sable Amarillo arena Giallo sabbia Zandgeel
RAL 1003 229-190-001 #E5BE01 Signalgelb Signal yellow Jaune de sécurité Amarillo señales Giallo segnale Signaalgeel
RAL 1004 205-164-052 #CDA434 Goldgelb Golden yellow Jaune or Amarillo oro Giallo oro Goudgeel
RAL 1005 169-131-007 #A98307 Honiggelb Honey yellow Jaune miel Amarillo miel Giallo miele Honinggeel
RAL 1006 228-160-016 #E4A010 Maisgelb Maize yellow Jaune maïs Amarillo maiz Giallo polenta Maisgeel
RAL 1007 220-156-000 #DC9D00 Narzissengelb Daffodil yellow Jaune narcisse Amarillo narciso Giallo narciso Narcissengeel
RAL 1011 138-102-066 #8A6642 Braunbeige Brown beige Beige brun Beige pardo Beige marrone Bruinbeige
@Advanc8d
Advanc8d / in_array_vs_isset_vs_array_key_exists.php
Created January 27, 2020 09:41 — forked from alcaeus/in_array_vs_isset_vs_array_key_exists.php
Performance comparision: in-array vs. isset vs. array_key_exists
<?php declare(strict_types = 1);
function testPerformance($name, Closure $closure, $runs = 1000000)
{
$start = microtime(true);
for (; $runs > 0; $runs--)
{
$closure();
}
$end = microtime(true);
@Advanc8d
Advanc8d / seoProKeywordConvertor
Created January 27, 2020 13:27 — forked from frisospeulman/seoProKeywordConvertor
Converts keyword tv to seoPro Keywords objectCreate a snippet and run it on a blank page.
<?php
/**
* Convert your keyword tv to Sterc's SeoPro
*
* Please read the following.
* Everytime you run this snippet, your keywords within seoPro will be overwritten.
* Make sure the TV exists before runnig this code.
*
*/
$seoPro = $modx->getService('seopro', 'seoPro', $modx->getOption('seopro.core_path', null, $modx->getOption('core_path') . 'components/seopro/') . 'model/seopro/', $scriptProperties);
@Advanc8d
Advanc8d / header_http_status_codes.php
Created February 17, 2020 11:42 — forked from phoenixg/header_http_status_codes.php
PHP header() for sending HTTP status codes
<?php
/*
参考自:
http://darklaunch.com/2010/09/01/http-status-codes-in-php-http-header-response-code-function
http://snipplr.com/view/68099/
*/
function HTTPStatus($num) {
$http = array(