This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ext.override(miniShop2.panel.Product, { | |
getProductFields: function (config) { | |
var enabled = miniShop2.config.data_fields; | |
var available = miniShop2.config.extra_fields; | |
var product_fields = this.getAllProductFields(config); | |
var col1 = []; | |
var col2 = []; | |
var tmp; | |
for (var i = 0; i < available.length; i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$parents = file_exists(MODX_BASE_PATH . 'parents.txt')?json_decode(file_get_contents(MODX_BASE_PATH . 'parents.txt'), true):[]; | |
//print_r($parents); | |
$ress = $modx->getCollection('modResource'); | |
foreach($ress as $res){ | |
$content = $res->get('content'); | |
preg_match_all('/\[\[\~(\d+)\~{0,}\]\]/', $content, $links); | |
if($links[1]){ | |
foreach($links[1] as $k => $lnk){ | |
if(isset($parents[$lnk])){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//настройки для коннекта к artegifts.by | |
$portobelloUrlTree = 'products_description_xml_cdata001.xml'; //весь каталог товаров (логин/пароль выдаются) | |
$portobelloUrlStock = 'minskstocks.xml'; //наличие товаров (логин/пароль выдаются) | |
//настройки для парсинга и установки шаблонов для создаваемых продуктов | |
$fileCatExist = dirname(__FILE__).'/arte_category_exist.txt'; //сопоставление категорий на сайте (родителей для товаров) с выгрузкой (индивидуально для сайтов) | |
//настройки для обработки товаров | |
$tplProduct = 6;//номер шаблона для карточки товара |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$modx->addPackage('colorsProducts', MODX_CORE_PATH . 'components/colorsProducts/model/'); | |
for($idx=1;$idx <= 20;$idx++){ | |
$url = 'https://colorscheme.ru/ncs-colors-'.$idx.'.html'; | |
$options = array( | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_HEADER => false, | |
CURLOPT_FOLLOWLOCATION => true, | |
CURLOPT_ENCODING => "", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$modx->addPackage('colorsProducts', MODX_CORE_PATH . 'components/colorsProducts/model/'); | |
$url = 'https://ral.ru/classic_colours'; | |
$options = array( | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_HEADER => false, | |
CURLOPT_FOLLOWLOCATION => false, | |
CURLOPT_ENCODING => "", | |
CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DirectoryIndex index.php | |
RewriteEngine On | |
RewriteBase / | |
# Rewrite www.example.com -> example.com | |
RewriteCond %{HTTP_HOST} . | |
RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC] | |
RewriteRule ^(.*)$ https://%1/$1 [R=301,L] | |
# Force rewrite to https for every host |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin to add a "created by" field on a resource form and moves "published on" to document tab | |
* | |
* @var modX $modx | |
* @var array $scriptProperties | |
* | |
* @event OnDocFormPrerender | |
*/ | |
$dateFormat = $modx->getOption('manager_date_format',null,'d.m.Y'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
a=`ps ax|grep 3310|grep -v grep|wc -l` | |
echo $a | |
if (( "$a" < 1 )); then | |
/usr/bin/docker start 21ab17aeab7b | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* на основе статьи https://pocketadmin.tech/ru/%D1%80%D0%B0%D0%B1%D0%BE%D1%82%D0%B0-%D1%81-4-%D0%B2%D0%B5%D1%80%D1%81%D0%B8%D0%B5%D0%B9-api-google-%D1%82%D0%B0%D0%B1%D0%BB%D0%B8%D1%86%D1%8B-%D0%BD%D0%B0-php/ | |
* библиотека wget https://github.com/googleapis/google-api-php-client/releases/download/v2.7.2/google-api-php-client-v2.7.2-PHP7.0.zip | |
* номер ячейки, из которой следует брать остатки товара, указывается в TV поле товара | |
* остатки записываются в другое TV поле (при желании можно записать хоть куда) | |
*/ | |
if (!isset($modx)) { | |
define('MODX_API_MODE', true); | |
while (!isset($modx) && ($i = isset($i) ? --$i : 10)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//настройки для коннекта к portobello.ru | |
$portobelloUrlTree = 'https://portobello.ru/export/new-products.xml'; //весь каталог товаров | |
$portobelloUrlStock = 'https://portobello.ru/export/new-products-quantity.xml'; //наличие товаров | |
//настройки для парсинга и установки шаблонов для создаваемых продуктов | |
$fileProductGroups = dirname(__FILE__).'/portobello_groups.txt'; | |
$fileCatExist = dirname(__FILE__).'/portobello_category_exist.txt'; | |
//настройки для обработки товаров |