This file contains 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 | |
define('MODX_API_MODE', true); | |
require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/index.php'; | |
$modx->getService('error','error.modError'); | |
$modx->setLogLevel(modX::LOG_LEVEL_ERROR); | |
$modx->setLogTarget('FILE'); | |
if ($_SERVER['HTTP_X_REQUESTED_WITH'] != 'XMLHttpRequest') { | |
$modx->sendRedirect($modx->makeUrl($modx->getOption('site_start'),'','','full')); //отфильтровываем все не ajax запросы | |
} |
This file contains 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 | |
define('MODX_API_MODE', true); | |
require_once(dirname(__FILE__).'/index.php'); | |
// Включаем обработку ошибок | |
$modx->getService('error','error.modError'); | |
$modx->setLogLevel(modX::LOG_LEVEL_ERROR); | |
$modx->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML'); | |
$modx->error->message = null; // Обнуляем переменную | |
$parent = 15; |
This file contains 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 | |
if (!isset($modx)) { | |
define('MODX_API_MODE', true); | |
while (!isset($modx) && ($i = isset($i) ? --$i : 10)) { | |
if (($file = dirname(!empty($file) ? dirname($file) : __FILE__) . '/index.php') AND !file_exists($file)) { | |
continue; | |
} | |
require_once $file; | |
} | |
if (!is_object($modx)) { |
This file contains 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 | |
/* | |
* API для Долями | |
* by i.modx@ya.ru / andronex | |
* интеграция от 20 т.р. | |
*/ | |
use VKolegov\DolyameAPI\DolyameAPIClient; | |
use VKolegov\DolyameAPI\Entities\OrderInfo; | |
use VKolegov\DolyameAPI\Entities\OrderItems; | |
use VKolegov\DolyameAPI\Entities\RefundResponse; |
This file contains 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
function onFormSubmit(e) { | |
if( e ) { | |
values = e.range.getValues(); | |
theNewRow = values[0]; | |
var response = UrlFetchApp.fetch('https://test.ru/assets/components/newsletters/googleform_hook.php?id=1&form=TestForm&data='+theNewRow, {'muteHttpExceptions': true}); | |
Logger.log(response); | |
} | |
} |
This file contains 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 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 | |
$tablePrefix = $modx->getOption(xPDO::OPT_TABLE_PREFIX); | |
$modx->addPackage('colorsproducts', $modx->getOption('core_path') . 'components/colorsproducts/model/', $tablePrefix); | |
$in = json_decode(file_get_contents('https://www.ceresit-coloursofnature.com/api/facade-designer/categories/6'), true); | |
print_r($in['data']['colours']); | |
foreach($in['data']['colours'] as $color){ | |
if($color['images']['thumb']){ | |
$name_img = mb_strtolower(end(explode('/', $color['images']['thumb']))); |
This file contains 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 | |
/* | |
*плагин для переключения контекстов | |
*/ | |
// Работаем только на фронте | |
if ($modx->event->name != 'OnHandleRequest' || $modx->context->key == 'mgr') {return;} | |
// Определяем запрашиваемый хост | |
$host = $_SERVER['HTTP_HOST']; |
This file contains 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 | |
/* | |
* API для Я.Маркет плейсмаркета | |
* by i.modx@ya.ru / andronex | |
* интеграция от 12 т.р. | |
*/ | |
//шлём заголовки | |
header('Access-Control-Allow-Origin: *'); | |
header('Content-type: application/json; charset=utf-8'); |
This file contains 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 | |
/* сопоставление категорий каталога happygifts с сайтом | |
* @array id категории happy, название, id аналогичной категории на сайте | |
*/ | |
$in = [[910,'Аксессуары для красоты','174'], | |
[2713,'Аромаподарки','14240'], | |
[3433,'Пробники ароматов','33'], | |
[701,'Деловые и офисные аксессуары','79'], | |
[1366,'Дождевики','14621'], | |
[733,'Ежедневники и бизнес-блокноты','195'], |
NewerOlder