Уведомление менеджеру о заказе, со всем необходимыми данными (emarket) XSLT — различия между версиями
Материал из Umicms
Mad grant (обсуждение | вклад) |
Alexei (обсуждение | вклад) |
||
(не показано 8 промежуточных версий 3 участников) | |||
Строка 1: | Строка 1: | ||
− | |||
'''Актуально для версии 2.9''' | '''Актуально для версии 2.9''' | ||
[[Категория:Модуль Интернет магазин]] | [[Категория:Модуль Интернет магазин]] | ||
− | |||
− | + | За отправку письма менеджеру отвечает файл '''default.xsl''' находящийся в папке ''/templates/demodizzy/xslt/mail/emarket/''. В нем описан шаблон: | |
− | + | <source lang="xml"> | |
− | + | <xsl:template match="neworder_notification"> | |
− | + | <xsl:text>Поступил новый заказ #</xsl:text> | |
− | + | <xsl:value-of select="order_number" /> | |
− | + | <xsl:text> (</xsl:text> | |
− | + | <a href="http://{domain}/admin/emarket/order_edit/{order_id}/"> | |
− | < | + | <xsl:text>Просмотр</xsl:text> |
− | + | </a> | |
− | + | <xsl:text>)</xsl:text><br/><br/> | |
− | + | <xsl:text>Способ оплаты: </xsl:text> | |
− | + | <xsl:value-of select="payment_type" /><br/> | |
− | + | <xsl:text>Статус оплаты: </xsl:text> | |
− | + | <xsl:value-of select="payment_status" /><br/> | |
− | + | <xsl:text>Сумма оплаты: </xsl:text> | |
− | + | <xsl:value-of select="price" /><br/> | |
− | + | </xsl:template> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</source> | </source> | ||
− | |||
− | + | Что бы менеджеру приходила информация о пользователе который оставил заказ добавим к шаблону следующие строки: | |
− | |||
<source lang="xml"> | <source lang="xml"> | ||
− | + | <xsl:variable select="document(concat('uobject://',order_id))//property[@name='customer_id']/value/item/@id" name="customer1"/> | |
− | + | <xsl:text>Имя: </xsl:text> | |
− | + | <xsl:value-of select="document(concat('uobject://',$customer1))//property[@name='fname']/value" /> | |
− | + | <br /><br /> | |
− | + | <xsl:text>Фамилия: </xsl:text> | |
− | + | <xsl:value-of select="document(concat('uobject://',$customer1))//property[@name='lname']/value" /> | |
− | + | <br /><br /> | |
− | + | <xsl:text>Отчество: </xsl:text> | |
− | + | <xsl:value-of select="document(concat('uobject://',$customer1))//property[@name='father_name']/value" /> | |
− | + | <br /><br /> | |
− | + | <xsl:text>E-mail: </xsl:text> | |
− | + | <xsl:value-of select="document(concat('uobject://',$customer1))//property[@name='email']/value" /> | |
− | + | <br /><br /> | |
− | + | <xsl:text>Телефон: </xsl:text> | |
− | + | <xsl:value-of select="document(concat('uobject://',$customer1))//property[@name='phone']/value" /> | |
− | + | <br /><br /> | |
− | + | <xsl:text>Адрес доставки: </xsl:text> | |
− | + | <br /><br /> | |
− | + | <xsl:variable select="document(concat('uobject://',order_id))//property[@name='delivery_address']/value/item/@id" name="delivery1"/> | |
− | + | <xsl:text>Страна: </xsl:text> | |
− | + | <xsl:value-of select="document(concat('uobject://',$delivery1))//property[@name='country']/value" /> | |
− | + | <br /><br /> | |
− | + | <xsl:text>Индекс: </xsl:text> | |
− | + | <xsl:value-of select="document(concat('uobject://',$delivery1))//property[@name='index']/value" /> | |
− | + | <br /><br /> | |
− | + | <xsl:text>Регион: </xsl:text> | |
− | + | <xsl:value-of select="document(concat('uobject://',$delivery1))//property[@name='region']/value" /> | |
− | + | <br /><br /> | |
− | + | <xsl:text>Город: </xsl:text> | |
+ | <xsl:value-of select="document(concat('uobject://',$delivery1))//property[@name='city']/value" /> | ||
+ | <br /><br /> | ||
+ | <xsl:text>Улица: </xsl:text> | ||
+ | <xsl:value-of select="document(concat('uobject://',$delivery1))//property[@name='street']/value" /> | ||
+ | <br /><br /> | ||
+ | <xsl:text>Дом: </xsl:text> | ||
+ | <xsl:value-of select="document(concat('uobject://',$delivery1))//property[@name='house']/value" /> | ||
+ | <br /><br /> | ||
+ | <xsl:text>Квартира: </xsl:text> | ||
+ | <xsl:value-of select="document(concat('uobject://',$delivery1))//property[@name='flat']/value" /> | ||
+ | <br /><br /> | ||
+ | <xsl:text>Комментарий к адресу: </xsl:text> | ||
+ | <xsl:value-of select="document(concat('uobject://',$delivery1))//property[@name='order_comments']/value" /> | ||
</source> | </source> | ||
− |
Текущая версия на 13:14, 3 августа 2015
Актуально для версии 2.9
За отправку письма менеджеру отвечает файл default.xsl находящийся в папке /templates/demodizzy/xslt/mail/emarket/. В нем описан шаблон:
<xsl:template match="neworder_notification">
<xsl:text>Поступил новый заказ #</xsl:text>
<xsl:value-of select="order_number" />
<xsl:text> (</xsl:text>
<a href="http://{domain}/admin/emarket/order_edit/{order_id}/">
<xsl:text>Просмотр</xsl:text>
</a>
<xsl:text>)</xsl:text><br/><br/>
<xsl:text>Способ оплаты: </xsl:text>
<xsl:value-of select="payment_type" /><br/>
<xsl:text>Статус оплаты: </xsl:text>
<xsl:value-of select="payment_status" /><br/>
<xsl:text>Сумма оплаты: </xsl:text>
<xsl:value-of select="price" /><br/>
</xsl:template>
Что бы менеджеру приходила информация о пользователе который оставил заказ добавим к шаблону следующие строки:
<xsl:variable select="document(concat('uobject://',order_id))//property[@name='customer_id']/value/item/@id" name="customer1"/>
<xsl:text>Имя: </xsl:text>
<xsl:value-of select="document(concat('uobject://',$customer1))//property[@name='fname']/value" />
<br /><br />
<xsl:text>Фамилия: </xsl:text>
<xsl:value-of select="document(concat('uobject://',$customer1))//property[@name='lname']/value" />
<br /><br />
<xsl:text>Отчество: </xsl:text>
<xsl:value-of select="document(concat('uobject://',$customer1))//property[@name='father_name']/value" />
<br /><br />
<xsl:text>E-mail: </xsl:text>
<xsl:value-of select="document(concat('uobject://',$customer1))//property[@name='email']/value" />
<br /><br />
<xsl:text>Телефон: </xsl:text>
<xsl:value-of select="document(concat('uobject://',$customer1))//property[@name='phone']/value" />
<br /><br />
<xsl:text>Адрес доставки: </xsl:text>
<br /><br />
<xsl:variable select="document(concat('uobject://',order_id))//property[@name='delivery_address']/value/item/@id" name="delivery1"/>
<xsl:text>Страна: </xsl:text>
<xsl:value-of select="document(concat('uobject://',$delivery1))//property[@name='country']/value" />
<br /><br />
<xsl:text>Индекс: </xsl:text>
<xsl:value-of select="document(concat('uobject://',$delivery1))//property[@name='index']/value" />
<br /><br />
<xsl:text>Регион: </xsl:text>
<xsl:value-of select="document(concat('uobject://',$delivery1))//property[@name='region']/value" />
<br /><br />
<xsl:text>Город: </xsl:text>
<xsl:value-of select="document(concat('uobject://',$delivery1))//property[@name='city']/value" />
<br /><br />
<xsl:text>Улица: </xsl:text>
<xsl:value-of select="document(concat('uobject://',$delivery1))//property[@name='street']/value" />
<br /><br />
<xsl:text>Дом: </xsl:text>
<xsl:value-of select="document(concat('uobject://',$delivery1))//property[@name='house']/value" />
<br /><br />
<xsl:text>Квартира: </xsl:text>
<xsl:value-of select="document(concat('uobject://',$delivery1))//property[@name='flat']/value" />
<br /><br />
<xsl:text>Комментарий к адресу: </xsl:text>
<xsl:value-of select="document(concat('uobject://',$delivery1))//property[@name='order_comments']/value" />