$q = $modx->newQuery('modResource'); $q->innerJoin('ShopmodxProduct', 'Product'); $q->where(array( "deleted" => 0, "published" => 1, )); $q->select(array( "modResource.*", )); $s = $q->prepare(); $s->execute(); while($row = $s->fetch(PDO::FETCH_ASSOC)){ // Ваш код }