Связать кнопку "Количество товаров" с Корзиной
letmedie
15 июля 2013 г.
В таблице есть поле, в которое можно вписать нужное кол-во товаров, а под таблицей кнопка "Добавить в Корзину". Но я не знаю как объединить их... т.е. вписываю 10, жму на Добавить в Корзину, а в Корзине все равно один товар. Вот код:
Что мне надо добавить?
<form action="#" class="catalog_form">
<table>
<tr>
<th class="model">Модель</th>
<th>Производитель</th>
<th>Цена</th>
<th>Наличие</th>
<th>Количество</th>
</tr>
<tr>
<td class="model">
<a href="{url}" title="{name}" hostcms:id="{@id}" hostcms:field="name" hostcms:entity="shop_item">
<xsl:value-of disable-output-escaping="yes" select="name"/>
</a>
</td>
<td>
<xsl:value-of disable-output-escaping="yes" select="shop_producer/name"/>
</td>
<td class="grey">
<xsl:value-of select="format-number(price, '### ##0,00', 'my')"/><xsl:text> </xsl:text><xsl:value-of select="currency"/><xsl:text> </xsl:text>
</td>
<td class="grey">
<xsl:if test="rest > 0 and type != 1">
В НАЛИЧИИ
</xsl:if>
<xsl:if test="rest = 0 and type != 1">
ПОД ЗАКАЗ
</xsl:if>
</td>
<td>
<input type="text" value="1" id="count_{@id}" />
</td>
</tr>
</table>
<xsl:if test="type = 0 or (type = 1 and (digitals > 0 or digitals = -1))">
<a class="theaddtocartbutton" href="{/shop/url}cart/?add={@id}" onclick="return $.addIntoCart('{/shop/url}cart/', {@id}, document.getElementById('count_{@id}').value)">
Добавить в корзину
</a>
</xsl:if>
</form>
<table>
<tr>
<th class="model">Модель</th>
<th>Производитель</th>
<th>Цена</th>
<th>Наличие</th>
<th>Количество</th>
</tr>
<tr>
<td class="model">
<a href="{url}" title="{name}" hostcms:id="{@id}" hostcms:field="name" hostcms:entity="shop_item">
<xsl:value-of disable-output-escaping="yes" select="name"/>
</a>
</td>
<td>
<xsl:value-of disable-output-escaping="yes" select="shop_producer/name"/>
</td>
<td class="grey">
<xsl:value-of select="format-number(price, '### ##0,00', 'my')"/><xsl:text> </xsl:text><xsl:value-of select="currency"/><xsl:text> </xsl:text>
</td>
<td class="grey">
<xsl:if test="rest > 0 and type != 1">
В НАЛИЧИИ
</xsl:if>
<xsl:if test="rest = 0 and type != 1">
ПОД ЗАКАЗ
</xsl:if>
</td>
<td>
<input type="text" value="1" id="count_{@id}" />
</td>
</tr>
</table>
<xsl:if test="type = 0 or (type = 1 and (digitals > 0 or digitals = -1))">
<a class="theaddtocartbutton" href="{/shop/url}cart/?add={@id}" onclick="return $.addIntoCart('{/shop/url}cart/', {@id}, document.getElementById('count_{@id}').value)">
Добавить в корзину
</a>
</xsl:if>
</form>
Что мне надо добавить?
Авторизация