Вывод всех товаров производителя (vendor:name=pagetitle)

У меня созданы ресурсы с названием производителей.
Созданы сами производители, привязаны к этим ресурсам.
В товарах указаны эти производители.

В ресурсе я хочу вывести все товары каталога производителя равного pagetitle текущей странице.
Но получаю пустые результаты, подскажите как правильно.
Пробую так:
{$_modx->runSnippet('!mFilter2', [
            'element' => 'msProducts',
            'class' => 'msProduct',
            'suggestions' => '1',
            'parents' => 20,
            'resources' => '',
            'depth' => '',
            'where' => '{"Vendor.name":"$_modx->resource.pagetitle"}'
            'sort' => 'ms_product|publishedon:desc,ms_product|createdby:desc,ms|price:asc',
            'filters' => 'ms|price:number,ms|vendor:vendors,resource|parent:categories',
            'aliases' => 'ms|price==price,ms|vendor==vendor,resource|parent==category',
            'includeThumbs' => 'small,medium',
            'tplOuter' => 'tpl-mFilter2.outer',
            'tplFilter.outer.default' => 'tpl-mFilter2.filter.outer',
            'tplFilter.outer.price' => 'tpl-mFilter2.filter.slider',
            'tplFilter.row.price' => 'tpl-mFilter2.filter.number',
            'tpls' => 'tpl-shop-item,tpl-shop-item_list',
            'limit' => '12',
        ])}
Сергей Карпович
04 декабря 2022, 11:22
modx.pro
350
0

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

Alexey
04 декабря 2022, 11:40
0
У $_modx->resource.pagetitle убрать кавычки?
    Артур Шевченко
    04 декабря 2022, 12:17
    +2
    Либо так
    'where' => ["Vendor.name" => $_modx->resource.pagetitle]
    Либо так
    'where' => '{ "Vendor.name":" '~$_modx->resource.pagetitle~' " }'
      Сергей Карпович
      04 декабря 2022, 16:33
      0
      Заработало в таком виде:
      'where' => ["Vendor.name" => $_modx->resource.pagetitle]
      Спасибо
      Авторизуйтесь или зарегистрируйтесь, чтобы оставлять комментарии.
      3