Я думаю что частично разобрался в этом вопросе (код ниже). Назрел такой вопрос, как ограничить количество товара, выбираемого из каждой группы, например 4-мя?
class My_Shop_Controller_Show extends Shop_Controller_Show {
protected function _groupCondition() {
/*$this->_Shop_Items
->queryBuilder()
->where('shop_items.shop_group_id', '=', intval($this->group));
*/
if ($this->group) {
$this
->shopItems()
->queryBuilder()
->join('shop_groups', 'shop_groups.id', '=', 'shop_items.shop_group_id', array(
array('AND' => array('(')),
array('' => array('shop_groups.parent_id', '=', $this->group)),
array('OR' => array('shop_groups.id', '=', $this->group)),
array('' => array(')'))
));
} else {
$this
->shopItems()
->queryBuilder()
->where('shop_items.shop_group_id', '=', 0);
}
return $this;
}
}
$Shop_Controller_Show = new My_Shop_Controller_Show($oShop);