I am using the [DocCart]ViewCart.xslt to display the items in my shopping cart. How can I update the cart when a user changes the quantity for a specific product? When I click the update button, the page only refreshes but the new quantity is not saved in the cart. Another thing: how can I update the quantity of the product in the cart, without the Update button? I would like to let it update my cart with an onChange event of my input field (quantity).
Update quantity problem
Hi,
I am using the [DocCart]ViewCart.xslt to display the items in my shopping cart. How can I update the cart when a user changes the quantity for a specific product? When I click the update button, the page only refreshes but the new quantity is not saved in the cart. Another thing: how can I update the quantity of the product in the cart, without the Update button? I would like to let it update my cart with an onChange event of my input field (quantity).
I use the following code:
<xsl:variable name="formAction" select="umbraco.library:NiceUrl($currentPage/@id)"/>
<xsl:variable name="items" select="DocCart:CartAsXml()/Items/Item"/>
<form action="{$formAction}" method="post">
<xsl:for-each select="$items">
...
<td class="gAantal">
<input id="num-pallets-input{position()}" class="num-pallets-input" type="number" name="Quantity">
<xsl:attribute name="value">
<xsl:value-of select="Quantity"/>
</xsl:attribute>
</input>
<label visible="false" for="num-pallets-input{position()}" class="errorcross" style="display: none;">
<img src="/images/unchecked.gif" alt="unchecked" /></label>
<input type="hidden" name="ItemId" value="{@NodeId}"/>
<input type="submit" name="submit" value="Update"/>
</td>
...
</xsl:for-each>
</form>
Thanks in advance.
grts,
Kim
is working on a reply...