Добрый день,
В ТДС, добавил:
//Warehouses
if (Core_Array::getGet('warehouse_items_id'

)
{
$iwarehouseitemid = intval(Core_Array::getGet('warehouse_item_id'

);
$Shop_Controller_Show->addEntity(
Core::factory('Core_Xml_Entity'

->name('shop_warehouse_items_id'

->value($iwarehouseitemid)
);
$Shop_Controller_Show->shopItems()
->shopItems()
->queryBuilder()
->leftJoin('shop_warehouse_items', 'shop_warehouse_items.shop_item_id', '=', 'shop_items.id'

->having('SUM(shop_warehouse_items.count)', '>', 0)
->groupBy('shop_items.id'

;
}
и
// XML-сущность, к которй будут добавляться warehouse
$oWarehousesXmlEntity = Core::factory('Core_Xml_Entity'

->name('Warehouses'

;
// Добавляем XML-сущность контроллеру показа
$Shop_Controller_Show->addEntity($oWarehousesXmlEntity);
// Список производителей
$oshop_warehouse_items = $oShop->shop_warehouse_items;
$oshop_warehouse_items->queryBuilder()
->leftJoin('shop_warehouse_items', 'shop_warehouse_items.shop_item_id', '=', 'shop_warehouse_items.id'

->having('SUM(shop_warehouse_items.count)', '>', 0)
->groupBy('shop_items.id'

;
$ashop_warehouse_items = $oshop_warehouse_items->findAll();
foreach ($ashop_warehouse_items as $oshop_warehouse_items)
{
// Добавляем производителя потомком XML-сущности
$oWarehousesXmlEntity->addEntity(
$oShop_warehouse->clearEntities()
);
}
$Shop_Controller_Show
->xsl(
Core_Entity::factory('Xsl'

->getByName($xslName)
)
->itemsProperties(TRUE)
->show();
в XSL55 добавил:
<div class="sorting">
<!-- Если есть на складе -->
<xsl:if test="count(shop_warehouse_items) > 0">
На складе: 
<select name="shop_warehouse_items_id">
<option value="0">…</option><xsl:apply-templates select="shop_warehouse_items/count"/>
</select> 
</xsl:if>
</div>
и
<!-- Шаблон для фильтра warehouse -->
<xsl:template match="shop_warehouses">
<xsl:param name="shop_warehouses_items_id" select="@id"/>
<option value="{@id}">
<xsl:if test="@id = /shop/warehouses">
<xsl:attribute name="selected"> </xsl:attribute>
</xsl:if>
<xsl:value-of disable-output-escaping="yes" select="name"/>
</option>
</xsl:template>
но конечно ничего не работает:
Exception: The property 'shop_warehouse_items' does not exist in the model 'shop'
29 modules\core\exception.php
1177 modules\core\orm.php
284 hostcmsfiles\lib\lib_6\lib_6.php
209 modules\lib\model.php
100 modules\core\page.php
16 templates\template18\template.htm
73 modules\template\model.php
100 modules\core\page.php
123 templates\template17\template.htm
73 modules\template\model.php
100 modules\core\page.php
363 modules\core\command\controller\default.php
171 modules\core\router\route.php
205 index.php