<?xml version="1.0" encoding="windows-1251"?>
<!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" encoding="Windows-1251" indent="yes" method="html" omit-xml-declaration="no" version="1.0" />

<!-- Шаблон "ОплатаПриПолучении" -->

<xsl:template match="/document_list">
<h1>Ваш заказ оформлен</h1>

<xsl:apply-templates select="order_list"/>

<h2>Заказанные товары</h2>
<table cellpadding="2" cellspacing="0">
<tr class="shop_cart_table">
<td>Наименование</td>
<td>Количество</td>
<td>Цена</td>
<td>Сумма</td>
</tr>
<xsl:apply-templates select="items_order"/>
<tr class="shop_cart_table">
<td colspan="4" align="right">
Итого: <xsl:value-of select="order_list/sum"/>&#xA0;<xsl:value-of select="order_list/currency/currency_name"/>
</td>
</tr>
</table>

<p>Через некоторое время с Вами свяжется наш менеджер, чтобы согласовать заказанный товар и время доставки.</p>

<p>Спасибо за использование услуг нашего магазина.</p>

</xsl:template>

<!-- Шаблон вывода данных о заказе -->
<xsl:template match="order_list">

<h2>Данные доставки</h2>
<p>ФИО: <xsl:value-of select="site_user_fio"/></p>
<p>E-mail: <xsl:value-of select="site_users_email"/></p>
<p>Телефон: <xsl:value-of select="site_users_phone"/></p>
<p>Факс: <xsl:value-of select="site_users_fax"/></p>

<xsl:variable name="country" select="country_name"/>
<xsl:variable name="location">, <xsl:value-of select="location_name"/></xsl:variable>
<xsl:variable name="city">, <xsl:value-of select="city_name"/></xsl:variable>
<xsl:variable name="city_area">, <xsl:value-of select="city_area_name"/></xsl:variable>

<p>Адрес доставки:
<xsl:value-of select="$country"/>
<xsl:value-of select="$location"/>
<xsl:value-of select="$city"/>
<xsl:value-of select="$city_area"/>&#xA0;<xsl:value-of select="address"/></p>

<p>Индекс: <xsl:value-of select="index"/></p>

<xsl:if test="phone!=''">
	<p>Телефон: <xsl:value-of select="phone"/></p>
</xsl:if>

</xsl:template>

<!-- Данные о товарах -->
<xsl:template match="items_order">

<xsl:variable name="quantity"><xsl:value-of select="order_items_quantity"/></xsl:variable>
<xsl:variable name="price"><xsl:value-of select="order_items_price"/></xsl:variable>

<tr class="shop_cart_table">
<td>
	<xsl:choose>
	<xsl:when test="item/path != ''">
		<a href="http://{//order_list/shop/site_alias_name}{//order_list/shop/shop_path}{item/fullpath}{item/path}/"><xsl:value-of select="order_items_name"/></a>
	</xsl:when>
	<xsl:otherwise>
		<xsl:value-of select="order_items_name"/>
	</xsl:otherwise>
	</xsl:choose>
</td>
<td><xsl:value-of select="$quantity"/> <xsl:value-of select="item/mesure"/></td>
<td><xsl:value-of select="$price"/>&#xA0;<xsl:value-of select="//order_list/currency/currency_name"/></td>
<td><xsl:value-of select="$quantity*$price"/>&#xA0;<xsl:value-of select="//order_list/currency/currency_name"/></td>
</tr>

</xsl:template>

</xsl:stylesheet>