Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Kim Grandgagnage 63 posts 87 karma points
    Jan 04, 2012 @ 12:50
    Kim Grandgagnage
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft