Вопрос по корзине!!!
В блок:
Добавьте:
<xsl:template match="itemincart">
...
</xsl:template>
...
</xsl:template>
Добавьте:
<xsl:value-of disable-output-escaping="yes" select="weight"/>
Вы только что начали читать предложение, чтение которого вы уже заканчиваете.
И еще такой вопрос. Почему при клике на кнопке Пересчитать, если товаров в корзине больше 4, то выбрасывает на страницу где написано Страница не найдена. Если товаров меньше 4 то пересчет работает нормально?
andreev8305 писал(а):
В первом примере упустил узел:
не работает
В первом примере упустил узел:
<xsl:value-of disable-output-escaping="yes" select="item/weight"/>
Вы только что начали читать предложение, чтение которого вы уже заканчиваете.
andreev8305 писал(а):
Пример страницы, где можно пронаблюдать проблему.
Почему при клике на кнопке Пересчитать, если товаров в корзине больше 4, то выбрасывает на страницу где написано Страница не найдена. Если товаров меньше 4 то пересчет работает нормально?
Пример страницы, где можно пронаблюдать проблему.
Вы только что начали читать предложение, чтение которого вы уже заканчиваете.
alexander.egorov писал(а):
Код МагазинКорзина:
<?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"/>
<xsl:decimal-format name="my" decimal-separator="," grouping-separator=" "/>
<!-- Шаблон для корзины -->
<xsl:variable name="recount" select="recount"/>
<xsl:template match="/cart">
<xsl:choose>
<xsl:when test="(count_item=0) and (count_postpone_item=0)">
<!-- В корзине нет ни одного элемента -->
<p class="title" style="font-family: Verdana;">В машине нет ни одного товара.</p>
<p style="font-family: Verdana;">
<xsl:choose>
<xsl:when test="user_id != 0">Для оформления заказа добавьте товар в машину.</xsl:when>
<xsl:when test="site_users_class_exists = 1">Вы не авторизированы. Если Вы зарегистрированный пользователь, данные Вашей корзины станут видны после авторизации.</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</p>
</xsl:when>
<xsl:otherwise>
<!-- Вывод корзины -->
<h1 style="font-family: Verdana; color: #3b5994; font-weight: bold;">Моя машина</h1>
<p style="font-family: Verdana;">Для оформления заказа, нажмите «Оформить заказ».</p>
<form action="{/cart/shop/path}cart/" name="address" method="POST">
<!-- Если есть товары -->
<xsl:if test="count(itemincart[flag_postpone = 0]) > 0">
<table cellspacing="0" cellpadding="0" border="0" class="shop_cart_table" width="738px">
<tr height="64" align="center" style="font-family: Verdana; font-weight: bold;">
<td style="background-color: #007ec5; color: #ffffff;">Товар</td>
<td style="background-color: #007ec5; color: #ffffff;" width="70">Вес</td>
<td style="background-color: #007ec5; color: #ffffff;" width="70">Кол-во</td>
<td style="background-color: #007ec5; color: #ffffff;" width="100">Цена</td>
<td style="background-color: #007ec5; color: #ffffff;" width="100">Сумма</td>
<!--Склад-->
<td style="background-color: #007ec5; color: #ffffff;">Действия</td>
</tr>
<xsl:apply-templates select="itemincart[flag_postpone = 0]"/>
<tr height="64" align="center" class="shop_cart_table" style="background-color: #f1f1f1;">
<td style="font-family: Verdana; font-weight: bold;">
Итого:
</td>
<td style="font-family: Verdana; font-weight: bold;">
<xsl:value-of disable-output-escaping="yes" select="totalquantity"/>
</td>
<td> </td>
<td style="white-space: nowrap; font-family: Verdana;">
<xsl:value-of select="format-number(total_sum_without_discount,'### ##0', 'my')"/> <xsl:value-of disable-output-escaping="yes" select="shop/shop_currency/shop_currency_name"/>
</td>
<xsl:if test="/cart/shop/warehouses/node()">
<td> </td>
</xsl:if>
<td> </td>
</tr>
<xsl:if test="total_sum_without_discount > totalsum">
<tr align="center" class="shop_cart_table">
<!--<td style="border-bottom: thin dashed #DADADA">
 
</td>-->
<td style="border-bottom: thin dashed #DADADA">
<b>Скидка:</b>
</td>
<td style="border-bottom: thin dashed #DADADA"> </td>
<td style="border-bottom: thin dashed #DADADA"> </td>
<td style="border-bottom: thin dashed #DADADA; white-space: nowrap; font-weight: bold">
<b>
<xsl:value-of disable-output-escaping="yes" select="format-number(total_sum_without_discount - totalsum, '### ##0', 'my')"/> <xsl:value-of disable-output-escaping="yes" select="shop/shop_currency/shop_currency_name"/></b>
</td>
<xsl:if test="/cart/shop/warehouses/node()">
<td style="border-bottom: thin dashed #DADADA"> </td>
</xsl:if>
<td style="border-bottom: thin dashed #DADADA"> </td>
<td style="border-bottom: thin dashed #DADADA"> </td>
</tr>
<tr align="center" class="shop_cart_table">
<!--<td style="border-bottom: none">
 
</td>-->
<td style="border-bottom: none">
<b>Всего:</b>
</td>
<td style="border-bottom: none"> </td>
<td style="border-bottom: none"> </td>
<td style="border-bottom: none; white-space: nowrap; font-weight: bold">
<xsl:value-of disable-output-escaping="yes" select="format-number(totalsum, '### ##0', 'my')"/> <xsl:value-of disable-output-escaping="yes" select="shop/shop_currency/shop_currency_name"/>
</td>
<td style="border-bottom: none"> </td>
<xsl:if test="/cart/shop/warehouses/node()">
<td style="border-bottom: none"> </td>
</xsl:if>
<td style="border-bottom: none"> </td>
<td style="border-bottom: none"> </td>
</tr>
</xsl:if>
</table>
<div style="clear: both; height: 20px;"></div>
</xsl:if>
<!-- Если есть отложенные товары -->
<xsl:if test="count(itemincart[flag_postpone = 1]) > 0">
<h2>Отложенные товары</h2>
<div class="gray">
<table cellspacing="0" cellpadding="0" border="0" class="shop_cart_table">
<tr>
<th>Товар</th>
<!--<td width="70">Вес</td>-->
<th width="70">Кол-во</th>
<th width="100">Цена</th>
<th width="100">Сумма</th>
<th>Отложить</th>
<th>Действия</th>
</tr>
<xsl:apply-templates select="itemincart[flag_postpone = 1]"/>
<tr class="shop_cart_table">
<td>
<b>Итого:</b>
</td>
<td>
<b>
<xsl:value-of disable-output-escaping="yes" select="totalquantity_postpone_item"/>
</b>
</td>
<td> </td>
<td style="white-space: nowrap;">
<xsl:value-of disable-output-escaping="yes" select="format-number(totalsum_postpone_item,'### ##0', 'my')"/> <xsl:value-of disable-output-escaping="yes" select="shop/shop_currency/shop_currency_name"/>
</td>
<td> </td>
<td> </td>
</tr>
</table>
</div>
</xsl:if>
<!-- Купон -->
<!-- Кнопки -->
<div class="gray_button">
<div>
<input name="recount" value="Пересчитать" type="submit" />
</div>
</div>
<xsl:choose>
<xsl:when test="site_users_class_exists = 1"></xsl:when>
<xsl:otherwise>
<h1 style="font-family: Verdana; color: #3b5994; font-weight: bold;">Данные о заказчике</h1>
<!-- Выводим сообщение -->
<xsl:if test="/cart/message/node()">
<div id="message">
<xsl:value-of disable-output-escaping="yes" select="/cart/message"/>
</div>
</xsl:if>
<p style="color: #707070; font-family: Verdana;">
Поля, отмеченные <span class="red_star" style="position: relative; top: 6px;"> *</span>, обязательны для заполнения.
</p>
<!-- В случае если отключен модуль пользователей сайта, запрашиваем информацию
о пользователе сайта здесь -->
<table cellspacing="0" cellpadding="0" border="0" class="shop_cart_table" style="font-family: Verdana;">
<tr>
<td >Фамилия:</td>
<td>
<input name="site_users_surname" type="text" value="{site_users_surname}" size="40"/>
</td>
<td class="red_star"> *</td>
</tr>
<tr>
<td>Имя:</td>
<td>
<input name="site_users_name" type="text" value="{site_users_name}" size="40"/>
</td>
<td class="red_star"> *</td>
</tr>
<tr>
<td>Отчество:</td>
<td>
<input name="site_users_patronymic" type="text" value="{site_users_patronymic}" size="40"/>
</td>
</tr>
<tr>
<td>Компания:</td>
<td>
<input name="site_users_company" type="text" value="{site_users_company}" size="40"/>
</td>
</tr>
<tr>
<td>E-mail:</td>
<td>
<input name="site_users_email" type="text" value="{site_users_email}" size="40"/>
</td>
<td class="red_star"> *</td>
</tr>
<tr>
<td>Телефон:</td>
<td>
<input name="site_users_phone" type="text" value="{site_users_phone}" size="40"/>
</td>
</tr>
<tr>
<td>Факс:</td>
<td>
<input name="site_users_fax" type="text" value="{site_users_fax}" size="40"/>
</td>
</tr>
<tr>
<td>Адрес:</td>
<td>
<input name="site_users_address" type="text" value="{site_users_address}" size="40"/>
</td>
</tr>
</table>
<!-- Добавляем скрытое поле с указанием подшага -->
<input name="step_1_1a" type="hidden" value="1"/>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="count(itemincart[flag_postpone = 0]) > 0 and (user_id != 0 or site_users_class_exists = 0)">
<div class="gray_button">
<div>
<input name="step_1" type="submit" />
</div>
</div>
</xsl:if>
</form>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Шаблон для товара в корзине -->
<xsl:template match="itemincart">
<tr align="center" class="shop_cart_table" style="background-color: #f1f1f1;">
<td style="font-size: 120%;">
<a href="{/cart/shop/path}{item/fullpath}{item/path}/">
<xsl:value-of disable-output-escaping="yes" select="item/name"/>
</a>
<!--=<xsl:value-of select="/cart/shop/shop_list_of_prices//shop_list_of_price[@id = shop_list_of_prices_for_item//[shop_list_of_price_for_item = price_discount]/@id]/percent" />=-->
<!--
<xsl:if test="item/small_image!=''">
<img src="{item/small_image}"/>
</xsl:if>
-->
<!-- Средняя оценка товара -->
<div style="clear: both"></div>
</td>
<td>
<xsl:value-of disable-output-escaping="yes" select="item/weight"/>
</td>
<td style="white-space: nowrap">
<xsl:value-of select="item/mesure" disable-output-escaping="yes"/>
<img src="/images/left1.jpg" width="20" height="19" border="0" onclick="set_count_mod('count_{item/@id}', 1);" style="margin: 0 7px -5px 1px;"/>
<input type="text" size="3" name="{item/@id}" id="count_{item/@id}" value="{quantity}"/>
<img src="/images/right1.jpg" width="20" height="19" border="0" onclick="set_count_mod('count_{item/@id}', -1);" style="margin: 0 0 -5px 7px;"/>
</td>
<td align="center" style="white-space: nowrap; font-family: Verdana;">
<!-- Цена -->
<xsl:value-of disable-output-escaping="yes" select="format-number(item/price_discount, '### ##0', 'my')"/> <xsl:value-of select="item/currency" disable-output-escaping="yes"/></td>
<td align="center" style="white-space: nowrap; font-family: Verdana;">
<!-- Сумма -->
<xsl:value-of disable-output-escaping="yes" select="format-number(item/price_discount * quantity, '### ##0', 'my')"/> <xsl:value-of disable-output-escaping="yes" select="item/currency"/></td>
<!-- Отложенные товары -->
<td style="font-family: Verdana;" align="center"><a href="?action=delete_item&item_id={item/@id}" onclick="return confirm('Вы уверены, что хотите удалить?');" title="Удалить товар из корзины" alt="Удалить товар из корзины">Удалить</a></td>
</tr>
</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 > ceiling($current_grade))">
<xsl:if test="$current_grade - 1 > 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"/>
</xsl:if>
</xsl:when>
<xsl:when test="$current_grade != 0 and not($const_grade > ceiling($current_grade))">
<xsl:if test="$current_grade - 0.5 > 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"/>
</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"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Шаблон для вывода звездочек (оценки) -->
<xsl:template name="for">
<xsl:param name="i" select="0"/>
<xsl:param name="n"/>
<input type="radio" name="shop_comment_grade" value="{$i}" id="id_shop_comment_grade_{$i}">
<xsl:if test="/shop/shop_comment_grade = $i">
<xsl:attribute name="checked">
</xsl:attribute>
</xsl:if>
</input> 
<label for="id_shop_comment_grade_{$i}">
<xsl:call-template name="show_average_grade">
<xsl:with-param name="grade" select="$i"/>
<xsl:with-param name="const_grade" select="5"/>
</xsl:call-template>
</label>
<br/>
<xsl:if test="$n > $i and $n > 1">
<xsl:call-template name="for">
<xsl:with-param name="i" select="$i + 1"/>
<xsl:with-param name="n" select="$n"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<!-- option для склада -->
<xsl:template match="item/warehouses/warehouse">
<!-- Если есть остаток на складе -->
<xsl:if test=". != 0">
<xsl:variable name="w_id" select="@id" />
<option value="{@id}">
<xsl:if test="../../../shop_warehouse_id = @id">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>
<xsl:value-of select="/cart/shop/warehouses/warehouse[@id=$w_id]/shop_warehouse_name"/> (<xsl:value-of select="."/>)
</option>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
Пример страницы, где можно пронаблюдать проблему.
Код МагазинКорзина:
<?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"/>
<xsl:decimal-format name="my" decimal-separator="," grouping-separator=" "/>
<!-- Шаблон для корзины -->
<xsl:variable name="recount" select="recount"/>
<xsl:template match="/cart">
<xsl:choose>
<xsl:when test="(count_item=0) and (count_postpone_item=0)">
<!-- В корзине нет ни одного элемента -->
<p class="title" style="font-family: Verdana;">В машине нет ни одного товара.</p>
<p style="font-family: Verdana;">
<xsl:choose>
<xsl:when test="user_id != 0">Для оформления заказа добавьте товар в машину.</xsl:when>
<xsl:when test="site_users_class_exists = 1">Вы не авторизированы. Если Вы зарегистрированный пользователь, данные Вашей корзины станут видны после авторизации.</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</p>
</xsl:when>
<xsl:otherwise>
<!-- Вывод корзины -->
<h1 style="font-family: Verdana; color: #3b5994; font-weight: bold;">Моя машина</h1>
<p style="font-family: Verdana;">Для оформления заказа, нажмите «Оформить заказ».</p>
<form action="{/cart/shop/path}cart/" name="address" method="POST">
<!-- Если есть товары -->
<xsl:if test="count(itemincart[flag_postpone = 0]) > 0">
<table cellspacing="0" cellpadding="0" border="0" class="shop_cart_table" width="738px">
<tr height="64" align="center" style="font-family: Verdana; font-weight: bold;">
<td style="background-color: #007ec5; color: #ffffff;">Товар</td>
<td style="background-color: #007ec5; color: #ffffff;" width="70">Вес</td>
<td style="background-color: #007ec5; color: #ffffff;" width="70">Кол-во</td>
<td style="background-color: #007ec5; color: #ffffff;" width="100">Цена</td>
<td style="background-color: #007ec5; color: #ffffff;" width="100">Сумма</td>
<!--Склад-->
<td style="background-color: #007ec5; color: #ffffff;">Действия</td>
</tr>
<xsl:apply-templates select="itemincart[flag_postpone = 0]"/>
<tr height="64" align="center" class="shop_cart_table" style="background-color: #f1f1f1;">
<td style="font-family: Verdana; font-weight: bold;">
Итого:
</td>
<td style="font-family: Verdana; font-weight: bold;">
<xsl:value-of disable-output-escaping="yes" select="totalquantity"/>
</td>
<td> </td>
<td style="white-space: nowrap; font-family: Verdana;">
<xsl:value-of select="format-number(total_sum_without_discount,'### ##0', 'my')"/> <xsl:value-of disable-output-escaping="yes" select="shop/shop_currency/shop_currency_name"/>
</td>
<xsl:if test="/cart/shop/warehouses/node()">
<td> </td>
</xsl:if>
<td> </td>
</tr>
<xsl:if test="total_sum_without_discount > totalsum">
<tr align="center" class="shop_cart_table">
<!--<td style="border-bottom: thin dashed #DADADA">
 
</td>-->
<td style="border-bottom: thin dashed #DADADA">
<b>Скидка:</b>
</td>
<td style="border-bottom: thin dashed #DADADA"> </td>
<td style="border-bottom: thin dashed #DADADA"> </td>
<td style="border-bottom: thin dashed #DADADA; white-space: nowrap; font-weight: bold">
<b>
<xsl:value-of disable-output-escaping="yes" select="format-number(total_sum_without_discount - totalsum, '### ##0', 'my')"/> <xsl:value-of disable-output-escaping="yes" select="shop/shop_currency/shop_currency_name"/></b>
</td>
<xsl:if test="/cart/shop/warehouses/node()">
<td style="border-bottom: thin dashed #DADADA"> </td>
</xsl:if>
<td style="border-bottom: thin dashed #DADADA"> </td>
<td style="border-bottom: thin dashed #DADADA"> </td>
</tr>
<tr align="center" class="shop_cart_table">
<!--<td style="border-bottom: none">
 
</td>-->
<td style="border-bottom: none">
<b>Всего:</b>
</td>
<td style="border-bottom: none"> </td>
<td style="border-bottom: none"> </td>
<td style="border-bottom: none; white-space: nowrap; font-weight: bold">
<xsl:value-of disable-output-escaping="yes" select="format-number(totalsum, '### ##0', 'my')"/> <xsl:value-of disable-output-escaping="yes" select="shop/shop_currency/shop_currency_name"/>
</td>
<td style="border-bottom: none"> </td>
<xsl:if test="/cart/shop/warehouses/node()">
<td style="border-bottom: none"> </td>
</xsl:if>
<td style="border-bottom: none"> </td>
<td style="border-bottom: none"> </td>
</tr>
</xsl:if>
</table>
<div style="clear: both; height: 20px;"></div>
</xsl:if>
<!-- Если есть отложенные товары -->
<xsl:if test="count(itemincart[flag_postpone = 1]) > 0">
<h2>Отложенные товары</h2>
<div class="gray">
<table cellspacing="0" cellpadding="0" border="0" class="shop_cart_table">
<tr>
<th>Товар</th>
<!--<td width="70">Вес</td>-->
<th width="70">Кол-во</th>
<th width="100">Цена</th>
<th width="100">Сумма</th>
<th>Отложить</th>
<th>Действия</th>
</tr>
<xsl:apply-templates select="itemincart[flag_postpone = 1]"/>
<tr class="shop_cart_table">
<td>
<b>Итого:</b>
</td>
<td>
<b>
<xsl:value-of disable-output-escaping="yes" select="totalquantity_postpone_item"/>
</b>
</td>
<td> </td>
<td style="white-space: nowrap;">
<xsl:value-of disable-output-escaping="yes" select="format-number(totalsum_postpone_item,'### ##0', 'my')"/> <xsl:value-of disable-output-escaping="yes" select="shop/shop_currency/shop_currency_name"/>
</td>
<td> </td>
<td> </td>
</tr>
</table>
</div>
</xsl:if>
<!-- Купон -->
<!-- Кнопки -->
<div class="gray_button">
<div>
<input name="recount" value="Пересчитать" type="submit" />
</div>
</div>
<xsl:choose>
<xsl:when test="site_users_class_exists = 1"></xsl:when>
<xsl:otherwise>
<h1 style="font-family: Verdana; color: #3b5994; font-weight: bold;">Данные о заказчике</h1>
<!-- Выводим сообщение -->
<xsl:if test="/cart/message/node()">
<div id="message">
<xsl:value-of disable-output-escaping="yes" select="/cart/message"/>
</div>
</xsl:if>
<p style="color: #707070; font-family: Verdana;">
Поля, отмеченные <span class="red_star" style="position: relative; top: 6px;"> *</span>, обязательны для заполнения.
</p>
<!-- В случае если отключен модуль пользователей сайта, запрашиваем информацию
о пользователе сайта здесь -->
<table cellspacing="0" cellpadding="0" border="0" class="shop_cart_table" style="font-family: Verdana;">
<tr>
<td >Фамилия:</td>
<td>
<input name="site_users_surname" type="text" value="{site_users_surname}" size="40"/>
</td>
<td class="red_star"> *</td>
</tr>
<tr>
<td>Имя:</td>
<td>
<input name="site_users_name" type="text" value="{site_users_name}" size="40"/>
</td>
<td class="red_star"> *</td>
</tr>
<tr>
<td>Отчество:</td>
<td>
<input name="site_users_patronymic" type="text" value="{site_users_patronymic}" size="40"/>
</td>
</tr>
<tr>
<td>Компания:</td>
<td>
<input name="site_users_company" type="text" value="{site_users_company}" size="40"/>
</td>
</tr>
<tr>
<td>E-mail:</td>
<td>
<input name="site_users_email" type="text" value="{site_users_email}" size="40"/>
</td>
<td class="red_star"> *</td>
</tr>
<tr>
<td>Телефон:</td>
<td>
<input name="site_users_phone" type="text" value="{site_users_phone}" size="40"/>
</td>
</tr>
<tr>
<td>Факс:</td>
<td>
<input name="site_users_fax" type="text" value="{site_users_fax}" size="40"/>
</td>
</tr>
<tr>
<td>Адрес:</td>
<td>
<input name="site_users_address" type="text" value="{site_users_address}" size="40"/>
</td>
</tr>
</table>
<!-- Добавляем скрытое поле с указанием подшага -->
<input name="step_1_1a" type="hidden" value="1"/>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="count(itemincart[flag_postpone = 0]) > 0 and (user_id != 0 or site_users_class_exists = 0)">
<div class="gray_button">
<div>
<input name="step_1" type="submit" />
</div>
</div>
</xsl:if>
</form>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Шаблон для товара в корзине -->
<xsl:template match="itemincart">
<tr align="center" class="shop_cart_table" style="background-color: #f1f1f1;">
<td style="font-size: 120%;">
<a href="{/cart/shop/path}{item/fullpath}{item/path}/">
<xsl:value-of disable-output-escaping="yes" select="item/name"/>
</a>
<!--=<xsl:value-of select="/cart/shop/shop_list_of_prices//shop_list_of_price[@id = shop_list_of_prices_for_item//[shop_list_of_price_for_item = price_discount]/@id]/percent" />=-->
<!--
<xsl:if test="item/small_image!=''">
<img src="{item/small_image}"/>
</xsl:if>
-->
<!-- Средняя оценка товара -->
<div style="clear: both"></div>
</td>
<td>
<xsl:value-of disable-output-escaping="yes" select="item/weight"/>
</td>
<td style="white-space: nowrap">
<xsl:value-of select="item/mesure" disable-output-escaping="yes"/>
<img src="/images/left1.jpg" width="20" height="19" border="0" onclick="set_count_mod('count_{item/@id}', 1);" style="margin: 0 7px -5px 1px;"/>
<input type="text" size="3" name="{item/@id}" id="count_{item/@id}" value="{quantity}"/>
<img src="/images/right1.jpg" width="20" height="19" border="0" onclick="set_count_mod('count_{item/@id}', -1);" style="margin: 0 0 -5px 7px;"/>
</td>
<td align="center" style="white-space: nowrap; font-family: Verdana;">
<!-- Цена -->
<xsl:value-of disable-output-escaping="yes" select="format-number(item/price_discount, '### ##0', 'my')"/> <xsl:value-of select="item/currency" disable-output-escaping="yes"/></td>
<td align="center" style="white-space: nowrap; font-family: Verdana;">
<!-- Сумма -->
<xsl:value-of disable-output-escaping="yes" select="format-number(item/price_discount * quantity, '### ##0', 'my')"/> <xsl:value-of disable-output-escaping="yes" select="item/currency"/></td>
<!-- Отложенные товары -->
<td style="font-family: Verdana;" align="center"><a href="?action=delete_item&item_id={item/@id}" onclick="return confirm('Вы уверены, что хотите удалить?');" title="Удалить товар из корзины" alt="Удалить товар из корзины">Удалить</a></td>
</tr>
</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 > ceiling($current_grade))">
<xsl:if test="$current_grade - 1 > 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"/>
</xsl:if>
</xsl:when>
<xsl:when test="$current_grade != 0 and not($const_grade > ceiling($current_grade))">
<xsl:if test="$current_grade - 0.5 > 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"/>
</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"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Шаблон для вывода звездочек (оценки) -->
<xsl:template name="for">
<xsl:param name="i" select="0"/>
<xsl:param name="n"/>
<input type="radio" name="shop_comment_grade" value="{$i}" id="id_shop_comment_grade_{$i}">
<xsl:if test="/shop/shop_comment_grade = $i">
<xsl:attribute name="checked">
</xsl:attribute>
</xsl:if>
</input> 
<label for="id_shop_comment_grade_{$i}">
<xsl:call-template name="show_average_grade">
<xsl:with-param name="grade" select="$i"/>
<xsl:with-param name="const_grade" select="5"/>
</xsl:call-template>
</label>
<br/>
<xsl:if test="$n > $i and $n > 1">
<xsl:call-template name="for">
<xsl:with-param name="i" select="$i + 1"/>
<xsl:with-param name="n" select="$n"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<!-- option для склада -->
<xsl:template match="item/warehouses/warehouse">
<!-- Если есть остаток на складе -->
<xsl:if test=". != 0">
<xsl:variable name="w_id" select="@id" />
<option value="{@id}">
<xsl:if test="../../../shop_warehouse_id = @id">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>
<xsl:value-of select="/cart/shop/warehouses/warehouse[@id=$w_id]/shop_warehouse_name"/> (<xsl:value-of select="."/>)
</option>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
Вес как я вижу выводится. По вопросу пересчета направьте запрос в поддержку, посмотрим на месте.
Вы только что начали читать предложение, чтение которого вы уже заканчиваете.
Авторизация