Как сделать вывод товаров в категории из её дочерних подкатегорий !!

#
Как сделать вывод товаров в категории из её дочерних подкатегорий !!
Как сделать вывод товаров в категории из её дочерних подкатегорий !!
Желатьно ответ, а не сылочки ,я уже пол форума перечитал,
1 - там во многих темазх старый движок
2 - некоторые темы по этому поводу так и не доведены до логического окончания !

сайт http://santehdiskont.ru - нужно чтобы на странице http://santehdiskont.ru/shop/ были не только категории , а и товары которые местяться и их подкатегориях

#
Re: Как сделать вывод товаров в категории из её дочерних подкатегорий !!
Можете разместить этот код перед вызовом метода ShowShop(в коде типовой динамической страницы магазина):
$mas_group = array();
$mas_group = $shop->GetGroupsTree($GLOBALS['shop_item_path']['group'], $current_shop_id, $mas_group);
$set = array();
$set = SetGroups($mas_group, $set);

$param['current_group_id'] = array($GLOBALS['shop_item_path']['group']);
$external_propertys['ТекущаяГруппа'] = $GLOBALS['shop_item_path']['group'];

foreach ($set as $key => $value)
{
$param['current_group_id'][] = $value;
};
$param['xml_show_group_type'] = 'all';

После чего в коде XSL-шаблона для списка товаров при определении текущей группы нужно брать не значение атрибута @current_group_id тега shop, а значение того дополнительного тега(содержащего идентификатор группы), который вы передадите в XML(через дополнительный тег ТекущаяГруппа). В коде XSL-шаблона списка товаров необходимо заменить строку:
<xsl:variable name="parent_group_id" select="@current_group_id"/>


на блок:
<xsl:variable name="parent_group_id"><xsl:choose>
<xsl:when test="/shop/ТекущаяГруппа/node()"><xsl:value-of select="/shop/ТекущаяГруппа"/></xsl:when>
<xsl:otherwise><xsl:value-of select="/shop/@current_group_id"/></xsl:otherwise>
</xsl:choose></xsl:variable>


строку:
<xsl:if test="count(/shop/group[@id = /shop/@current_group_id]/propertys/property) > 0">


на сроку:
<xsl:if test="count(/shop/group[@id = $parent_group_id]/propertys/property) > 0">


строку:
<xsl:if test="count(/shop/group[@id = /shop/@current_group_id]/propertys/property)">


на блок:
<xsl:variable name="parent_group_id"><xsl:choose>
<xsl:when test="/shop/ТекущаяГруппа/node()"><xsl:value-of select="/shop/ТекущаяГруппа"/></xsl:when>
<xsl:otherwise><xsl:value-of select="/shop/@current_group_id"/></xsl:otherwise>
</xsl:choose></xsl:variable>

<xsl:if test="count(/shop/group[@id = $parent_group_id]/propertys/property)">


строку:
<xsl:apply-templates select="/shop/group[@id = /shop/@current_group_id]/propertys/property[@parent_id = $dir_id]"/>


на строку:
<xsl:apply-templates select="/shop/group[@id = $parent_group_id]/propertys/property[@parent_id = $dir_id]"/>


строку:
<xsl:variable name="parent_group_id" select="/shop/@current_group_id"/>


на блок:
<xsl:variable name="parent_group_id"><xsl:choose>
<xsl:when test="/shop/ТекущаяГруппа/node()"><xsl:value-of select="/shop/ТекущаяГруппа"/></xsl:when>
<xsl:otherwise><xsl:value-of select="/shop/@current_group_id"/></xsl:otherwise>
</xsl:choose></xsl:variable>


строку:
<xsl:param name="parent_group_id" select="/shop/@current_group_id"/>


на блок:
<xsl:param name="parent_group_id"><xsl:choose>
<xsl:when test="/shop/ТекущаяГруппа/node()"><xsl:value-of select="/shop/ТекущаяГруппа"/></xsl:when>
<xsl:otherwise><xsl:value-of select="/shop/@current_group_id"/></xsl:otherwise>
</xsl:choose></xsl:param>
#
Re: Как сделать вывод товаров в категории из её дочерних подкатегорий !!
2 ошибки
1 -  Undefined index: shop_item_path
2 - Fatal error: Call to undefined function setgroups()
#
Re: Как сделать вывод товаров в категории из её дочерних подкатегорий !!
prox, вы куда код вставили? Приведите получившийся код типовой динамической страницы полностью.

#
Re: Как сделать вывод товаров в категории из её дочерних подкатегорий !!
Всё спасибо, вё пашет, походу я туплю сегодня
#
Re: Как сделать вывод товаров в категории из её дочерних подкатегорий !!
Единственно что, пропали списки групп , как их вернуть??
(мне на 1 листе нужен список груп и товаров и них и их подгруппах)

Когда нахажусь на главной список груп и товаров есть,
как только перехожу в подгруппу список груп пропадает

#
Re: Как сделать вывод товаров в категории из её дочерних подкатегорий !!
prox писал(а):
пропали списки групп, как их вернуть??
- попробуйте в метод ShowShop передать параметр: $param['xml_show_group_type'] = 'all';
#
Re: Как сделать вывод товаров в категории из её дочерних подкатегорий !!
http://santehdiskont.ru/shop/ - группы видны только здесь
и так передаёться
#
Re: Как сделать вывод товаров в категории из её дочерних подкатегорий !!
prox, в XML-коде группы есть? Если да, то вы, видимо, не произвели в XSL-шаблоне указанные мною ранее замены. Предоставьте код XSL-шаблона для списка товаров полностью.
#
Re: Как сделать вывод товаров в категории из её дочерних подкатегорий !!
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   <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"/>
   
   <xslecimal-format name="my" decimal-separator="," grouping-separator=" "/>
   
   <xsl:template match="/">
      <xsl:apply-templates select="/shop"/>
   </xsl:template>
   
   <!-- Шаблон для магазина -->
   <xsl:template match="/shop">
      
      <!-- Получаем ID родительской группы и записываем в переменную $parent_group_id -->
      <xsl:variable name="parent_group_id"><xsl:choose>
      <xsl:when test="/shop/ТекущаяГруппа/node()"><xsl:value-of select="/shop/ТекущаяГруппа"/></xsl:when>
      <xsl:otherwise><xsl:value-of select="/shop/@current_group_id"/></xsl:otherwise>
      </xsl:choose></xsl:variable>
      
      <!-- Если в находимся корне - выводим название информационной системы -->
      <xsl:if test="$parent_group_id = 0">
         <h1>
            <xsl:value-of disable-output-escaping="yes" select="name"/>
         </h1>
      </xsl:if>
      
      <!-- Если в находимся в группе - выводим название группы -->
      <xsl:if test="$parent_group_id != 0">
         <h1>
            <xsl:value-of disable-output-escaping="yes" select=".//group[@id=$parent_group_id]/name"/>
         </h1>
      </xsl:if>
      
      <!-- Обработка выбранных тэгов -->
      <xsl:if test="count(selected_tags/tag) = 1">
      <h2>Метка &#8212; <strong><xsl:value-of select="selected_tags/tag/tag_name"/></strong>.</h2>
      </xsl:if>
      
      <!-- Путь к группе -->
      <div class="path">
         <xsl:apply-templates select=".//group[@id=$parent_group_id]" mode="goup_path"/>
      </div>
      
      <xsl:variable name="count">1</xsl:variable>
      
      <!-- Отображение подгрупп данной группы, только если подгруппы есть и не идет фильтра по меткам -->
      <xsl:if test="count(selected_tags/tag) = 0 and count(//group[@parent=$parent_group_id]) &gt; 0">
         <table width="100%" border="0" cellpadding="3" cellspacing="0">
            <tr>
               <td valign="top">
                  <xsl:apply-templates select=".//group[@parent=$parent_group_id]"/>
               </td>
            </tr>
         </table>
      </xsl:if>
      
      <!-- дополнение пути для action, если выбрана метка -->
   <xsl:variable name="form_tag_path"><xsl:if test="count(selected_tags/tag) = 1">tag/<xsl:value-of select="selected_tags/tag/tag_path_name"/>/</xsl:if></xsl:variable>
      <xsl:if test="count(item) &gt; 0  or apply_filter = 1">
         <form method="get" action="{/shop/path}{//group[@id=$parent_group_id]/fullpath}{$form_tag_path}" id="base_serch">
            <div class="shop_block">
               
               
               <xsl:if test="count(properties_for_group/property[property_show_kind != 0 and (shop_list_of_properties_type = 0 or shop_list_of_properties_type = 2 or shop_list_of_properties_type = 7)]) &gt; 0">
                  <!--<p>
                     <b>Фильтр по дополнительным свойствам товара:</b>
                  </p>
                  
                  <table cellpadding="10px" cellspacing="0">
                     <tr valign="top">
                        <xsl:apply-templates select="properties_for_group/property[property_show_kind != 0 and (shop_list_of_properties_type = 0 or shop_list_of_properties_type = 2 or shop_list_of_properties_type = 7)]"/>
                     </tr>
                  </table>
                  -->
               </xsl:if>
               <!--
               <div class="nofloat" style="margin-left: 40%">
                  <div class="gray_button">
                     <div>
                        <input name="apply_filter" value="Применить" type="submit"/>
                     </div>
                  </div>
               </div>
               -->
            </div>
            
            <!-- Таблица с элементами для сравнения -->
            <xsl:if test="count(/shop/compare_items/compare_item) &gt; 0">
               <table cellpadding="5px" cellspacing="0" border="0">
                  <tr>
                     <td>
                        <input type="checkbox" onclick="SelectAllItemsByPrefix(this.checked, 'del_compare_id_'" />
                     </td>
                     <td>
                        <b>Сравниваемые элементы</b>
                     </td>
                  </tr>
                  <xsl:apply-templates select="compare_items/compare_item"/>
               </table>
               
               <div class="nofloat" style="height: 47px; padding: 5px 0;">
                  <div class="gray_button left">
                     <div>
                        <input name="apply_compare" value="Сравнить" type="button" onclick="javascript:location='{/shop/path}compare_items/';"/>
                     </div>
                  </div>
                  <div class="gray_button right">
                     <div>
                        <input name="delete_compare" value="Удалить" type="submit"/>
                     </div>
                  </div>
               </div>
               
               <!-- <input name="delete_all_compare" value="Удалить все" type="submit"/> -->
            </xsl:if>
            
            <!-- Сортировка товаров -->
            <div style=" height: 70px;width: 730px;padding:15px 0px 0px 0px;">
            <div class="shop_block" style="font-size:15px;float:left;">
                  <table cellpadding="0" cellspacing="0" style="width:370px;">
                     <tr>
                      <td style="width:7px;height:7px;"><img src="/img/fin_03.jpg" style="width:7px;height:7px;"/></td>
                      <td style="background-color:#f1f0e5;height:7px;width:356px;"></td>
                       <td align="right" style="width:7px;height:7px;"><img src="/img/fin_05.jpg" style="width:7px;height:7px;"/></td>
                     </tr>

                     <tr>
                      <td colspan="3" style="background-color:#f1f0e5;padding:10px;">
  
                           <xsl:variable name="filter">
                                       <xsl:if test="/shop/apply_filter/node()">?action=apply_filter&amp;producer_id=<xsl:value-of select="/shop/producer_id"/>&amp;saller_id=<xsl:value-of select="/shop/saller_id"/>&amp;price_from=<xsl:value-of select="/shop/price_from"/>&amp;price_to=<xsl:value-of select="/shop/price_to"/>&amp;on_page=<xsl:value-of select="/shop/on_page"/>
                                          <xsl:if test="/shop/property_xml/node()">
                                             <!-- GET для доп. свойств -->
                                             <xsl:value-of select="/shop/property_xml"/>
                                          </xsl:if>
                                       </xsl:if>
                                    </xsl:variable>
               
                                    <!-- Определяем первый символ вопрос или амперсанд -->
                                    <xsl:variable name="first_symbol">
                                       <xsl:choose>
                                          <xsl:when test="$filter != ''">&amp;</xsl:when>
                                          <xsl:otherwise>?</xsl:otherwise>
                                       </xsl:choose>
                                        </xsl:variable>
  
  
  
                        <div style="padding:2px;">
                         <div style="float:left;padding:0 0 0px 3px;">
                        <b >Сортировка: </b>
                        </div>
                        <div style="float:left;padding:0 0 0px 10px;">
                        <a href="#" style="color:#5b92f7;">по названию</a>
                        
                        <xsl:choose>
                        <xsl:when test="/shop/sort_by_field = 1 and /shop/order_direction = 'ASC'">
                           <a href="#"><img src="/img/fin_15.jpg" style="border:0px;padding:2px;" alt="по возрастанию"/></a>
                        </xsl:when>
                        <xsl:otherwise>
                           
                              <a href="{$filter}{$first_symbol}sort_by_field=1&amp;order_direction=1" class="without_decor">
                                 <img src="/img/fin_15.jpg" style="border:0px;padding:2px;" alt="по возрастанию"/>
                              </a>
                           
                        </xsl:otherwise>
                     </xsl:choose>
               
                     <xsl:choose>
                        <xsl:when test="/shop/sort_by_field = 1 and /shop/order_direction = 'DESC'">
                           <img src="/img/fin_17.jpg" style="border:0px;padding:2px;"/>
                        </xsl:when>
                        <xsl:otherwise>
                           
                              <a href="{$filter}{$first_symbol}sort_by_field=1&amp;order_direction=2" class="without_decor">
                                 <img src="/img/fin_17.jpg" style="border:0px;padding:2px;"/>
                              </a>
                           
                        </xsl:otherwise>
                     </xsl:choose>
            
                        
                        
                        </div>
   
                        <div style="padding:0 0 0px 15px;float:left;">
                        <a href="#" style="color:#5b92f7;">по цене</a>
                        
                                       <xsl:choose>
                                       <xsl:when test="/shop/sort_by_field = 2 and /shop/order_direction = 'ASC'">
                                          <a href="#"><img src="/img/fin_15.jpg" style="border:0px;padding:2px;" alt="по возрастанию"/></a>
                                       </xsl:when>
                                       <xsl:otherwise>
                                          <a href="{$filter}{$first_symbol}sort_by_field=2&amp;order_direction=1"><img src="/img/fin_15.jpg" style="border:0px;padding:2px;" alt="по возрастанию"/></a>
                                       </xsl:otherwise>
                                    </xsl:choose>
               
                                    <xsl:choose>
                                       <xsl:when test="/shop/sort_by_field = 2 and /shop/order_direction = 'DESC'">
                                          <a href="#"><img src="/img/fin_17.jpg" style="border:0px;padding:2px;"/></a>
                                       </xsl:when>
                                       <xsl:otherwise>
                                          <a href="{$filter}{$first_symbol}sort_by_field=2&amp;order_direction=2"><img src="/img/fin_17.jpg" style="border:0px;padding:2px;"/></a>
                                       </xsl:otherwise>
                                    </xsl:choose>
   
                        </div>
                        </div>
  
                      </td>
                     </tr>

                     <tr>
                      <td style="width:7px;height:7px;"><img src="/img/fin_23.jpg" style="width:7px;height:7px;"/></td>
                       <td style="background-color:#f1f0e5;"></td>
                      <td align="right" style="width:7px;height:7px;"><img src="/img/fin_24.jpg" style="width:7px;height:7px;"/></td>
                     </tr>
                     </table>
            </div>
            
            <div style="float:left;padding:20px 5px 10px 5px;font-size:13px;font-weight:blod;">
               <span style="white-space: nowrap">Отображать по:</span>&#xA0;
                  <select name="on_page" onchange="$('#base_serch'.submit();">
                     <option value="0">&#x2026;</option>
                     <xsl:call-template name="for_on_page">
                        <xsl:with-param name="i" select="10"/>
                        <xsl:with-param name="n" select="50"/>
                     </xsl:call-template>
               </select>&#xA0;товаров
            </div>
            
            <div style="float:left;padding:20px 5px 10px 5px;">
            <xsl:if test="count_items &gt; 0 and items_on_page &gt; 0">
               
               <xsl:variable name="count_pages" select="ceiling(count_items div items_on_page)"/>
               
               <xsl:variable name="visible_pages" select="5"/>
               
               <xsl:variable name="real_visible_pages"><xsl:choose>
                     <xsl:when test="$count_pages &lt; $visible_pages"><xsl:value-of select="$count_pages"/></xsl:when>
                     <xsl:otherwise><xsl:value-of select="$visible_pages"/></xsl:otherwise>
               </xsl:choose></xsl:variable>
               
               <!-- Считаем количество выводимых ссылок перед текущим элементом -->
               <xsl:variable name="pre_count_page"><xsl:choose>
                     <xsl:when test="current_page  - (floor($real_visible_pages div 2)) &lt; 0">
                        <xsl:value-of select="current_page"/>
                     </xsl:when>
                     <xsl:when test="($count_pages  - current_page - 1) &lt; floor($real_visible_pages div 2)">
                        <xsl:value-of select="$real_visible_pages - ($count_pages  - current_page - 1) - 1"/>
                     </xsl:when>
                     <xsl:otherwise>
                        <xsl:choose>
                           <xsl:when test="round($real_visible_pages div 2) = $real_visible_pages div 2">
                              <xsl:value-of select="floor($real_visible_pages div 2) - 1"/>
                           </xsl:when>
                           <xsl:otherwise>
                              <xsl:value-of select="floor($real_visible_pages div 2)"/>
                           </xsl:otherwise>
                        </xsl:choose>
                     </xsl:otherwise>
               </xsl:choose></xsl:variable>
               
               <!-- Считаем количество выводимых ссылок после текущего элемента -->
               <xsl:variable name="post_count_page"><xsl:choose>
                     <xsl:when test="0 &gt; current_page - (floor($real_visible_pages div 2) - 1)">
                        <xsl:value-of select="$real_visible_pages - current_page - 1"/>
                     </xsl:when>
                     <xsl:when test="($count_pages  - current_page - 1) &lt; floor($real_visible_pages div 2)">
                        <xsl:value-of select="$real_visible_pages - $pre_count_page - 1"/>
                     </xsl:when>
                     <xsl:otherwise>
                        <xsl:value-of select="$real_visible_pages - $pre_count_page - 1"/>
                     </xsl:otherwise>
               </xsl:choose></xsl:variable>
               
               <xsl:variable name="i"><xsl:choose>
                     <xsl:when test="current_page + 1 = $count_pages"><xsl:value-of select="current_page - $real_visible_pages + 1"/></xsl:when>
                     <xsl:when test="current_page - $pre_count_page &gt; 0"><xsl:value-of select="current_page - $pre_count_page"/></xsl:when>
                     <xsl:otherwise>0</xsl:otherwise>
               </xsl:choose></xsl:variable>
               
               <p>
                  <xsl:call-template name="for">
                     <xsl:with-param name="items_on_page" select="items_on_page"/>
                     <xsl:with-param name="current_page" select="current_page"/>
                     <xsl:with-param name="count_items" select="count_items"/>
                     <xsl:with-param name="i" select="$i"/>
                     <xsl:with-param name="post_count_page" select="$post_count_page"/>
                     <xsl:with-param name="pre_count_page" select="$pre_count_page"/>
                     <xsl:with-param name="visible_pages" select="$real_visible_pages"/>
                  </xsl:call-template>
               </p>
               <div style="clear: both"></div>
            </xsl:if>
            </div>
            </div>
            <!-- Определяем ссылку с параметрами фильтра -->
            <xsl:variable name="filter">
               <xsl:choose>
                  <xsl:when test="/shop/apply_filter/node()">?action=apply_filter&amp;producer_id=<xsl:value-of select="/shop/producer_id"/>&amp;saller_id=<xsl:value-of select="/shop/saller_id"/>&amp;price_from=<xsl:value-of select="/shop/price_from"/>&amp;price_to=<xsl:value-of select="/shop/price_to"/>&amp;on_page=<xsl:value-of select="/shop/on_page"/>
                     <xsl:if test="/shop/property_xml/node()">
                        <!-- GET для доп. свойств -->
                        <xsl:value-of select="/shop/property_xml"/>
                     </xsl:if>
                  </xsl:when>
                  <xsl:otherwise></xsl:otherwise>
               </xsl:choose>
            </xsl:variable>
            <!-- Определяем первый символ вопрос или амперсанд -->
            <xsl:variable name="first_symbol">
               <xsl:choose>
                  <xsl:when test="$filter != ''">&amp;</xsl:when>
                  <xsl:otherwise>?</xsl:otherwise>
               </xsl:choose>
            </xsl:variable>
            
            <xsl:apply-templates select="item" />
            
            <xsl:if test="count_items &gt; 0">
               <div class="nofloat" style="height: 27px; padding: 0 0 20px 0;">
                  <div class="gray_button">
                     <div>
                        <input name="add_compare" value="Добавить для сравнения" type="submit" />
                     </div>
                  </div>
               </div>
            </xsl:if>
            
            <xsl:if test="count(/shop/group[@id = $parent_group_id]/propertys/property) > 0">
               <div style="margin: 10px 0px;">
                  <h2>Атрибуты группы товаров</h2>
                  
                  <xsl:if test="count(property[@dir_id = 0])">
                     <table border="0">
                        <xsl:apply-templates select="property[@dir_id = 0]"/>
                     </table>
                  </xsl:if>
                  
                  <xsl:apply-templates select="/shop/properties_groups_dir"/>
               </div>
            </xsl:if>
            
            <xsl:if test="count_items &gt; 0 and items_on_page &gt; 0">
               
               <xsl:variable name="count_pages" select="ceiling(count_items div items_on_page)"/>
               
               <xsl:variable name="visible_pages" select="5"/>
               
               <xsl:variable name="real_visible_pages"><xsl:choose>
                     <xsl:when test="$count_pages &lt; $visible_pages"><xsl:value-of select="$count_pages"/></xsl:when>
                     <xsl:otherwise><xsl:value-of select="$visible_pages"/></xsl:otherwise>
               </xsl:choose></xsl:variable>
               
               <!-- Считаем количество выводимых ссылок перед текущим элементом -->
               <xsl:variable name="pre_count_page"><xsl:choose>
                     <xsl:when test="current_page  - (floor($real_visible_pages div 2)) &lt; 0">
                        <xsl:value-of select="current_page"/>
                     </xsl:when>
                     <xsl:when test="($count_pages  - current_page - 1) &lt; floor($real_visible_pages div 2)">
                        <xsl:value-of select="$real_visible_pages - ($count_pages  - current_page - 1) - 1"/>
                     </xsl:when>
                     <xsl:otherwise>
                        <xsl:choose>
                           <xsl:when test="round($real_visible_pages div 2) = $real_visible_pages div 2">
                              <xsl:value-of select="floor($real_visible_pages div 2) - 1"/>
                           </xsl:when>
                           <xsl:otherwise>
                              <xsl:value-of select="floor($real_visible_pages div 2)"/>
                           </xsl:otherwise>
                        </xsl:choose>
                     </xsl:otherwise>
               </xsl:choose></xsl:variable>
               
               <!-- Считаем количество выводимых ссылок после текущего элемента -->
               <xsl:variable name="post_count_page"><xsl:choose>
                     <xsl:when test="0 &gt; current_page - (floor($real_visible_pages div 2) - 1)">
                        <xsl:value-of select="$real_visible_pages - current_page - 1"/>
                     </xsl:when>
                     <xsl:when test="($count_pages  - current_page - 1) &lt; floor($real_visible_pages div 2)">
                        <xsl:value-of select="$real_visible_pages - $pre_count_page - 1"/>
                     </xsl:when>
                     <xsl:otherwise>
                        <xsl:value-of select="$real_visible_pages - $pre_count_page - 1"/>
                     </xsl:otherwise>
               </xsl:choose></xsl:variable>
               
               <xsl:variable name="i"><xsl:choose>
                     <xsl:when test="current_page + 1 = $count_pages"><xsl:value-of select="current_page - $real_visible_pages + 1"/></xsl:when>
                     <xsl:when test="current_page - $pre_count_page &gt; 0"><xsl:value-of select="current_page - $pre_count_page"/></xsl:when>
                     <xsl:otherwise>0</xsl:otherwise>
               </xsl:choose></xsl:variable>
               
               <p>
                  <xsl:call-template name="for">
                     <xsl:with-param name="items_on_page" select="items_on_page"/>
                     <xsl:with-param name="current_page" select="current_page"/>
                     <xsl:with-param name="count_items" select="count_items"/>
                     <xsl:with-param name="i" select="$i"/>
                     <xsl:with-param name="post_count_page" select="$post_count_page"/>
                     <xsl:with-param name="pre_count_page" select="$pre_count_page"/>
                     <xsl:with-param name="visible_pages" select="$real_visible_pages"/>
                  </xsl:call-template>
               </p>
               <div style="clear: both"></div>
            </xsl:if>
            
         </form>
      </xsl:if>
   </xsl:template>
   
   <!-- Вывод раздела для свойств группы товаров -->
   <xsl:template match="properties_groups_dir">
      
   <p><b><xsl:value-of select="shop_properties_groups_dir_name"/></b></p>
      
      <xsl:variable name="dir_id" select="@id"/>
      
      <xsl:variable name="parent_group_id"><xsl:choose>
      <xsl:when test="/shop/ТекущаяГруппа/node()"><xsl:value-of select="/shop/ТекущаяГруппа"/></xsl:when>
      <xsl:otherwise><xsl:value-of select="/shop/@current_group_id"/></xsl:otherwise>
      </xsl:choose></xsl:variable>

      <xsl:if test="count(/shop/group[@id = $parent_group_id]/propertys/property)">
         <table border="0">
            <xsl:apply-templates select="/shop/group[@id = $parent_group_id]/propertys/property[@parent_id = $dir_id]"/>
         </table>
      </xsl:if>
      
      <xsl:if test="count(properties_groups_dir)">
         <blockquote>
            <xsl:apply-templates select="properties_groups_dir"/>
         </blockquote>
      </xsl:if>
   </xsl:template>
   
   <!-- Вывод строки со значением свойства -->
   <xsl:template match="property">
      <tr>
         <td style="padding: 5px" bgcolor="#eeeeee">
            <b><xsl:value-of select="name"/></b>
         </td>
         <td style="padding: 5px" bgcolor="#eeeeee">
            <xsl:choose>
               <xsl:when test="type = 1">
                  <a href="{file_path}">Скачать файл</a>
               </xsl:when>
               <xsl:when test="type = 7">
                  <xsl:choose>
                     <xsl:when test="value = 1">
                        <input type="checkbox" checked="" disabled="" />
                     </xsl:when>
                     <xsl:otherwise>
                        <input type="checkbox" disabled="" />
                     </xsl:otherwise>
                  </xsl:choose>
               </xsl:when>
               <xsl:otherwise>
                  <xsl:value-of disable-output-escaping="yes" select="value"/>
               </xsl:otherwise>
            </xsl:choose>
         </td>
      </tr>
   </xsl:template>
   
   <!-- Шаблон для списка товаров для сравнения -->
   <xsl:template match="compare_items/compare_item">
      <xsl:variable name="var_compare_id" select="."/>
      <tr>
         <td>
            <input type="checkbox" name="del_compare_id_{compare_item_id}" id="id_del_compare_id_{compare_item_id}"/>
         </td>
         <td>
            <a href="{/shop/path}{compare_item_fullpath}{compare_item_path}/">
               <xsl:value-of disable-output-escaping="yes" select="compare_item_name"/>
            </a>
         </td>
      </tr>
   </xsl:template>
   
   <!-- Шаблон для фильтра производителей -->
   <xsl:template match="producerslist/producer">
      
      <xsl:param name="id_prod" select="@id"/>
      <!--
      <xsl:variable name="node_name" select="concat('производители', $id_prod)"/>
      
      <xsl:if test="count(/shop/*[name() = $node_name])">
         -->
         
         <option value="{@id}">
            <xsl:if test="@id = /shop/producer_id">
               <xsl:attribute name="selected"> </xsl:attribute>
            </xsl:if>
            <xsl:value-of disable-output-escaping="yes" select="shop_producers_list_name"/>
         </option>
         <!--
      </xsl:if>
      -->
      
   </xsl:template>
   
   <!-- Шаблон для фильтра продавцов -->
   <xsl:template match="sallers/saller">
      <option value="{@id}">
         <xsl:if test="@id = /shop/saller_id">
            <xsl:attribute name="selected">
            </xsl:attribute>
         </xsl:if>
         <xsl:value-of select="sallers_name"/>
      </option>
   </xsl:template>
   
   <!-- Шаблон для фильтра по дополнительным свойствам -->
   <xsl:template match="properties_for_group/property">
      
      <xsl:variable name="nodename">property_id_<xsl:value-of select="@id"/></xsl:variable>
      
      <xsl:variable name="nodename_from">property_id_<xsl:value-of select="@id"/>_from</xsl:variable>
      <xsl:variable name="nodename_to">property_id_<xsl:value-of select="@id"/>_to</xsl:variable>
      
      
      <td>
         <xsl:value-of disable-output-escaping="yes" select="property_name"/>&#xA0;
         <xsl:if test="property_show_kind = 1">
            <!-- Отображаем поле ввода -->
            <br/>
            <input type="text" name="property_id_{@id}">
               <xsl:if test="/shop/*[name()=$nodename] != ''">
                  <xsl:attribute name="value">
                     <xsl:value-of select="/shop/*[name()=$nodename]"/>
                  </xsl:attribute>
               </xsl:if>
            </input>
         </xsl:if>
         <xsl:if test="property_show_kind = 2">
            <!-- Отображаем список -->
            <br/>
            <select name="property_id_{@id}">
               <option value="0">...</option>-->
               <xsl:apply-templates select="list_items/list_item"/>
            </select>
         </xsl:if>
         <xsl:if test="property_show_kind = 3">
            <!-- Отображаем переключатели -->
            <br/>
            <input type="radio" name="property_id_{@id}" value="0" id="id_prop_radio_{@id}_0"></input>
            <label for="id_prop_radio_{@id}_0">Любой вариант</label>
            <xsl:apply-templates select="list_items/list_item"/>
         </xsl:if>
         
         <xsl:if test=" property_show_kind = 4">
            <!-- Отображаем флажки -->
            <xsl:apply-templates select="list_items/list_item"/>
         </xsl:if>
         
         <xsl:if test=" property_show_kind = 5">
            <!-- Отображаем флажок -->
            <br/>
            <input type="checkbox" name="property_id_{@id}" id="property_id_{@id}" style="padding-top:4px">
               <xsl:if test="/shop/*[name()=$nodename] != ''">
                  <xsl:attribute name="checked">
                     <xsl:value-of select="/shop/*[name()=$nodename]"/>
                  </xsl:attribute>
               </xsl:if>
            </input>
            <label for="property_id_{@id}">Да</label>
         </xsl:if>
         
         <xsl:if test=" property_show_kind = 6">
            <!-- Отображение полей "От.. До.." -->
            <br/>
            от: <input type="text" name="property_id_{@id}_from" size="5" value="{/shop/*[name()=$nodename_from]}"/> до: <input type="text" name="property_id_{@id}_to" size="5" value="{/shop/*[name()=$nodename_to]}"/>
         </xsl:if>
         
         <xsl:if test="property_show_kind = 7">
            <!-- Отображаем список  с множественным выбором-->
            <br/>
            <select name="property_id_{@id}[]" multiple="">
               <xsl:apply-templates select="list_items/list_item"/>
            </select>
         </xsl:if>
      </td>
      <xsl:if test="position() mod 6 = 0">
         <xsl:text disable-output-escaping="yes">
            &lt;/tr&gt;
            &lt;tr valign="top"&gt;
         </xsl:text>
      </xsl:if>
   </xsl:template>
   
   <xsl:template match="list_items/list_item">
      <xsl:if test="../../property_show_kind = 2">
         <!-- Отображаем список -->
         <xsl:variable name="nodename">property_id_<xsl:value-of select="../../@id"/></xsl:variable>
         <option value="{@id}">
            <xsl:if test="/shop/*[name()=$nodename] = @id">
               <xsl:attribute name="selected">
               </xsl:attribute>
            </xsl:if>
            <xsl:value-of disable-output-escaping="yes" select="list_item_value"/>
         </option>
      </xsl:if>
      <xsl:if test="../../property_show_kind = 3">
         <!-- Отображаем переключатели -->
         <xsl:variable name="nodename">property_id_<xsl:value-of select="../../@id"/></xsl:variable>
         <br/>
         <input type="radio" name="property_id_{../../@id}" value="{@id}" id="id_property_id_{../../@id}_{@id}">
            <xsl:if test="/shop/*[name()=$nodename] = @id">
               <xsl:attribute name="checked">checked</xsl:attribute>
            </xsl:if>
            <label for="id_property_id_{../../@id}_{@id}">
               <xsl:value-of disable-output-escaping="yes" select="list_item_value"/>
            </label>
         </input>
      </xsl:if>
      <xsl:if test="../../property_show_kind = 4">
         <!-- Отображаем флажки -->
         <xsl:variable name="nodename">property_id_<xsl:value-of select="../../@id"/>_item_id_<xsl:value-of select="@id"/></xsl:variable>
         <br/>
         <input type="checkbox" name="property_id_{../../@id}_item_id_{@id}" id="id_property_id_{../../@id}_{@id}">
            <xsl:if test="/shop/*[name()=$nodename] = @id">
               
               <xsl:attribute name="checked">checked</xsl:attribute>
            </xsl:if>
            <label for="id_property_id_{../../@id}_{@id}">
               <xsl:value-of disable-output-escaping="yes" select="list_item_value"/>
            </label>
         </input>
      </xsl:if>
      <xsl:if test="../../property_show_kind = 7">
         <!-- Отображаем список -->
         <xsl:variable name="nodename">property_id_<xsl:value-of select="../../@id"/></xsl:variable>
         <option value="{@id}">
            <xsl:if test="/shop/*[name()=$nodename] = @id">
               <xsl:attribute name="selected">
               </xsl:attribute>
            </xsl:if>
            <xsl:value-of disable-output-escaping="yes" select="list_item_value"/>
         </option>
      </xsl:if>
      
   </xsl:template>
   
   <!-- Цикл с шагом 10 для select'a количества элементов на страницу -->
   <xsl:template name="for_on_page">
      <xsl:param name="i" select="0"/>
      <xsl:param name="n"/>
      
      <option value="{$i}">
         <xsl:if test="$i = /shop/on_page">
            <xsl:attribute name="selected">
            </xsl:attribute>
         </xsl:if>
         <xsl:value-of select="$i"/>
      </option>
      
      <xsl:if test="$n &gt; $i">
         <!-- Рекурсивный вызов шаблона -->
         <xsl:call-template name="for_on_page">
            <xsl:with-param name="i" select="$i + 10"/>
            <xsl:with-param name="n" select="$n"/>
         </xsl:call-template>
      </xsl:if>
   </xsl:template>
   
   <!-- Шаблон для групп товара -->
   <xsl:template match="group">
      
      <xsl:variable name="parent_id" select="@parent"/>
      
      <div style="margin-bottom: 15px;">
         <a href="{/shop/path}{fullpath}" style="font-weight: bold">
            <xsl:value-of disable-output-escaping="yes" select="name"/>
      </a>&#xA0;<span style="color: #aaaaaa">(<xsl:value-of select="count_all_items"/></span>
         <br/>
         <xsl:value-of disable-output-escaping="yes" select="description"/>
         
         <xsl:if test="count(group) &gt; 1">
            <xsl:apply-templates select="group" mode="sub_group"/>
         </xsl:if>
      </div>
      
      <xsl:if test="position()= round(count(//group[@parent = $parent_id]) div 2)">
         <xsl:text disable-output-escaping="yes">
            &lt;/td&gt;
            &lt;td valign="top" width="50%"&gt;
         </xsl:text>
      </xsl:if>
   </xsl:template>
   
   <!-- Шаблон для подразделов -->
   <xsl:template match="group" mode="sub_group">
      <a href="{/shop/path}{fullpath}">
         <xsl:value-of disable-output-escaping="yes" select="name"/>
      </a>
      <xsl:variable name="parent_id" select="@parent"/>
      <!-- Ставим запятую после группы, за которой следуют еще группы из данной родителской группы -->
      <xsl:if test="position() != last() and count(//group[@parent = $parent_id]) &gt; 1">,&#xA0;</xsl:if>
   </xsl:template>
   
   <!-- Шаблон для товара -->
   <xsl:template match="item">
      
      <!-- Определяем цвет фона -->
      <xsl:variable name="background_color">
         <xsl:choose>
            <xsl:when test="(position() + 1) mod 2 &gt; 0">#f7f7f7</xsl:when>
            <xsl:otherwise>#ffffff</xsl:otherwise>
         </xsl:choose>
      </xsl:variable>
      
      
      
      
      
      
<div class="product_container">
                  <h1>
                     <a href="{/shop/path}{fullpath}{path}/" class="cat_title"><xsl:value-of disable-output-escaping="yes" select="name"/></a>
                  </h1>
                  <!--
<i><xsl:value-of disable-output-escaping="yes" select="description"/></i>-->
                <div style="height: 210px;width:260px;padding:2px;float:left;margin:0px 15px 0px 0px;">   
                  <div class="product_img_block" style="position: relative; height: 206px;overflow: hidden;border:1px solid #aaaaaa;">
                  
                  <!--<div class="product_discounts_block">35%</div>-->
                      <!-- Изображение для товара, если есть -->
                  <xsl:choose>
                  <xsl:when test="small_image!=''">
                     <xsl:if test="small_image!=''">
                      <a href="{/shop/path}{fullpath}{path}/">
                       <img src="{small_image}" class="image" style="border:0px;"/>
                      </a>
                      </xsl:if>
                   </xsl:when>
                  <xsl:otherwise>
                     <table style="width:265px;height:206px;">
                      <tr>
                       <td valign="middle" align="center">
                         <h2>НЕТ ФОТО</h2>
                       </td>
                      </tr>
                     </table>
                  </xsl:otherwise>
               </xsl:choose>
                    <!--  <xsl:if test="count(property) > 0">
                     <xsl:if test="count(property[@dir_id = 0])">
                      <xsl:apply-templates select="property" mode="osobenost"/>
                    </xsl:if>
                  </xsl:if>               
                 -->
               
                <!-- Особеность  -->
                 <xsl:choose>
                  <xsl:when test="property[@xml_name='osobenost']/value = 'Акция'">
                  <div class="big_zoom" style="margin:0px; padding:0px;float:left;position: absolute;left:0px;top:0px;">
                     <img src="/images/big_stock.png" style="background: none;border:0px;width:90px;height:90px;"/>
                   </div></xsl:when>
                  <xsl:when test="property[@xml_name='osobenost']/value = 'Распродажа'">
                  
                  <div class="big_zoom" style="margin:0px; padding:0px;float:left;position: absolute;left:0px;top:0px;">
                     <img src="/images/big_sale.png" style="background: none;border:0px;width:90px;height:90px;"/>
                   </div>
                  
                  </xsl:when>
                  <xsl:when test="property[@xml_name='osobenost']/value = 'Скидка (авто)'">
                  
                  
                  
                  
                  <xsl:if test='price - price_discount != 0'>
                    <div class="big_zoom" style="margin:0px; padding:0px;float:left;position: absolute;left:0px;top:0px;">
                     <img src="/images/big_discount.png" style="background: none;border:0px;width:90px;height:90px;"/>
                   </div>
                   <div class="big_zoom" style="margin:0px; padding:0px;float:left;position: absolute;left:10px;top:40px;font-size:18px;color:#ffffff;">
                     <b><xsl:value-of select="100-((price_discount div price)*100)"/> %</b>
                   </div>
                   </xsl:if>
                  
                  
                  </xsl:when>
                  
                  <xsl:otherwise>
                     
                  </xsl:otherwise>
               </xsl:choose>
               <!-- Особеность  -->
                 
                </div>
                   </div>
                  <div class="product_main_block">
                     <div class="product_main_left">
                     
                        <ul>
                           <xsl:apply-templates select="property" mode="creator"/>
                           <xsl:apply-templates select="property" mode="line2"/>
                           <xsl:apply-templates select="property" mode="long"/>
                           <xsl:apply-templates select="property" mode="width"/>
                           <xsl:apply-templates select="property" mode="height"/>
                           <xsl:apply-templates select="property" mode="osobenost_test"/>
                           
                        </ul>
                        
                        
                        
                        
                        
                        <xsl:if test="type != 1 or (type = 1 and (eitem_count > 0 or eitem_count = -1))">
                         <div class="in_stock">В наличии</div>
                        </xsl:if>
                     </div>
                     <div class="product_main_center">
                        <xsl:apply-templates select="property" mode="spets"/>
                        <div class="product_rating_block">
                           Рейтинг
                           <br/>
                           
                           
                            <xsl:value-of select="item_comments/grade_count"/>
                           
                           <!-- Вывод рейтинга товара -->
                                    <xsl:choose>
                               <xsl:when test='comments/grade_count > 0'>
                                   <xsl:if test="comments/average_grade/node()">
                                       <div style="float: left; margin: 0px 0px 0px 0px">
                                      <ul>
                                        <xsl:call-template name="show_average_grade">
                                       <xsl:with-param name="grade" select="comments/average_grade"/>
                                       <xsl:with-param name="const_grade" select="5"/>
                                        </xsl:call-template>
                                     </ul>
                                       </div>
                                      <div style="clear: both"></div>
                  
                                 </xsl:if>
                           </xsl:when>
                                 <xsl:otherwise>
                                      <ul>
                                  <li><a href="#"></a></li>
                                  <li><a href="#"></a></li>
                                  <li><a href="#"></a></li>
                                  <li><a href="#"></a></li>
                                  <li><a href="#"></a></li>
                              </ul>
                              
                                 </xsl:otherwise>
                                </xsl:choose>
                           <!-- Шаблон для вывода звездочек (оценки) -->

                           
                           <input type="submit" value="" />
                        </div>
                     </div>
                     <div class="product_main_right">
                        <div class="product_price_block">
                           <!--цена: <span>420 344 руб.</span><br/>
                           скидка: <span>60 000 руб.</span>
                           -->
                        
                        
                        <!-- -->
                           <xsl:choose>
                <xsl:when test='price - price_discount = 0'>
            
            <div style="border:0px solid;padding:4px;">
              ваша цена: <strong>
               
                    <xsl:choose>
                  <xsl:when test="price_discount != 0">
                     <xsl:value-of select="format-number(price_discount, '### ##0', 'my'"/>&#xA0;<xsl:value-of select="currency" disable-output-escaping="yes"/>
                  </xsl:when>
                  <xsl:otherwise>договорная</xsl:otherwise>
               </xsl:choose>
             </strong>
             </div>
            
            </xsl:when>
               <xsl:otherwise>
           
           
            <div style="border:0px;margin:0px;">
               цена: <span>
               <xsl:choose>
                  <xsl:when test="price != 0">
                     <xsl:value-of select="format-number(price, '### ##0', 'my'"/>&#xA0;<xsl:value-of select="currency" disable-output-escaping="yes"/>
                  </xsl:when>
                  <xsl:otherwise>договорная</xsl:otherwise>
               </xsl:choose></span><br/>
               
               скидка: <span>
               
            
               <xsl:value-of select="price - price_discount"/>&#xA0;<xsl:value-of select="currency" disable-output-escaping="yes"/>
               
                <div style="margin:0px;">
            ваша цена: <strong>
               
                    <xsl:choose>
                  <xsl:when test="price_discount != 0">
                     <xsl:value-of select="format-number(price_discount, '### ##0', 'my'"/>&#xA0;<xsl:value-of select="currency" disable-output-escaping="yes"/>
                  </xsl:when>
                  <xsl:otherwise>договорная</xsl:otherwise>
               </xsl:choose>

               <span></span></strong>
            </div>   
            </span>
            </div>
           
            </xsl:otherwise>
              </xsl:choose>
           </div>
                        <!-- Ссылку на добавление в корзины выводим, если:
                  type != 1 - простой тип товара или делимый (0 - простой, 2 - делимый)
                  type = 1 - электронный товар, при этом остаток на складе больше 0 или -1,
                  что означает неограниченное количество -->
                  <xsl:if test="type != 1 or (type = 1 and (eitem_count > 0 or eitem_count = -1))">
                     <div style="display: inline; margin-left: 3px">
                        <div class="left">
                           <!--<input type="text" size="3" value="1" id="count_{@id}" location="{/shop/path}cart/?action=add&amp;item_id={@id}" onclick="return AddIntoCart('{/shop/path}', {@id}, document.getElementById('count_{@id}'.value);" />
                           -->
                           <a href="{/shop/path}cart/?action=add&amp;item_id={@id}" onclick="return AddIntoCart('{/shop/path}', {@id}, document.getElementById('count_{@id}'.value)">
                           <img alt="В корзину" title="В корзину" src="http://santehdiskont.ru/images/buy_button.png" style="margin: 0px 0px -4px 10px" />
                        
                           <!--<img src="/images/map_intocart.gif" width="12" height="21" border="0" usemap="#mapInToCart{@id}" style="margin: 0 0 -6px 1px;"/>-->
                           </a>
                           
                           <!--<map name="mapInToCart{@id}">
                              <area shape="rect" coords="0,0,12,10"  onclick="set_count_mod('count_{@id}', 1);" nohref="nohref" />
                              <area shape="rect" coords="0,11,12,21" onclick="set_count_mod('count_{@id}', -1);" nohref="nohref" />
                           </map>-->
                        </div>
                        
                        
                     </div>
                  </xsl:if>
                     </div>
                  </div>
               </div>
         
         
         
         
         
         
         
         
      </xsl:template>
      
      <!-- /// Метки для товаров /// -->
      <xsl:template match="tags/tag">
         <a href="{/shop/path}tag/{tag_path_name}/" class="tag">
            <xsl:value-of select="tag_name"/>
         </a>
      <xsl:if test="position() != last()"><xsl:text>, </xsl:text></xsl:if>
      </xsl:template>
      
      <!-- Шаблон для модификаций -->
      <xsl:template match="modifications/item">
         <tr>
            <td>
               
               <a href="{/shop/path}{fullpath}{path}/">
                  <img src="{small_image}" class="image" />
               </a>
               
            </td>
            <td>
               <!-- Название модификации -->
               <a href="{/shop/path}{fullpath}{path}/">
                  <xsl:value-of disable-output-escaping="yes" select="name"/>
               </a>
            </td>
            <td>
               <!-- Цена модификации -->
               <xsl:choose>
                  <xsl:when test="price_discount != 0">
                     <xsl:value-of disable-output-escaping="yes" select="price_discount"/>&#xA0;
                     <!-- Валюта товара -->
                     <xsl:value-of disable-output-escaping="yes" select="currency"/>
                  </xsl:when>
                  <xsl:otherwise>договорная</xsl:otherwise>
               </xsl:choose>
            </td>
         </tr>
      </xsl:template>
      
      
   <!-- Вывод строки со значением свойства -->
   <!-- Вывод строки со значением свойства -->
   <xsl:template match="property">
     <xsl:if test=" xml_name != 'osobenost' and xml_name != 'servis' and xml_name != 'video' and xml_name != 'contry_create' and xml_name != 'rodina_brends' and xml_name != 'instruction' and xml_name != 'complect' and xml_name != 'dostavka_24' and xml_name != 'img_2' and xml_name != 'img_3' and xml_name != 'img_4' and xml_name != 'img_5'">
      <xsl:if test="(value != '' or (type = 1 and file_path != '')  ">
         <tr style="border-bottom: 1px dotted #D1D2D5; color: #929292; padding: 3px;">
            <td style="padding: 5px">
               <b><xsl:value-of select="name"/></b>
            </td>
            <td style="padding: 5px">
               <xsl:choose>
                  <xsl:when test="type = 1">
                     <a href="{file_path}">Скачать файл</a>
                  </xsl:when>
                  <xsl:when test="type = 7">
                     <xsl:choose>
                        <xsl:when test="value = 1">
                           да
                        </xsl:when>
                        <xsl:otherwise>
                           нет
                        </xsl:otherwise>
                     </xsl:choose>
                  </xsl:when>
                  <xsl:otherwise>
                     <xsl:value-of disable-output-escaping="yes" select="value"/>
                  </xsl:otherwise>
               </xsl:choose>
            </td>
         </tr>
      </xsl:if>
   </xsl:if>
   </xsl:template>
   
    <!-- Вывод строки производитель -->
   <xsl:template match="property" mode="creator">
     <xsl:if test="xml_name = '1'">
      <xsl:if test="(value != '' or (type = 1 and file_path != '')  ">
        <li><strong>Производитель:</strong><xsl:value-of disable-output-escaping="yes" select="value"/></li>
      </xsl:if>
   </xsl:if>
   </xsl:template>

   <!-- Вывод строки Линия производитель -->
   <xsl:template match="property" mode="line2">
     <xsl:if test="xml_name = 'line_create'">
      <xsl:if test="(value != '' or (type = 1 and file_path != '')">
        <li><strong>Линия:</strong><xsl:value-of disable-output-escaping="yes" select="value"/></li>
      </xsl:if>
   </xsl:if>
   </xsl:template>
   
   <!-- Вывод строки Длина -->
   <xsl:template match="property" mode="long">
     <xsl:if test="xml_name = '3'">
      <xsl:if test="(value != '' or (type = 1 and file_path != '')  ">
        <li><strong>Длина:</strong><xsl:value-of disable-output-escaping="yes" select="value"/></li>
      </xsl:if>
   </xsl:if>
   </xsl:template>
   
   <!-- Вывод строки Ширина-->
   <xsl:template match="property" mode="width">
     <xsl:if test="xml_name = '4'">
      <xsl:if test="(value != '' or (type = 1 and file_path != '')  ">
        <li><strong>Ширина:</strong><xsl:value-of disable-output-escaping="yes" select="value"/></li>
      </xsl:if>
   </xsl:if>
   </xsl:template>
   
   <!-- Вывод строки Особенность тест-->
   <xsl:template match="property" mode="osobenost_test">
     <xsl:if test="xml_name = 'osobenost'">
      <xsl:if test="(value != '' or (type = 1 and file_path != '')  ">
        <li><strong>Особеность:</strong><xsl:value-of disable-output-escaping="yes" select="value"/></li>
      </xsl:if>
   </xsl:if>
   </xsl:template>
   
   <!-- Вывод строки Высота-->
   <xsl:template match="property" mode="height">
     <xsl:if test="xml_name = '5'">
      <xsl:if test="(value != '' or (type = 1 and file_path != '')  ">
        <li><strong>Высота:</strong><xsl:value-of disable-output-escaping="yes" select="value"/></li>
      </xsl:if>
   </xsl:if>
   </xsl:template>
   
   <!-- Особеность -->
   <xsl:template match="property" mode="osobenost">
     <xsl:if test="xml_name = 'osobenost'">
        <xsl:if test="(value != '' or (type = 1 and file_path != '')  ">
         
         
         <xsl:choose>
                  <xsl:when test="value = 'Акция'">
                  <div class="big_zoom" style="margin:0px; padding:0px;float:left;position: absolute;left:0px;top:0px;">
                     <img src="/images/big_stock.png" style="background: none;border:0px;width:90px;height:90px;"/>
                   </div></xsl:when>
                  <xsl:when test="value = 'Распродажа'">
                  
                  <div class="big_zoom" style="margin:0px; padding:0px;float:left;position: absolute;left:0px;top:0px;">
                     <img src="/images/big_sale.png" style="background: none;border:0px;width:90px;height:90px;"/>
                   </div>
                  
                  </xsl:when>
                  <xsl:when test="value = 'Скидка (авто)'">
                  
                  
                  
                  
                  <xsl:if test='/shop/item/price - /shop/item/price_discount != 0'>
                    <div class="big_zoom" style="margin:0px; padding:0px;float:left;position: absolute;left:0px;top:0px;">
                     <img src="/images/big_discount.png" style="background: none;border:0px;width:90px;height:90px;"/>
                   </div>
                   <div class="big_zoom" style="margin:0px; padding:0px;float:left;position: absolute;left:10px;top:40px;font-size:18px;color:#ffffff;">
                     <b><xsl:value-of select="100-((/shop/item/price_discount div /shop/item/price)*100)"/> %</b>
                   </div>
                   </xsl:if>
                  
                  
                  </xsl:when>
                  
                  <xsl:otherwise>
                     
                  </xsl:otherwise>
         </xsl:choose>
         
      </xsl:if>
   </xsl:if>
   </xsl:template>
   
   <!-- Спец предложение -->
   <xsl:template match="property" mode="spets">
     <xsl:if test="xml_name = 'osobenost'">
        <xsl:if test="(value != '' or (type = 1 and file_path != '')  ">
        <div class="special_offer">Специальное предложение</div>
               
      </xsl:if>
   </xsl:if>
   </xsl:template>
   
   <!-- Вывод рейтинга товара -->
   <xsl:template name="show_average_grade">
      <xsl:param name="grade" select="0"/>
      <xsl:param name="const_grade" select="0"/>
      
      <!-- Чтобы избежать зацикливания -->
      <xsl:variable name="current_grade" select="$grade * 1"/>
      
      
      <xsl:choose>
         <!-- Если число целое -->
         <xsl:when test="floor($current_grade) = $current_grade and not($const_grade &gt; ceiling($current_grade))">
            
            <xsl:if test="$current_grade - 1 &gt; 0">
               <xsl:call-template name="show_average_grade">
                  <xsl:with-param name="grade" select="$current_grade - 1"/>
                  <xsl:with-param name="const_grade" select="$const_grade - 1"/>
               </xsl:call-template>
            </xsl:if>
            
            <xsl:if test="$current_grade != 0">
               <!--<img src="/hostcmsfiles/images/stars_single.gif"/>-->
               <li class="product_about_rating_a"><a  href="#"></a></li>
            </xsl:if>
         </xsl:when>
         <xsl:when test="$current_grade != 0 and not($const_grade &gt; ceiling($current_grade))">
            
            <xsl:if test="$current_grade - 0.5 &gt; 0">
               <xsl:call-template name="show_average_grade">
                  <xsl:with-param name="grade" select="$current_grade - 0.5"/>
                  <xsl:with-param name="const_grade" select="$const_grade - 1"/>
               </xsl:call-template>
            </xsl:if>
            
            <!--<img src="/hostcmsfiles/images/stars_half.gif"/>-->
            <li class="product_about_rating_a"><a  href="#"></a></li>
         </xsl:when>
         
         <xsl:otherwise>
            <!-- Выводим серые звездочки, пока текущая позиция не дойдет то значения, увеличенного до целого -->
            <xsl:call-template name="show_average_grade">
               <xsl:with-param name="grade" select="$current_grade"/>
               <xsl:with-param name="const_grade" select="$const_grade - 1"/>
            </xsl:call-template>
            <!--<img src="/hostcmsfiles/images/stars_gray.gif"/>-->
            <li><a href="#"></a></li>
         </xsl:otherwise>
      </xsl:choose>
      
   </xsl:template>
   
      <!-- Шаблон для скидки -->
      <xsl:template match="discount">
         <br/>
         <xsl:value-of disable-output-escaping="yes" select="name"/>&#xA0;
         <xsl:value-of disable-output-escaping="yes" select="value"/>%</xsl:template>
      
      <!-- Шаблон для спеццен -->
      <xsl:template match="special_price">
         
         <xsl:variable name="item_id" select="@item_id" />
         
         <br/>
         от <xsl:value-of select="shop_special_prices_from"/> до <xsl:value-of select="shop_special_prices_to"/>&#xA0;<xsl:value-of select="/shop/item[@id = $item_id]/mesure"/>
         <xsl:text> </xsl:text>
         &#8212;
         <xsl:text> </xsl:text>
         <xsl:value-of select="format-number(shop_special_prices_price,'### ##0,00', 'my'" />&#xA0;<xsl:value-of select="/shop/item[@id = $item_id]/currency"/>
         за 1 <xsl:value-of select="/shop/item[@id = $item_id]/mesure"/>
      </xsl:template>
      
      <!-- Цикл для вывода строк ссылок -->
      <xsl:template name="for">
         
         <xsl:param name="items_on_page"/>
         <xsl:param name="current_page"/>
         <xsl:param name="pre_count_page"/>
         <xsl:param name="post_count_page"/>
         <xsl:param name="i" select="0"/>
         <xsl:param name="count_items"/>
         <xsl:param name="visible_pages"/>
         
         <xsl:variable name="n" select="ceiling($count_items div $items_on_page)"/>
         
         <xsl:variable name="start_page"><xsl:choose>
               <xsl:when test="$current_page + 1 = $n"><xsl:value-of select="$current_page - $visible_pages + 1"/></xsl:when>
               <xsl:when test="$current_page - $pre_count_page &gt; 0"><xsl:value-of select="$current_page - $pre_count_page"/></xsl:when>
               <xsl:otherwise>0</xsl:otherwise>
         </xsl:choose></xsl:variable>
         
         <xsl:if test="$i = $start_page and $current_page != 0">
            <span class="ctrl">
               <!-- &#8592; Ctrl-->
            </span>
         </xsl:if>
         
         <xsl:if test="$i = ($current_page + $post_count_page + 1) and $n != ($current_page+1)">
            <span class="ctrl">
               <!-- Ctrl &#8594; -->
            </span>
         </xsl:if>
         
         <xsl:if test="$count_items &gt; $items_on_page and ($current_page + $post_count_page + 1) &gt; $i">
            <!-- Заносим в переменную $parent_group_id идентификатор текущей группы -->
            <xsl:variable name="parent_group_id" select="/shop/@current_group_id"/>
            
            <!-- Путь для тэга -->
            <xsl:variable name="tag_path">
               <xsl:if test="count(/shop/selected_tags/tag) = 1">tag/<xsl:value-of select="/shop/selected_tags/tag/tag_path_name"/>/</xsl:if>
            </xsl:variable>
            
            <!-- Определяем группу для формирования адреса ссылки -->
            <xsl:variable name="group_link">
               <xsl:choose>
                  <!-- Если группа не корневая (!=0) -->
                  <xsl:when test="$parent_group_id != 0">
                     <xsl:value-of select="/shop//group[@id=$parent_group_id]/fullpath"/>
                  </xsl:when>
                  <!-- Иначе если нулевой уровень - просто ссылка на страницу со списком элементов -->
                  <xsl:otherwise></xsl:otherwise>
               </xsl:choose>
            </xsl:variable>
            
            <!-- Определяем адрес ссылки -->
            <xsl:variable name="number_link">
               <xsl:choose>
                  <!-- Если не нулевой уровень -->
                  <xsl:when test="$i != 0">page-<xsl:value-of select="$i + 1"/>/</xsl:when>
                  <!-- Иначе если нулевой уровень - просто ссылка на страницу со списком элементов -->
                  <xsl:otherwise></xsl:otherwise>
               </xsl:choose>
            </xsl:variable>
            
            <!-- Передаем фильтр -->
            <xsl:variable name="filter">
               <xsl:choose>
                  <xsl:when test="/shop/apply_filter/node()">?action=apply_filter&amp;producer_id=<xsl:value-of select="/shop/producer_id"/>&amp;saller_id=<xsl:value-of select="/shop/saller_id"/>&amp;price_from=<xsl:value-of select="/shop/price_from"/>&amp;price_to=<xsl:value-of select="/shop/price_to"/>&amp;on_page=<xsl:value-of select="/shop/on_page"/>
                     <xsl:if test="/shop/property_xml/node()">
                        <!-- GET для доп. свойств -->
                        <xsl:value-of select="/shop/property_xml"/>
                     </xsl:if>
                  </xsl:when>
                  <xsl:otherwise></xsl:otherwise>
               </xsl:choose>
            </xsl:variable>
            
            <!-- Определяем первый символ вопрос или амперсанд -->
            <xsl:variable name="first_symbol">
               <xsl:choose>
                  <xsl:when test="$filter != ''">&amp;</xsl:when>
                  <xsl:otherwise>?</xsl:otherwise>
               </xsl:choose>
            </xsl:variable>
            
            <!-- Данные для стрелок сортировки -->
            <xsl:variable name="arrows">
               <xsl:choose>
                  <xsl:when test="(/shop/sort_by_field = 1) or (/shop/sort_by_field = 2)">
                     <xsl:choose>
                        <!-- Стрелка вверх -->
                        <xsl:when test="/shop/order_direction = 'ASC'">
                           <xsl:value-of select="$first_symbol"/>sort_by_field=<xsl:value-of select="/shop/sort_by_field"/>&amp;order_direction=1</xsl:when>
                        <!-- Стрелка вниз -->
                        <xsl:otherwise>
                           <xsl:value-of select="$first_symbol"/>sort_by_field=<xsl:value-of select="/shop/sort_by_field"/>&amp;order_direction=2</xsl:otherwise>
                     </xsl:choose>
                  </xsl:when>
                  <xsl:otherwise></xsl:otherwise>
               </xsl:choose>
            </xsl:variable>
            
            <!-- Выводим ссылку на первую страницу -->
            <xsl:if test="$current_page - $pre_count_page &gt; 0 and $i = $start_page">
               <a href="{/shop/path}{$group_link}{$tag_path}{$filter}{$arrows}" class="page_link" style="text-decoration: none;">&#x2190;</a>
            </xsl:if>
            
            <!-- Ставим ссылку на страницу-->
            <xsl:if test="$i != $current_page">
               <xsl:if test="($current_page - $pre_count_page) &lt;= $i and $i &lt; $n">
                  <!-- Выводим ссылки на видимые страницы -->
                  <a href="{/shop/path}{$group_link}{$tag_path}{$number_link}{$filter}{$arrows}" class="page_link" style="padding:10px;font-size:17px;text-decoration:none;color:#000000;">
                     <b><xsl:value-of select="$i + 1"/></b>
                  </a>
               </xsl:if>
               
               <!-- Выводим ссылку на последнюю страницу -->
               <xsl:if test="$i+1 &gt;= ($current_page + $post_count_page + 1) and $n &gt; ($current_page + 1 + $post_count_page)">
                  <!-- Выводим ссылку на последнюю страницу -->
                  <a href="{/shop/path}{$group_link}{$tag_path}page-{$n}/{$filter}{$arrows}" class="page_link" style="text-decoration: none;">&#x2192;</a>
               </xsl:if>
            </xsl:if>
            
            <!-- Ссылка на предыдущую страницу для Ctrl + влево -->
            <xsl:if test="$current_page != 0 and $i = $current_page">
               <xsl:variable name="prev_number_link">
                  <xsl:choose>
                     <!-- Если не нулевой уровень -->
                     <xsl:when test="($current_page - 1) != 0">page-<xsl:value-of select="$i"/>/</xsl:when>
                     <!-- Иначе если нулевой уровень - просто ссылка на страницу со списком элементов -->
                     <xsl:otherwise></xsl:otherwise>
                  </xsl:choose>
               </xsl:variable>
               
               <a href="{/shop/path}{$group_link}{$tag_path}{$prev_number_link}{$filter}{$arrows}" id="id_prev"></a>
            </xsl:if>
            
            <!-- Ссылка на следующую страницу для Ctrl + вправо -->
            <xsl:if test="($n - 1) > $current_page and $i = $current_page">
               <a href="{/shop/path}{$group_link}{$tag_path}page-{$current_page+2}/{$filter}{$arrows}" id="id_next"></a>
            </xsl:if>
            
            <!-- Не ставим ссылку на страницу-->
            <xsl:if test="$i = $current_page">
               <span class="current" style="background-image:url('/img/bg_href.jpg';background-repeat: no-repeat; background-position: center center; padding: 10px;color:#ffffff;font-size:17px;">
                  <b><xsl:value-of select="$i+1"/></b>
               </span>
            </xsl:if>
            
            <!-- Рекурсивный вызов шаблона. НЕОБХОДИМО ПЕРЕДАВАТЬ ВСЕ НЕОБХОДИМЫЕ ПАРАМЕТРЫ! -->
            <xsl:call-template name="for">
               <xsl:with-param name="i" select="$i + 1"/>
               <xsl:with-param name="items_on_page" select="$items_on_page"/>
               <xsl:with-param name="current_page" select="$current_page"/>
               <xsl:with-param name="count_items" select="$count_items"/>
               <xsl:with-param name="pre_count_page" select="$pre_count_page"/>
               <xsl:with-param name="post_count_page" select="$post_count_page"/>
               <xsl:with-param name="visible_pages" select="$visible_pages"/>
            </xsl:call-template>
         </xsl:if>
      </xsl:template>
      
      <!-- Шаблон выводит рекурсивно ссылки на группы инф. элемента -->
      <xsl:template match="group" mode="goup_path">
         <xsl:param name="parent_id" select="@parent"/>
         
         <!-- Получаем ID родительской группы и записываем в переменную $parent_group_id -->
         <xsl:param name="parent_group_id"><xsl:choose>
         <xsl:when test="/shop/ТекущаяГруппа/node()"><xsl:value-of select="/shop/ТекущаяГруппа"/></xsl:when>
         <xsl:otherwise><xsl:value-of select="/shop/@current_group_id"/></xsl:otherwise>
         </xsl:choose></xsl:param>
         
         <xsl:apply-templates select="//group[@id=$parent_id]" mode="goup_path"/>
         
         <xsl:if test="@parent=0">
            <a href="{/shop/path}">
               <xsl:value-of select="/shop/name"/>
            </a>
         </xsl:if>
         
         <span class="path_arrow">&#x2192;</span>
         
         <a href="{/shop/path}{fullpath}">
            <xsl:value-of disable-output-escaping="yes" select="name"/>
         </a>
      </xsl:template>
   </xsl:stylesheet>
Авторизация