1. Создаем файл
modules/shop/item/observer.php
<?php
defined('HOSTCMS') || exit('HostCMS: access denied.');
class Shop_Item_Observer
{
static public function onBeforeRedeclaredGetXml($object, $args)
{
$object->showXmlWarehousesItems(TRUE);
}
}
2. В файл
bootstrap.php в самый конец добавляете
Core_Event::attach('shop_item.onBeforeRedeclaredGetXml', array('Shop_Item_Observer', 'onBeforeRedeclaredGetXml'));
3. В XSL-шаблон товара добавляете
<xsl:template match="shop_item">
...
<h2>Остатки на складах</h2>
<xsl:apply-templates select="shop_warehouse_item" />
4. Ту да же добавляете отдельный template
<xsl:template match="shop_warehouse_item">
<xsl:variable name="shop_warehouse_id" select="shop_warehouse_id" />
<p><xsl:value-of select="/shop/shop_warehouse[@id = $shop_warehouse_id]/name" /><xsl:text>: </xsl:text><strong><xsl:value-of select="count" /></strong><xsl:text> </xsl:text><xsl:value-of select="../shop_measure/name" /></p>
</xsl:template>
5. Работать будет с версии 6.0.8