Skip to content

Instantly share code, notes, and snippets.

@Sentinel-7
Last active August 19, 2021 09:44
Show Gist options
  • Save Sentinel-7/00144f9bfe1c38e5d03f29461d48038e to your computer and use it in GitHub Desktop.
Save Sentinel-7/00144f9bfe1c38e5d03f29461d48038e to your computer and use it in GitHub Desktop.
достаем картинки для товаров, когда нужно вывести пару картинок для одной карточке в списке
{'!msProducts' | snippet : [
'parents'=>$_modx->resource.id,
'leftJoin' => '{ "images": { "class":"msProductFile","alias":"images", "on": "images.product_id = msProduct.id AND images.path LIKE \'%/small/\'" }}',
'select' => '{ "images":"GROUP_CONCAT(images.url SEPARATOR \';;\') as images"}',
'limit'=>0,
'sortby'=>'menuindex',
'sortdir'=>'ASC',
'showLog'=>0,
'tpl'=>'@FILE chunks/item/product.tpl'
]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment