llirik, xsl - ОплатаПриПолучении
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:hostcms="http://www.hostcms.ru/"
exclude-result-prefixes="hostcms">
<xsl:output xmlns="http://www.w3.org/TR/xhtml1/strict" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" encoding="utf-8" indent="yes" method="html" omit-xml-declaration="no" version="1.0" media-type="text/xml"/>
<xsl:decimal-format name="my" decimal-separator="." grouping-separator=" "/>
<xsl:template match="/shop">
<h1 class="item_title">Корзина</h1>
<!-- шаг заказа -->
<div id="WiredWizard" class="wizard wizard-wired" data-target="#WiredWizardsteps">
<ul class="steps">
<li data-target="#wiredstep1" class="complete"><span class="step"><i class="icon-ok"></i></span><span class="cart_title_shop">Адрес доставки</span><span class="chevron"></span></li>
<li data-target="#wiredstep2" class="complete"><span class="step"><i class="icon-ok"></i></span><span class="cart_title_shop">Способ доставки</span> <span class="chevron"></span></li>
<li data-target="#wiredstep3" class="complete"><span class="step"><i class="icon-ok"></i></span><span class="cart_title_shop">Форма оплаты</span> <span class="chevron"></span></li>
<li data-target="#wiredstep4" class="complete"><span class="step"><i class="icon-ok"></i></span><span class="cart_title_shop">Заказ оформлен</span> <span class="chevron"></span></li>
</ul>
</div>
<h1>Ваш заказ оформлен</h1>
<p>Через некоторое время с Вами свяжется наш менеджер, чтобы согласовать ваш заказ и время доставки.</p>
<xsl:apply-templates select="shop_order"/>
<xsl:choose>
<xsl:when test="count(shop_order/shop_order_item)">
<h2>Заказанные товары</h2>
<div class="shop_cart_header_table_order_is_issued">
<div class="shop_cart_header_table_column1_order_is_issued">Товар</div>
<div class="shop_cart_header_table_column2_order_is_issued">Цена</div>
<div class="shop_cart_header_table_column3_order_is_issued">Количество</div>
<div class="shop_cart_header_table_column4_order_is_issued">Сумма</div>
</div>
<xsl:apply-templates select="shop_order/shop_order_item"/>
<div class="cart_shop_footer_table">
<div class="cart_shop_footer_table_itogo cart_shop_footer_table_itogo_margin">Итого:</div>
<div class="cart_shop_footer_table_itogo">
<xsl:value-of select="format-number(shop_order/total_amount,'### ##0.00', 'my')"/><xsl:text> </xsl:text><xsl:value-of select="/shop/shop_order/shop_currency/name"/>
</div>
</div>
</xsl:when>
<xsl:otherwise>
<p><b>Заказанных товаров нет.</b></p>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Шаблон вывода данных о заказе -->
<xsl:template match="shop_order">
<h2>Данные доставки</h2>
<p>
<b>ФИО:</b><xsl:text> </xsl:text><xsl:value-of select="surname"/><xsl:text> </xsl:text><xsl:value-of select="name"/><xsl:text> </xsl:text><xsl:value-of select="patronymic"/>
<br /><b>E-mail:</b><xsl:text> </xsl:text><xsl:value-of select="email"/>
<xsl:if test="phone != ''">
<br /><b>Телефон:</b><xsl:text> </xsl:text><xsl:value-of select="phone"/>
</xsl:if>
<xsl:if test="fax != ''">
<br /><b>Факс:</b><xsl:text> </xsl:text><xsl:value-of select="fax"/>
</xsl:if>
<xsl:variable name="location">, <xsl:value-of select="shop_country/shop_country_location/name"/></xsl:variable>
<xsl:variable name="city">, <xsl:value-of select="shop_country/shop_country_location/shop_country_location_city/name"/></xsl:variable>
<xsl:variable name="city_area">, <xsl:value-of select="shop_country/shop_country_location/shop_country_location_city/shop_country_location_city_area/name"/></xsl:variable>
<xsl:variable name="adres">, <xsl:value-of select="address"/></xsl:variable>
<br /><b>Адрес доставки:</b><xsl:text> </xsl:text><xsl:if test="postcode != ''"><xsl:value-of select="postcode"/>, </xsl:if>
<xsl:if test="shop_country/name != ''">
<xsl:value-of select="shop_country/name"/>
</xsl:if>
<xsl:if test="$location != ', '">
<xsl:value-of select="$location"/>
</xsl:if>
<xsl:if test="$city != ', '">
<xsl:value-of select="$city"/>
</xsl:if>
<xsl:if test="$city_area != ', '">
<xsl:value-of select="$city_area"/> район</xsl:if>
<xsl:if test="$adres != ', '">
<xsl:value-of select="$adres"/>
</xsl:if>
<xsl:if test="shop_delivery/name != ''">
<br /><b>Тип доставки:</b><xsl:text> </xsl:text><xsl:value-of select="shop_delivery/name"/>
</xsl:if>
<xsl:if test="shop_payment_system/name != ''">
<br /><b>Способ оплаты:</b><xsl:text> </xsl:text><xsl:value-of select="shop_payment_system/name"/>
</xsl:if>
</p>
</xsl:template>
<!-- Данные о товарах -->
<xsl:template match="shop_order/shop_order_item">
<div class="shop_cart_item_block">
<div class="shop_cart_item1">
<xsl:choose>
<xsl:when test="shop_item/image_small != ''">
<a href="{shop_item/url}">
<img src="{shop_item/dir}{shop_item/image_small}" alt="{shop_item/name}" title="{shop_item/name}" style="max-width:150px; max-height:150px;"/></a>
</xsl:when>
<xsl:otherwise>
<a href="{shop_item/url}">
<img src="/images/no-image.png" alt="{name}" title="{name}" style="max-width:150px; max-height:150px;"/>
</a>
</xsl:otherwise>
</xsl:choose>
</div>
<div class="shop_cart_item1_1">
<xsl:choose>
<xsl:when test="shop_item/url != ''">
<a href="http://{/shop/site/site_alias/name}{shop_item/url}">
<xsl:value-of disable-output-escaping="yes" select="name"/>
</a>
</xsl:when>
<xsl:otherwise>
<xsl:value-of disable-output-escaping="yes" select="name"/>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="shop_item/marking != ''">
<div class="item_shop_property">Артикул: <xsl:value-of disable-output-escaping="yes" select="shop_item/marking"/></div>
</xsl:if>
<!-- Если указан производитель -->
<xsl:if test="shop_item/shop_producer/name">
<div class="cart_item_shop_property">Производитель: <xsl:value-of disable-output-escaping="yes" select="shop_item/shop_producer/name"/> </div>
</xsl:if>
<!-- Если указан вес товара -->
<xsl:if test="shop_item/weight != 0">
<div class="item_shop_property">Вес товара: <xsl:value-of select="shop_item/weight"/><xsl:value-of select="/shop/shop_measure/name"/></div>
</xsl:if>
<!-- Размеры товара -->
<xsl:if test="shop_item/length != 0 or width != 0 or height != 0">
<div class="cart_item_shop_property">Размеры: <span><xsl:value-of select="shop_item/length" /><xsl:text> </xsl:text><xsl:value-of select="/shop/size_measure/name" />
<xsl:text> × </xsl:text>
<xsl:value-of select="shop_item/width" /><xsl:text> </xsl:text><xsl:value-of select="/shop/size_measure/name" />
<xsl:text> × </xsl:text>
<xsl:value-of select="shop_item/height" /><xsl:text> </xsl:text><xsl:value-of select="/shop/size_measure/name" /></span></div>
</xsl:if>
</div>
<div class="shop_cart_item2">
<!-- Цена -->
<xsl:value-of select="format-number(price,'### ##0.00', 'my')"/>
<xsl:text> </xsl:text><xsl:value-of select="/shop/shop_order/shop_currency/name" disable-output-escaping="yes" />
</div>
<div class="shop_cart_item3">
<xsl:value-of select="round(quantity)"/><xsl:text> </xsl:text><xsl:value-of select="shop_item/shop_measure/name"/>
</div>
<div class="shop_cart_item4">
<!-- Сумма -->
<xsl:value-of select="format-number(quantity * price,'### ##0.00', 'my')"/>
<xsl:text> </xsl:text><xsl:value-of select="/shop/shop_order/shop_currency/name" disable-output-escaping="yes" />
</div>
</div>
</xsl:template>
</xsl:stylesheet>