Корзина. Вопрос.

#
Re: Корзина. Вопрос.
разве я преследую плохие цели.... половина нововведений АБОЦМС благодаря мне... я понимаю вам тяжело отвечать на возможно глупые вопросы... но если я действительно предлагаю отличные решения которые помогут не только мне но и многим другим покупателям или потенциальным покупателям, а сам незнаю как их изменить. По поводу кода... ХМЛ я его открывал мои данные что я передавал в нем отображаются... но при умножении выводит ошибку NaN. По поводу CapsLock прошу прощения... просто я уже ночью писал... и незаметил. Ведь проще ответить и помощь чем... все время показывать что Вы лучше знаете свою систему чем мы (в моем случае я).
Модератор
#
Re: Корзина. Вопрос.
wildthing,
на сколько я вижу команда поддержки все время отвечает, никоим образом не показывая, что мы чем то лучше.

wildthing писал(а):
... ХМЛ я его открывал мои данные что я передавал в нем отображаются... но при умножении выводит ошибку NaN

показывайте код, как не видя написанного Вами умножения мы можем сказать, что нужно поправить.
#
Re: Корзина. Вопрос.
<?xml version="1.0" encoding="windows-1251"?>
<cart>
<kurs>4.8</kurs>
<valuta>грн.</valuta>

<shop id="1">
<name>Интернет-магазин IBIT</name>
<description></description>
<path>/shop/</path>
<site_id>1</site_id>
<shop_image_small_max_width>100</shop_image_small_max_width>
<shop_image_big_max_width>800</shop_image_big_max_width>
<shop_image_small_max_height>100</shop_image_small_max_height>
<shop_image_big_max_height>800</shop_image_big_max_height>
<structure_id>42</structure_id>
<shop_country_id>223</shop_country_id>
<shop_currency id="1">
<shop_currency_name>$</shop_currency_name>
<shop_currency_international_name>USD</shop_currency_international_name>
<shop_currency_value_in_basic_currency>1.000000</shop_currency_value_in_basic_currency>
<shop_currency_is_default>1.000000</shop_currency_is_default>
</shop_currency>
<shop_order_status id="0">
</shop_order_status>
<shop_mesures id="29">
<shop_mesures_name>г</shop_mesures_name>
<shop_mesures_description>грамм</shop_mesures_description>
</shop_mesures>
<shop_shops_send_order_mail_admin>1</shop_shops_send_order_mail_admin>
<shop_shops_send_order_mail_user>1</shop_shops_send_order_mail_user>
<shop_shops_admin_mail>denis@ibit.com.ua</shop_shops_admin_mail>
</shop>
<user_id></user_id>
<site_users_class_exists>0</site_users_class_exists>
<itemincart id="0">
<item id="5646" group="985">
<captcha_key>61176</captcha_key>
<name>256Mb Foxconn GeForce 7600GS 2DVI/HDTV PCI-E</name>
<saller>0</saller>
<marking_of_goods>FV-N76SM2DT</marking_of_goods>
<description>256Mb &lt;PCI-E&gt; DDR Foxconn FV-N76SM2DT (RTL) 128bit+DVI+TV Out+SLI &lt;GeForce 7600GS&gt;</description>
<date>30.11.1999</date>
<datetime>30.11.1999 00:00:00</datetime>
<time>00:00:00</time>
<putoff_date>00.00.0000 00:00:00</putoff_date>
<putend_date>00.00.0000 00:00:00</putend_date>
<text>Производитель Foxconn
Модель FV-N76SM2DT
Чип GeForce 7600 GS
RAMDAC 400 МГц - 2 шт.
Максимальное разрешение 2D/3D 2048 x 1536 @ 85 Гц (при подключении к аналоговому монитору), 2560x1600 при подключению к DVI монитору.
Тип памяти DDR2
Интерфейс PCI Express 16x с возможностью объединения карт при помощи SLI.
Разрядность шины памяти 128 бит
Охлаждение Радиатор на процессоре.
Частота чипа 400 МГц
Частота памяти 400 МГц (800 МГц DDR)
Кол-во пиксельных конвейеров 12, 8 блоков выборки текстур
Поддержка API DirectX 9.0с, OpenGL 2.0
TV out S-video, RCA или Компонентный (RCA Y Pb Pr) через переходник
Порты 15-пиновый коннектор D-Sub, DVI-I
Поддержка ОС Windows XP, Windows 2000, Windows 2003 Server x64 (SP1), Windows XP 64-bit Edition x64, Linux IA32/AMD64/IA64, FreeBSD
Размеры упаковки (измерено в НИКСе) 28.1 х 19.3 х 5 см
Вес брутто (измерено в НИКСе) 0.689 кг</text>
<image width="400" height="329">/upload/shop_1/item_catalog_5646/shop_items_catalog_image5646.jpg</image>
<small_image width="100" height="82">/upload/shop_1/item_catalog_5646/small_shop_items_catalog_image5646.jpg</small_image>
<weight>0</weight>
<weight_mesure>г</weight_mesure>
<rest>1</rest>
<mesure></mesure>
<price>82.00</price>
<price_tax>82.00</price_tax>
<price_discount>82.00</price_discount>
<item_currency>$</item_currency>
<currency>$</currency>
<is_active>1</is_active>
<order>0</order>
<path>256mb-foxconn-geforce-7600gs-2dvihdtv-pci-e</path>
<fullpath>videoplaty/</fullpath><seo_title></seo_title>
<seo_description></seo_description>
<seo_keywords></seo_keywords>
<indexation>1</indexation>
<vendorCode></vendorCode>
</item>
<flag_postpone>1</flag_postpone>
<quantity>1</quantity>
<price_all>82.00</price_all>
</itemincart>
<itemincart id="0">
<item id="5648" group="985">
<captcha_key>91001</captcha_key>
<name>256Mb Zotac Geforce 8600 GTS, DDR3, PCI-E</name>
<saller>0</saller>
<marking_of_goods>ZT-86SE25P-FSR</marking_of_goods>
<description>256Mb Zotac Geforce 8600 GTS, DDR3, PCI-E</description>
<date>30.11.1999</date>
<datetime>30.11.1999 00:00:00</datetime>
<time>00:00:00</time>
<putoff_date>00.00.0000 00:00:00</putoff_date>
<putend_date>00.00.0000 00:00:00</putend_date>
<text>Описание  
Производитель Zotac
Модель ZT-86SE25P-FSR
Упаковка (единицы измерения) в коммерческой упаковке
Основные характеристики  
Тип 2D / 3D графическая карта для ПК
Интерфейс хост-контроллера PCI Express x16
Чипсет NVIDIA GeForce 8600 GTS
Технология 0.08 микрон
Частота RAMDAC 2 x 400 МГц
Частота чипа 675 МГц
Кол-во stream процессоров 32
Разрядность внутренней шины 128-бит.
Объединенные шейдеры 4.0
Кол-во пиксельных конвейеров 8
Макс. разрешение 2560 x 1600
Поддержка нескольких мониторов 2 x DVI + PAL/NTSC TV
Поддержка API Direct3D, DirectDraw, DirectX, OpenGL 2.0
Версия DirectX 10.0
Видеопамять 256 МБ DDR3 SDRAM, работает на частоте 2 ГГц
Свойства / особенности - HDCP
- Scalable Link Interface (SLI)
Дополнительные характеристики  
Видеостандарты HDTV
Формат видео сжатия H.264, MPEG-2, VC-1, WMV9
Программное обеспечение комплект драйверов and tools
Коннекторы 2 x DVI-I Dual Link • 29-штырьковый Molex
S-видео выход</text>
<weight>0</weight>
<weight_mesure>г</weight_mesure>
<rest>1</rest>
<mesure></mesure>
<price>140.00</price>
<price_tax>140.00</price_tax>
<price_discount>140.00</price_discount>
<item_currency>$</item_currency>
<currency>$</currency>
<is_active>1</is_active>
<order>0</order>
<path>256mb-zotac-geforce-8600-gts-ddr3-pci-e</path>
<fullpath>videoplaty/</fullpath><seo_title></seo_title>
<seo_description></seo_description>
<seo_keywords></seo_keywords>
<indexation>1</indexation>
<vendorCode></vendorCode>
</item>
<flag_postpone>0</flag_postpone>
<quantity>5</quantity>
<price_all>700.00</price_all>
</itemincart>
<itemincart id="0">
<item id="5978" group="1008">
<captcha_key>7308</captcha_key>
<name>!Монитор LG 19&quot; Flatron L1900R Black Glossy</name>
<saller>0</saller>
<marking_of_goods>FLL1900R-BF</marking_of_goods>
<description>Диагональ (&quot;): 19; Тип матрицы: TN+Film; Рекомендуемое разрешение/частота (Гц): 1280x1024; Время реакции (мс): 4; Контрастность: 2000:1; Яркость (кд/м2): 300; Угол обзора верт. (°): 170; Угол обзора гор. (°): 170; развертка по вертикали: 30 - 71; развертка по горизонтали: 30 - 83; 15pin D-Sub (аналоговый)</description>
<date>30.11.1999</date>
<datetime>30.11.1999 00:00:00</datetime>
<time>00:00:00</time>
<putoff_date>00.00.0000 00:00:00</putoff_date>
<putend_date>00.00.0000 00:00:00</putend_date>
<text>Тип матрицы TN+Film &lt;br&gt; Рекомендуемое разрешение/частота (Гц) 1280x1024 &lt;br&gt; Время реакции 4 мс &lt;br&gt; Контрастность 2000:1 &lt;br&gt; Яркость 300 кд/м2 &lt;br&gt; Угол обзора по вертикали 170 ° &lt;br&gt; Угол обзора по горизонтали 170 ° &lt;br&gt; Частота развертки (верт.) 30 - 71 Гц &lt;br&gt; Частота развертки (гор.) 30 - 83 КГц &lt;br&gt; Вход 15pin D-Sub (аналоговый)  &lt;br&gt; Вход DVI (цифровой)  &lt;br&gt; Стандарт безопасности TCO`03 &lt;br&gt; Габариты 417x114x432 мм &lt;br&gt; Вес 6.3 кг &lt;br&gt;    Дополнительные функции и возможности жк монитора LG L1900R:&lt;br&gt; Светодиодная подсветка подставки, наклон&lt;br&gt; Бескнопочное управление forte Manager, внешний блок разъемов&lt;br&gt;</text>
<producer id="13">
<name>LG</name>
<description></description>
<image></image>
<path>lg</path>
<shop_producers_list_name>LG</shop_producers_list_name>
<shop_producers_list_description></shop_producers_list_description>
<shop_producers_list_image></shop_producers_list_image>
<shop_producers_list_path>lg</shop_producers_list_path>
<shop_producers_list_address></shop_producers_list_address>
<shop_producers_list_fax></shop_producers_list_fax>
<shop_producers_list_site></shop_producers_list_site>
<shop_producers_list_email></shop_producers_list_email>
<shop_producers_list_inn></shop_producers_list_inn>
<shop_producers_list_kpp></shop_producers_list_kpp>
<shop_producers_list_ogrn></shop_producers_list_ogrn>
<shop_producers_list_okpo></shop_producers_list_okpo>
<shop_producers_list_okved></shop_producers_list_okved>
<shop_producers_list_bik></shop_producers_list_bik>
<shop_producers_list_account></shop_producers_list_account>
<shop_producers_list_corr_account></shop_producers_list_corr_account>
<shop_producers_list_bank_address></shop_producers_list_bank_address>
</producer>
<image width="200" height="200">/upload/shop_1/item_catalog_5978/shop_items_catalog_image5978.jpg</image>
<small_image width="100" height="100">/upload/shop_1/item_catalog_5978/small_shop_items_catalog_image5978.jpg</small_image>
<weight>0</weight>
<weight_mesure>г</weight_mesure>
<rest>1</rest>
<mesure></mesure>
<price>236.00</price>
<price_tax>236.00</price_tax>
<price_discount>236.00</price_discount>
<item_currency>$</item_currency>
<currency>$</currency>
<is_active>1</is_active>
<order>0</order>
<path>monitor-lg-19-flatron-l1900r-black-glossy</path>
<fullpath>monitory/</fullpath><seo_title></seo_title>
<seo_description></seo_description>
<seo_keywords></seo_keywords>
<indexation>1</indexation>
<vendorCode></vendorCode>
</item>
<flag_postpone>0</flag_postpone>
<quantity>2</quantity>
<price_all>472.00</price_all>
</itemincart>
<itemincart id="0">
<item id="5977" group="1008">
<captcha_key>75173</captcha_key>
<name>!Монитор LG 17&quot; Flatron L1753S Black</name>
<saller>0</saller>
<marking_of_goods>FLL1753S-BF</marking_of_goods>
<description>Диагональ (&quot;): 17; Тип матрицы: TN+Film; Рекомендуемое разрешение/частота (Гц): 1280x1024; Время реакции (мс): 5; Контрастность: 2000:1; Яркость (кд/м2): 300; Угол обзора верт. (°): 170; Угол обзора гор. (°): 170; развертка по вертикали: 56-75; развертка по горизонтали: 30-83; 15pin D-Sub (аналоговый)</description>
<date>30.11.1999</date>
<datetime>30.11.1999 00:00:00</datetime>
<time>00:00:00</time>
<putoff_date>00.00.0000 00:00:00</putoff_date>
<putend_date>00.00.0000 00:00:00</putend_date>
<text>Диагональ (&quot;): 17; Тип матрицы: TN+Film; Рекомендуемое разрешение/частота (Гц): 1280x1024; Время реакции (мс): 5; Контрастность: 2000:1; Яркость (кд/м2): 300; Угол обзора верт. (°): 170; Угол обзора гор. (°): 170; развертка по вертикали: 56-75; развертка по горизонтали: 30-83; 15pin D-Sub (аналоговый) &lt;p&gt; Тип матрицы TN+Film &lt;br&gt; Рекомендуемое разрешение/частота (Гц) 1280x1024 &lt;br&gt; Время реакции 5 мс &lt;br&gt; Контрастность 2000:1 &lt;br&gt; Яркость 300 кд/м2 &lt;br&gt; Угол обзора по вертикали 170 ° &lt;br&gt; Угол обзора по горизонтали 170 ° &lt;br&gt; Частота развертки (верт.) 56-75 Гц &lt;br&gt; Частота развертки (гор.) 30-83 КГц &lt;br&gt; Вход 15pin D-Sub (аналоговый)  &lt;br&gt; Стандарт безопасности TCO &lt;br&gt; Габариты 365х378х180 мм &lt;br&gt; Вес 3.1 кг &lt;p&gt;    Дополнительные функции и возможности жк монитора LG L1753S:&lt;br&gt; Количество цветов 16.2 млн&lt;br&gt; Настройка изображения f-Engine&lt;br&gt; Изменение угла наклона подставки&lt;br&gt; Возможность крепления на стену VESA (75x75)&lt;br&gt; Цветовые вариации:&lt;br&gt; LG L1753S-SF — серебристый &lt;br&gt; LG L1753S-BF — черный &lt;br&gt;</text>
<producer id="13">
<name>LG</name>
<description></description>
<image></image>
<path>lg</path>
<shop_producers_list_name>LG</shop_producers_list_name>
<shop_producers_list_description></shop_producers_list_description>
<shop_producers_list_image></shop_producers_list_image>
<shop_producers_list_path>lg</shop_producers_list_path>
<shop_producers_list_address></shop_producers_list_address>
<shop_producers_list_fax></shop_producers_list_fax>
<shop_producers_list_site></shop_producers_list_site>
<shop_producers_list_email></shop_producers_list_email>
<shop_producers_list_inn></shop_producers_list_inn>
<shop_producers_list_kpp></shop_producers_list_kpp>
<shop_producers_list_ogrn></shop_producers_list_ogrn>
<shop_producers_list_okpo></shop_producers_list_okpo>
<shop_producers_list_okved></shop_producers_list_okved>
<shop_producers_list_bik></shop_producers_list_bik>
<shop_producers_list_account></shop_producers_list_account>
<shop_producers_list_corr_account></shop_producers_list_corr_account>
<shop_producers_list_bank_address></shop_producers_list_bank_address>
</producer>
<image width="350" height="355">/upload/shop_1/item_catalog_5977/shop_items_catalog_image5977.jpg</image>
<small_image width="98" height="100">/upload/shop_1/item_catalog_5977/small_shop_items_catalog_image5977.jpg</small_image>
<weight>0</weight>
<weight_mesure>г</weight_mesure>
<rest>1</rest>
<mesure></mesure>
<price>225.00</price>
<price_tax>225.00</price_tax>
<price_discount>225.00</price_discount>
<item_currency>$</item_currency>
<currency>$</currency>
<is_active>1</is_active>
<order>0</order>
<path>monitor-lg-17-flatron-l1753s-black</path>
<fullpath>monitory/</fullpath><seo_title></seo_title>
<seo_description></seo_description>
<seo_keywords></seo_keywords>
<indexation>1</indexation>
<vendorCode></vendorCode>
</item>
<flag_postpone>0</flag_postpone>
<quantity>1</quantity>
<price_all>225.00</price_all>
</itemincart>
<totalquantity>8</totalquantity>
<totalweight>0</totalweight>
<totalsum>1397.00</totalsum>
<total_sum_without_discount>1397.00</total_sum_without_discount>
<totalquantity_postpone_item>1</totalquantity_postpone_item>
<totalweight_postpone_item>0</totalweight_postpone_item>
<totalsum_postpone_item>82.00</totalsum_postpone_item>
<count_item>3</count_item>
<count_postpone_item>1</count_postpone_item>
</cart>

XML вот... а вот XSL
<?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" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" encoding="Windows-1251" indent="yes" method="html" omit-xml-declaration="no" version="1.0" media-type="text/xml"/>
   
   <!-- Шаблон для корзины -->
   <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">В корзине нет ни одного товара.</p>
            
            <p>
               <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>Моя корзина</h1>
            
            <p>Для оформления заказа, нажмите "Оформить заказ".</p>
            
            <form action="{/cart/shop/path}cart/" name="address" method="POST">
               <table cellspacing="0" cellpadding="0" border="0" class="shop_cart_table">
                  <!-- Если есть товары -->
                  <xsl:if test="count(itemincart[flag_postpone=0]) &gt; 0">
                     <tr class="shop_cart_table_title">
                        <td>Изображение</td>
                        <td width="100">Товар</td>
                        <!--<td width="70">Вес</td>-->
                        <td width="70">Кол-во</td>
                        <td width="70">Цена</td>
                        <td>Сумма</td>
                        <td>Отложить</td>
                        <!--<td>Действия</td>-->
                     </tr>
                     <xsl:apply-templates select="itemincart[flag_postpone=0]"/>
                     <tr class="shop_cart_table">
                        <td>&#xA0;</td>
                        <td>
                           <b>Итого:</b>
                        </td>
                        <td>
                           <b>
                              <xsl:value-of disable-output-escaping="yes" select="totalquantity"/>
                           </b>
                        </td>
                        <td>&#xA0;</td>
                        <td>
                           <b>
                              <xsl:value-of disable-output-escaping="yes" select="total_sum_without_discount"/>&#xA0;<xsl:value-of disable-output-escaping="yes" select="shop/shop_currency/shop_currency_name"/> (<xsl:value-of disable-output-escaping="yes" select="total_sum_without_discount * kurs"/>&#xA0;<xsl:value-of disable-output-escaping="yes" select="valuta"/>)</b>
                        </td>
                        <td>&#xA0;</td>
                        <!--<td>&#xA0;</td>-->
                     </tr>
                     <xsl:if test="total_sum_without_discount &gt; totalsum">
                        <tr class="shop_cart_table">
                           <td style="border-bottom: thin dashed #DADADA">
                              &#xA0;
                           </td>
                           <td style="border-bottom: thin dashed #DADADA">
                              <b>Скидка:</b>
                           </td>
                           <td style="border-bottom: thin dashed #DADADA">&#xA0;</td>
                           <td style="border-bottom: thin dashed #DADADA">&#xA0;</td>
                           <td style="border-bottom: thin dashed #DADADA">
                              <b>
                                 <xsl:value-of disable-output-escaping="yes" select="format-number(total_sum_without_discount - totalsum, '#.')"/>&#xA0;<xsl:value-of disable-output-escaping="yes" select="shop/currency"/></b>
                           </td>
                           <td style="border-bottom: thin dashed #DADADA">&#xA0;</td>
                        </tr>
                        <tr class="shop_cart_table">
                           <td style="border-bottom: none">
                              &#xA0;
                           </td>
                           <td style="border-bottom: none">
                              <b>Всего:</b>
                           </td>
                           <td style="border-bottom: none">&#xA0;</td>
                           <td style="border-bottom: none">&#xA0;</td>
                           <td style="border-bottom: none">
                              <b>
                                 <xsl:value-of disable-output-escaping="yes" select="totalsum"/>&#xA0;<xsl:value-of disable-output-escaping="yes" select="shop/currency"/></b>
                           </td>
                           <td style="border-bottom: none">&#xA0;</td>
                        </tr>
                        
                     </xsl:if>
                     
                  </xsl:if>
                  
                  <!-- Если есть отложенные товары -->
                  <xsl:if test="count(itemincart[flag_postpone=1]) &gt; 0">
                     <tr class="shop_cart_table">
                        <td colspan="7" style="padding-top:10px">
                           <strong>
                              <big>Отложенные товары</big>
                           </strong>
                        </td>
                        
                        
                     </tr>
                     <tr class="shop_cart_table_title">
                        <td>Изображение</td>
                        <td>Название</td>
                        <!--<td width="70">Вес</td>-->
                        <td width="70">Кол-во</td>
                        <td width="70">Цена</td>
                        <td>Сумма</td>
                        <td>Отложить</td>
                        <!--<td>Действия</td>-->
                     </tr>
                     <xsl:apply-templates select="itemincart[flag_postpone=1]"/>
                     <tr class="shop_cart_table">
                        <td>
                           <b>Итого:</b>
                        </td>
                        <td>&#xA0;</td>
                        <!--<td>
                           <xsl:if test="totalweight > 0">
                              <b><xsl:value-of disable-output-escaping="yes" select="totalweight" />&#xA0;<xsl:value-of disable-output-escaping="yes" select="shop/shop_mesures_name" /></b>
                           </xsl:if>
                        </td>-->
                        <td>
                           <b>
                              <xsl:value-of disable-output-escaping="yes" select="totalquantity_postpone_item"/>
                           </b>
                        </td>
                        <td>&#xA0;</td>
                        <td>
                           <b>
                              <xsl:value-of disable-output-escaping="yes" select="totalsum_postpone_item"/>&#xA0;<xsl:value-of disable-output-escaping="yes" select="shop/currency"/> (<xsl:value-of disable-output-escaping="yes" select="totalsum_postpone_item * kurs"/>&#xA0;<xsl:value-of disable-output-escaping="yes" select="valuta"/>)</b>
                        </td>
                        <td>&#xA0;</td>
                        
                     </tr>
                  </xsl:if>
               </table>
               
               <!-- Купон -->
               <div style="padding: 5px;">
                  Купон:&#xA0;
                  <input name="shop_coupon_text" type="text" value="{coupon_text}" style="margin-right: 10px"/>
               </div>
               
               <!-- Кнопки -->
               <input name="recount" value="Пересчитать" type="submit" style="margin-right: 10px"/>
               
               <xsl:choose>
                  <xsl:when test="site_users_class_exists = 1"></xsl:when>
                  <xsl:otherwise>
                     <!-- В случае если отключен модуль пользователей сайта, запрашиваем информацию
                     о пользователе сайта здесь -->
                     <table border="0" cellspacing="0" cellpadding="2">
                        <tr class="shop_cart_table_title">
                           <td colspan="2" align="center">Данные о заказчике</td>
                        </tr>
                        <tr>
                           <td>Фамилия</td>
                           <td>
                              <input name="site_users_surname" type="text" value="" size="40"/>
                           </td>
                        </tr>
                        <tr>
                           <td>Имя</td>
                           <td>
                              <input name="site_users_name" type="text" value="" size="40"/>
                           </td>
                        </tr>
                        <tr>
                           <td>Отчество</td>
                           <td>
                              <input name="site_users_patronymic" type="text" value="" size="40"/>
                           </td>
                        </tr>
                        <tr>
                           <td>E-mail</td>
                           <td>
                              <input name="site_users_email" type="text" value="" size="40"/>
                           </td>
                        </tr>
                        <tr>
                           <td>Телефон</td>
                           <td>
                              <input name="site_users_phone" type="text" value="" size="40"/>
                           </td>
                        </tr>
                        <tr>
                           <td>Факс</td>
                           <td>
                              <input name="site_users_fax" type="text" value="" size="40"/>
                           </td>
                        </tr>
                        <tr>
                           <td>Адрес</td>
                           <td>
                              <input name="site_users_address" type="text" value="" size="40"/>
                           </td>
                        </tr>
                     </table>
                     <!-- Добавляем скрытое поле с указанием подшага -->
                     <input name="step_1_1a" type="hidden" value="1"/>
                  </xsl:otherwise>
               </xsl:choose>
               <xsl:if test="user_id != 0 or site_users_class_exists = 0">
                  <input name="step_1" value="Оформить заказ" type="submit" style="font-weight: bold"/>
               </xsl:if>
            </form>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>
   
   <!-- Шаблон для товара в корзине -->
   <xsl:template match="itemincart">
      <tr class="shop_cart_table">
         <td>
            <xsl:if test="item/small_image!=''">
               <img src="{item/small_image}"/>
            </xsl:if>
            <br/>
            <a href="?action=delete_item&amp;item_id={item/@id}">Удалить из корзины</a>
         </td>
         <td>
            
            <a href="{/cart/shop/path}{item/fullpath}{item/path}/">
               <xsl:value-of disable-output-escaping="yes" select="item/name"/>
            </a>
            <!-- Средняя оценка товара -->
            <div style="float: left; margin: 20px 0px 0px 0px">
               <b>Рейтинг:</b>
               <br/>
               <xsl:if test="item/comments/average_grade/node()">
                  <xsl:call-template name="show_average_grade">
                     <xsl:with-param name="grade" select="item/comments/average_grade"/>
                     <xsl:with-param name="const_grade" select="5"/>
                  </xsl:call-template>
               </xsl:if>
               <xsl:if test="not(item/comments/average_grade/node())">
                  <xsl:call-template name="show_average_grade">
                     <xsl:with-param name="grade" select="0"/>
                     <xsl:with-param name="const_grade" select="5"/>
                  </xsl:call-template>
               </xsl:if>
            </div>
            
            <div style="clear: both"></div>
         </td>
         <td style="white-space: nowrap">
            <input type="text" size="3" name="{item/@id}" value="{quantity}"/>&#xA0;<xsl:value-of select="item/mesure" disable-output-escaping="yes"/></td>
         <td style="white-space: nowrap">
            <!-- Цена -->
            <xsl:value-of disable-output-escaping="yes" select="item/price"/>&#xA0;<xsl:value-of select="item/currency" disable-output-escaping="yes"/> (<xsl:value-of disable-output-escaping="yes" select="item/price * kurs"/>&#xA0;<xsl:value-of disable-output-escaping="yes" select="valuta"/>)</td>
         <td style="white-space: nowrap">
            <!-- Сумма -->
            <xsl:value-of disable-output-escaping="yes" select="item/price * quantity"/>&#xA0;<xsl:value-of disable-output-escaping="yes" select="item/currency"/> (<xsl:value-of disable-output-escaping="yes" select="item/price * quantity * kurs"/>&#xA0;<xsl:value-of disable-output-escaping="yes" select="valuta"/>)</td>
         <td align="center">
            <!-- Отложенные товары -->
            <xsl:choose>
               <xsl:when test="flag_postpone=1">
                  <input type="checkbox" name="flag_postpone{item/@id}" checked=""/>
               </xsl:when>
               <xsl:otherwise>
                  <input type="checkbox" name="flag_postpone{item/@id}"/>
               </xsl:otherwise>
            </xsl:choose>
         </td>
         
      <!--<td align="center"><a href="?action=delete_item&amp;item_id={item/@id}" title="Удалить товар из корзины" alt="Удалить товар из корзины"><img src="/hostcmsfiles/images/delete.gif" /></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 &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"/>
            </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"/>
         </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>&#xA0;
      <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 &gt; $i and $n &gt; 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>
</xsl:stylesheet>

А вот... что выходит.... hххp://ibit.com.ua/shop/cart/ (только добавьте товар в корзинку какойто)ну и по по самому магазину тоже все также сделал...
Модератор
#
Re: Корзина. Вопрос.
wildthing,
вместо
<xsl:value-of disable-output-escaping="yes" select="total_sum_without_discount * kurs"/>&#xA0;<xsl:value-of disable-output-escaping="yes" select="valuta"/>

укажите
<xsl:value-of disable-output-escaping="yes" select="total_sum_without_discount * /cart/kurs"/>&#xA0;<xsl:value-of disable-output-escaping="yes" select="/cart/valuta"/>
#
Re: Корзина. Вопрос.
спасибо а в магазине вместо kurs указать /shop/kurs ))) так и знал что все на самом деле просто.... а с баг с отложенными товарами? как с ним быть
Модератор
#
Re: Корзина. Вопрос.
Если корзина стандартная, обновите XSL-шаблон для корзины с демо-сайта.
Если были изменения, ниже привожу измененный фрагмент:
<!-- Если есть отложенные товары -->
                  <xsl:if test="count(itemincart[flag_postpone=1]) &gt; 0">
                     <tr class="shop_cart_table">
                        <td colspan="7" style="padding-top:10px">
                           <strong>
                              <big>Отложенные товары</big>
                           </strong>
                        </td>
                     </tr>
                     <tr class="shop_cart_table_title">
                        <td>Изображение</td>
                        <td>Название</td>
                        <!--<td width="70">Вес</td>-->
                        <td width="70">Кол &#x2014; во</td>
                        <td width="70">Цена</td>
                        <td>Сумма</td>
                        <td>Отложить</td>
                        <!--<td>Действия</td>-->
                     </tr>
                     <xsl:apply-templates select="itemincart[flag_postpone=1]"/>
                     <tr class="shop_cart_table">
                        <td>&#xA0;</td>
                        <td>
                           <b>Итого:</b>
                        </td>
                        <td>
                           <b>
                              <xsl:value-of disable-output-escaping="yes" select="totalquantity_postpone_item"/>
                           </b>
                        </td>
                        <td>&#xA0;</td>
                        <td>
                           <b>
                              <xsl:value-of disable-output-escaping="yes" select="totalsum_postpone_item"/>&#xA0;<xsl:value-of disable-output-escaping="yes" select="shop/shop_currency/shop_currency_name"/></b>
                        </td>
                        <td>&#xA0;</td>
                        <td>&#xA0;</td>
                     </tr>
                  </xsl:if>
#
Re: Корзина. Вопрос.
Еще один глюк нашел... Доставка... у меня в гривнах... 25грн. когда начинаю оформлять товар... то мне выдает 180уе.. в чем может быть проблема... если я указываю 5уе в доставке то все нормально... а если меняю на другую валюту... то валюта не меняется ... а умножается на курс
#
Re: Корзина. Вопрос.
и вот такая штука... все теперь работает на ура... огромное Вам спасибо... (я про две валюты) все... кроме маленькой корзины которая на AJAX

<?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" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" encoding="Windows-1251" indent="yes" method="html" omit-xml-declaration="no" version="1.0" media-type="text/xml"/>
   
   <xsl:template match="/cart">
      
      <div id="little_cart">
         
         <xsl:choose>
            <!-- Магазин не найден -->
            <xsl:when test="error_not_isset_shop/node()">
               <p>
                  <b>Ошибка! Магазин с указанным идентификатором не найден!</b>
                  <br/>Укажите правильный код магазина!</p>
            </xsl:when>
            <!-- Магазин найден -->
            <xsl:otherwise>a
               
               <xsl:choose>
                  <!-- В корзине нет ни одного элемента -->
                  <xsl:when test="totalquantity = 0">
                     <h2>Корзина пуста</h2>
                     <xsl:choose>
                        <xsl:when test="site_users_class_exists = 1 and user_id = 0">
                           <p>Если Вы зарегистрированный пользователь, данные Вашей корзины станут видны после авторизации.</p>
                        </xsl:when>
                        <xsl:otherwise>Перейдите в каталог, выберите требуемый товар и добавьте его в корзину.</xsl:otherwise>
                     </xsl:choose>
                  </xsl:when>
                  <xsl:otherwise>
                     <h2>Моя корзина</h2>
                     
                     <!-- Вывод общих количества, веса и стоимости товаров -->
                     <p>В корзине <b><xsl:value-of select="totalquantity"/></b>&#xA0;<xsl:call-template name="declension">
                           <xsl:with-param name="number" select="totalquantity"/></xsl:call-template>
                     <br/>на сумму <b><xsl:value-of select="totalsum"/>&#xA0;<xsl:value-of disable-output-escaping="yes" select="shop/shop_currency/shop_currency_name"/> </b> (<xsl:value-of select="totalsum * /cart/kurs"/>&#xA0;<xsl:value-of disable-output-escaping="yes" select="/cart/valuta"/>)</p>
                     
                     <xsl:if test="totalweight &gt; 0">
                     <p>Общий вес заказа <b><xsl:value-of select="totalweight"/>&#xA0;<xsl:value-of select="shop/shop_mesures/shop_mesures_name"/></b>.</p>
                     </xsl:if>
                     
                     <p>
                        <a href="{/cart/shop/path}cart/">Перейти в корзину</a>
                     </p>
                  </xsl:otherwise>
               </xsl:choose>
            </xsl:otherwise>
         </xsl:choose>
      </div>
   </xsl:template>
   
   <!-- Склонение после числительных -->
   <xsl:template name="declension">
      
      <xsl:param name="number" select="number"/>
      
      <!-- Именительный падеж -->
      <xsl:variable name="nominative">
         <xsl:text>товар</xsl:text>
      </xsl:variable>
      
      <!-- Родительный падеж, единственное число -->
      <xsl:variable name="genitive_singular">
         <xsl:text>товара</xsl:text>
      </xsl:variable>
      
      
      <xsl:variable name="genitive_plural">
         <xsl:text>товаров</xsl:text>
      </xsl:variable>
      
      <xsl:variable name="last_digit">
         <xsl:value-of select="$number mod 10"/>
      </xsl:variable>
      
      <xsl:variable name="last_two_digits">
         <xsl:value-of select="$number mod 100"/>
      </xsl:variable>
      
      <xsl:choose>
         <xsl:when test="$last_digit = 1 and $last_two_digits != 11">
            <xsl:value-of select="$nominative"/>
         </xsl:when>
         <xsl:when test="$last_digit = 2 and $last_two_digits != 12     or     $last_digit = 3 and $last_two_digits != 13     or     $last_digit = 4 and $last_two_digits != 14">
            <xsl:value-of select="$genitive_singular"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:value-of select="$genitive_plural"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>
</xsl:stylesheet>
вот код шаблона

а вот ХМЛ


<?xml version="1.0" encoding="windows-1251"?>
<cart>
<kurs>4.8</kurs>
<valuta>грн.</valuta>
<shop id="1">
<name>Интернет-магазин IBIT</name>
<description></description>
<path>/shop/</path>
<site_id>1</site_id>
<shop_image_small_max_width>100</shop_image_small_max_width>
<shop_image_big_max_width>800</shop_image_big_max_width>
<shop_image_small_max_height>100</shop_image_small_max_height>
<shop_image_big_max_height>800</shop_image_big_max_height>
<structure_id>42</structure_id>
<shop_country_id>223</shop_country_id>
<shop_currency id="1">
<shop_currency_name>$</shop_currency_name>
<shop_currency_international_name>USD</shop_currency_international_name>
<shop_currency_value_in_basic_currency>1.000000</shop_currency_value_in_basic_currency>
<shop_currency_is_default>1.000000</shop_currency_is_default>
</shop_currency>
<shop_order_status id="0">
</shop_order_status>
<shop_mesures id="29">
<shop_mesures_name>г</shop_mesures_name>
<shop_mesures_description>грамм</shop_mesures_description>
</shop_mesures>
<shop_shops_send_order_mail_admin>1</shop_shops_send_order_mail_admin>
<shop_shops_send_order_mail_user>1</shop_shops_send_order_mail_user>
<shop_shops_admin_mail>denis@ibit.com.ua</shop_shops_admin_mail>
</shop>
<user_id></user_id>
<site_users_class_exists>0</site_users_class_exists>
<itemincart id="0">
<item id="5646" group="985">
<captcha_key>86960</captcha_key>
<name>256Mb Foxconn GeForce 7600GS 2DVI/HDTV PCI-E</name>
<saller>0</saller>
<marking_of_goods>FV-N76SM2DT</marking_of_goods>
<description>256Mb &lt;PCI-E&gt; DDR Foxconn FV-N76SM2DT (RTL) 128bit+DVI+TV Out+SLI &lt;GeForce 7600GS&gt;</description>
<date>30.11.1999</date>
<datetime>30.11.1999 00:00:00</datetime>
<time>00:00:00</time>
<putoff_date>00.00.0000 00:00:00</putoff_date>
<putend_date>00.00.0000 00:00:00</putend_date>
<text>Производитель Foxconn
Модель FV-N76SM2DT
Чип GeForce 7600 GS
RAMDAC 400 МГц - 2 шт.
Максимальное разрешение 2D/3D 2048 x 1536 @ 85 Гц (при подключении к аналоговому монитору), 2560x1600 при подключению к DVI монитору.
Тип памяти DDR2
Интерфейс PCI Express 16x с возможностью объединения карт при помощи SLI.
Разрядность шины памяти 128 бит
Охлаждение Радиатор на процессоре.
Частота чипа 400 МГц
Частота памяти 400 МГц (800 МГц DDR)
Кол-во пиксельных конвейеров 12, 8 блоков выборки текстур
Поддержка API DirectX 9.0с, OpenGL 2.0
TV out S-video, RCA или Компонентный (RCA Y Pb Pr) через переходник
Порты 15-пиновый коннектор D-Sub, DVI-I
Поддержка ОС Windows XP, Windows 2000, Windows 2003 Server x64 (SP1), Windows XP 64-bit Edition x64, Linux IA32/AMD64/IA64, FreeBSD
Размеры упаковки (измерено в НИКСе) 28.1 х 19.3 х 5 см
Вес брутто (измерено в НИКСе) 0.689 кг</text>
<image width="400" height="329">/upload/shop_1/item_catalog_5646/shop_items_catalog_image5646.jpg</image>
<small_image width="100" height="82">/upload/shop_1/item_catalog_5646/small_shop_items_catalog_image5646.jpg</small_image>
<weight>0</weight>
<weight_mesure>г</weight_mesure>
<rest>1</rest>
<mesure></mesure>
<price>82.00</price>
<price_tax>82.00</price_tax>
<price_discount>82.00</price_discount>
<item_currency>$</item_currency>
<currency>$</currency>
<is_active>1</is_active>
<order>0</order>
<path>256mb-foxconn-geforce-7600gs-2dvihdtv-pci-e</path>
<fullpath>videoplaty/</fullpath><seo_title></seo_title>
<seo_description></seo_description>
<seo_keywords></seo_keywords>
<indexation>1</indexation>
<vendorCode></vendorCode>
</item>
<flag_postpone>1</flag_postpone>
<quantity>1</quantity>
<price_all>82.00</price_all>
</itemincart>
<itemincart id="0">
<item id="6253" group="1016">
<captcha_key>77682</captcha_key>
<name>МФУ A4 HP DeskJet F2180</name>
<saller>0</saller>
<marking_of_goods>CB596A</marking_of_goods>
<description>Описание временно отсутствует</description>
<date>30.11.1999</date>
<datetime>30.11.1999 00:00:00</datetime>
<time>00:00:00</time>
<putoff_date>00.00.0000 00:00:00</putoff_date>
<putend_date>00.00.0000 00:00:00</putend_date>
<text>Описание временно отсутствует</text>
<producer id="50">
<name>HP</name>
<description></description>
<image></image>
<path></path>
<shop_producers_list_name>HP</shop_producers_list_name>
<shop_producers_list_description></shop_producers_list_description>
<shop_producers_list_image></shop_producers_list_image>
<shop_producers_list_path></shop_producers_list_path>
<shop_producers_list_address></shop_producers_list_address>
<shop_producers_list_fax></shop_producers_list_fax>
<shop_producers_list_site></shop_producers_list_site>
<shop_producers_list_email></shop_producers_list_email>
<shop_producers_list_inn></shop_producers_list_inn>
<shop_producers_list_kpp></shop_producers_list_kpp>
<shop_producers_list_ogrn></shop_producers_list_ogrn>
<shop_producers_list_okpo></shop_producers_list_okpo>
<shop_producers_list_okved></shop_producers_list_okved>
<shop_producers_list_bik></shop_producers_list_bik>
<shop_producers_list_account></shop_producers_list_account>
<shop_producers_list_corr_account></shop_producers_list_corr_account>
<shop_producers_list_bank_address></shop_producers_list_bank_address>
</producer>
<image width="300" height="300">/upload/shop_1/item_catalog_6253/shop_items_catalog_image6253.jpg</image>
<small_image width="100" height="100">/upload/shop_1/item_catalog_6253/small_shop_items_catalog_image6253.jpg</small_image>
<weight>0</weight>
<weight_mesure>г</weight_mesure>
<rest>1</rest>
<mesure></mesure>
<price>80.00</price>
<price_tax>80.00</price_tax>
<price_discount>80.00</price_discount>
<item_currency>$</item_currency>
<currency>$</currency>
<is_active>1</is_active>
<order>0</order>
<path>mfu-a4-hp-deskjet-f2180</path>
<fullpath>printery-i-mfu/mnogofunktsionalnye-strujjnye/</fullpath><seo_title></seo_title>
<seo_description></seo_description>
<seo_keywords></seo_keywords>
<indexation>1</indexation>
<vendorCode></vendorCode>
</item>
<flag_postpone>0</flag_postpone>
<quantity>1</quantity>
<price_all>80.00</price_all>
</itemincart>
<totalquantity>1</totalquantity>
<totalweight>0</totalweight>
<totalsum>80.00</totalsum>
<total_sum_without_discount>80.00</total_sum_without_discount>
<totalquantity_postpone_item>1</totalquantity_postpone_item>
<totalweight_postpone_item>0</totalweight_postpone_item>
<totalsum_postpone_item>82.00</totalsum_postpone_item>
<count_item>1</count_item>
<count_postpone_item>1</count_postpone_item>
</cart>

когда товар в корзине... все суммы... отлично отображаются... а когда добавляешь новый товар сразу выдает NaN
Модератор
#
Re: Корзина. Вопрос.
wildthing писал(а):
Еще один глюк нашел... Доставка... у меня в гривнах... 25грн. когда начинаю оформлять товар... то мне выдает 180уе.. в чем может быть проблема...

если используются стандартные механизмы, напишите в поддержку, нужно смотреть.

#
Re: Корзина. Вопрос.
ок. а как с AJAX быть? есть решение?
Авторизация