Здравствуйте,
в hostCMS я добавил новый интернет-магазин, в нем создал несколько групп с подгруппами. Мне теперь нужно вывести эти группы с помощью PHP.
Как мне это можно реализовать?
Ранее у меня была похожая задача только с информационными системами, вот как я это сделал:
В самом макете прописал вот так
<?php
$Informationsystem_Controller_Show = new Informationsystem_Controller_Show(
Core_Entity::factory('Informationsystem', 23));
$Informationsystem_Controller_Show
->xsl(
Core_Entity::factory('Xsl')->getByName('Каталог')
)
->limit(99)
->group(false)
->groupsMode('all')
->show();
?>
Вот XSL шаблон:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:hostcms="http://www.hostcms.ru/"
exclude-result-prefixes="hostcms">
<xsl:output xmlns="http://www.w3.org/TR/xhtml1/strict" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" encoding="utf-8" indent="yes" method="html" omit-xml-declaration="no" version="1.0" media-type="text/xml"/>
<xsl:template match="/">
<div id="multi-derevo">
<h1><a href="/products/">Продукция</a></h1>
<hr/>
<xsl:apply-templates select="/informationsystem"/>
</div>
</xsl:template>
<xsl:template match="/informationsystem">
<ul>
<xsl:apply-templates select="informationsystem_group"/>
</ul>
</xsl:template>
<xsl:template match="informationsystem_group">
<li style="margin-bottom: 2px;">
<a href="{url}" class="for_click"><xsl:value-of disable-output-escaping="yes" select="name"/></a>
<xsl:if test="informationsystem_group">
<ul style="display: none; list-style-type: disc;" class="subgrp">
<xsl:apply-templates select="informationsystem_group"/>
</ul>
</xsl:if>
</li>
</xsl:template>
</xsl:stylesheet>
Мне теперь тоже самое нужно сделать только для интернет магазина, заранее большое спасибо!