Вывод товаров

Как вывести товары id производителя которых текущий ресурс?

{'!pdoPage' | snippet : [
				        'element' => 'msProducts',
                        'tpl' => '@FILE chunks/product.tpl', 
                        'parents' => 6,
                        'limit' => $limit,
                        'depth' => 4,
                        'includeTVs' => 'views',
                        'includeContent' => 1,
                        'processTVs' => 1,
                        'tvPrefix' => '',
                        'where' => '{
                        	"vendor.resource":"$_modx->resource.id"
                        }',
                        'sortby' => $sortby,
                        'sortdir' => $direction,
 
                    ]}
Aslero
17 марта 2019, 16:55
modx.pro
454
0

Комментарии: 1

Дмитрий Середюк
17 марта 2019, 21:48
0
{'!msProducts' | snippet :[
    'parents'              => 6,
    'resources'            => -$_modx->resource.id,
    'where'                => ['Data.vendor'=>$vendor]|json_encode,
    'tpl'                  => 'msProducts_vendor_tpl',
    'toPlaceholder'        => 'item'
 ]}
{if 'item' | placeholder}
    <div class="container">
        <h3>Другие товары этого бренда<span>{'vendor.name' | placeholder}</span></h3>
        <div class="el_wrap">
            {'item'   | placeholder}
        </div>
    </div>
{/if}
    Авторизуйтесь или зарегистрируйтесь, чтобы оставлять комментарии.
    1