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 | |
$parent_id = $modx->resource->parent; | |
if ($parent_id == 0) { | |
return; | |
} | |
$parents = $modx->getParentIds($modx->resource->id, 10, array('context' => 'web')); | |
$parents = array_reverse($parents); | |
if ($parents[1] == 21) { | |
if ($cur_catalog = $modx->getObject('modResource',$parents[3])) { | |
if ($only_moskow = $cur_catalog->getTVvalue('only_moskow')){ |
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 | |
$templates = array(13,18,19); | |
foreach ($templates as $template) { | |
//Получаем количество товаров с положительным рейтингом | |
$query = $modx->newQuery('modResource'); | |
$query->select(array('modResource.id as id','TemplateVarResources.value as value')); | |
$query->innerJoin('modTemplateVarResource','TemplateVarResources'); | |
$query->where(array( | |
'TemplateVarResources.tmplvarid:=' => '133', |
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 (!$tv) return; | |
$tv_value = $modx->resource->getTVvalue($tv); | |
if (!$tv_value) { | |
$catalog_sections = false; | |
$parents_array = $modx->getParentIds($modx->resource->id); | |
foreach ($parents_array as $parent) { | |
if ($parent !== 0) { | |
$obj = $modx->getObject('modResource',$parent); | |
$tv_value = $obj->getTVvalue($tv); |
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 | |
require_once MODX_ASSETS_PATH . 'ArrayToXML.php'; | |
$feeds = $developer = $complexes = $sales_info = array(); | |
$site_url = $modx->getOption('site_url'); | |
//Информация о застройщике | |
$developer['id'] = $developer_id; | |
$developer['name'] = $developer_name; | |
$developer['phone'] = $developer_phone; |
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 | |
$id = $resource->get('id'); | |
$currentRes = $modx->getObject('modResource', $id); | |
$template = $currentRes->get('template'); | |
//Шаблон товара "Кухня" | |
if ($template == 13) { | |
$cg = 'k_color_groups'; | |
$sg = 'k_style_groups'; | |
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 | |
class mcrm { | |
public $baseUrl = "******"; | |
public $resto_key = "****"; | |
function __construct(modX &$modx, array $config = array()) | |
{ | |
$this->modx =& $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 | |
require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/config.core.php'; | |
require_once MODX_CORE_PATH . 'model/modx/modx.class.php'; | |
$modx = new modX(); | |
$modx->initialize('web'); | |
$modx->getService('error', 'error.modError', '', ''); | |
$path = MODX_CORE_PATH.'components/ajax/processors/web/'; |
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 | |
//СОЗДАНИЕ ИЛИ ОБНОВЛЕНИЕ ГРУПП | |
$groups = array( | |
array('id' => 1,'sortorder' => 1,'label' => 'Общие'), | |
array('id' => 2,'sortorder' => 2,'label' => 'Почта'), | |
array('id' => 3,'sortorder' => 3,'label' => 'Политика и куки'), | |
array('id' => 4,'sortorder' => 4,'label' => 'Социальные сети'), | |
); | |
foreach ($groups as $group) |
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(PICTURE_UPLOAD_PATH, MODX_ASSETS_PATH . 'images/vhodnye/'); | |
$mes = array(); | |
$bravo = $modx->getService('bravo', 'bravo', MODX_CORE_PATH.'components/bravo/'); | |
$data = $bravo->getImport(); //Весь каталог | |
$products = $bravo->getProducts($data); //Все товары с Браво | |
$colors = $bravo->getIdsColors($data); //Все цвета с Браво | |
$categories = $bravo->getCategoriesIds(); //Список категорий | |
$siteProducts = $bravo->getSiteProductsBravo([28]); //Все товары входных дверей с сайта |
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 | |
$res = array(); | |
$q = $modx->newQuery('modTemplateVarResource', array('tmplvarid' => $tv_id)); | |
$template_id = 28; | |
$template_id = explode(',',$template_id); | |
$q->innerJoin('modResource', 'modResource', "modResource.id = modTemplateVarResource.contentid"); | |
$q->select('contentid,value,modResource.template'); | |
$q->where(array( | |
'modResource.template:IN' => $template_id, | |
'modResource.published' => 1, |
OlderNewer