Константин

Константин

Был в сети 28 октября 2024, 18:13
Заказы принимаю
{$_modx->runSnippet('!mFilter2', [
	'element' => 'msProducts',
	'class' => 'msProduct',
	'limit' => 12,
	'tplOuter' => 'mFilter2OuterTpl',
	'tpl' => 'gridProductTpl',
	'includeTVs' => 'available',
	'includeThumbs' => 'medium',
	'sortby' => '{ "parent":"ASC","menuindex":"ASC" }',
	'tplPagePrev' => '@INLINE <li><a class="" href="{$href}"><i class="fa fa-angle-left" aria-hidden="true"></i></a></li>',
	'tplPageNext' => '@INLINE <li><a class="" href="{$href}"><i class="fa fa-angle-right" aria-hidden="true"></i></a></li>',
	'tplPagePrevEmpty' => '@INLINE <li><a class="" href="{$href}"><i class="fa fa-angle-left" aria-hidden="true"></i></a></li>',
	'tplPageNextEmpty' => '@INLINE <li><a class="" href="{$href}"><i class="fa fa-angle-right" aria-hidden="true"></i></a></li>',
	'tplPageFirst' => '',
	'tplPageLast' => '',
	'tplPageFirstEmpty' => '',
	'tplPageLastEmpty' => '',
	'filters' => 'msoption|marka,
		          msoption|model,
            	ms|vendor:vendors,
            	parent:parents',
            	
	'aliases' => 'ms|vendor==vendor,
			     msoption|marka==marka,
				 msoption|model==model',
			'tplFilter.outer.default' => 'filterSelectOuter',
	        'tplFilter.row.default' => 'filterSelectRow',
	        
			'tplFilter.outer.vendor' => 'filterCheckboxOuter',
	        'tplFilter.row.vendor' => 'filterCheckboxRow',
	        
	        'tplFilter.outer.marka' => 'filterSelectOuter',
	        'tplFilter.row.marka' => 'filterSelectRow',
	        
	        'tplFilter.outer.model' => 'filterSelectOuter',
	        'tplFilter.row.model' => 'filterSelectRow',
	        
	        'tplFilter.outer.resource|parent:parents' => 'filterSelectOuter',
	        'tplFilter.row.resource|parent:parents' => 'filterSelectRow',
	
])}
<?php
/** @var modX $modx */
/** @var modResource $resources */
$resources = $modx->getChildIds(211,6,array('context' => 'web'));
foreach ($resources as $res) {
    $res->setTVValue('seodescription',$res->get('pagetitle'));
    $res->set('isfolder', 1);
    $res->save();
}
Попробую так, ошибки
Fatal error: Uncaught Error: Call to a member function setTVValue() on int in