Copied to clipboard

Flag this post as spam?

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


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Chris Knowles 141 posts 222 karma points
    Jul 25, 2011 @ 11:41
    Chris Knowles
    0

    Empty Shopping Cart

    Hi,

    Is there a way a i can put a link on the page to allow people to empty their cart?

    Thanks

    Chris

  • Christian Wendler 46 posts 155 karma points
    Jul 25, 2011 @ 12:28
    Christian Wendler
    0

    Sure, this is possible.

    You have to insert a link or a submit button, that calls your cart with a parameter, e.g. emptycart=1. Now you could extend UpdateCart.xslt (or whatever you have to process changes to your cart):

    - Check for emptycart parameter.

    - If it exists, call CommerceLibrary:ClearBasket()

    If you want to allow removing of single cart items, you have to place a check box for every single item and add the index of the item to its name. When user hits your update/refresh button, do the following:

    - Loop through all items in cart and call CommerceLibrary:DeleteLineItem, when check box with the given index is set.

    - I recommend to loop backwards, to prevent problems with index numbers (when removing an item, uCommerce reindexes immediately while your XSLT still uses the original item list).

    Hope this helps.

    Bye

    Christian

  • Chris Knowles 141 posts 222 karma points
    Jul 25, 2011 @ 14:19
    Chris Knowles
    0

    Thanks for the suggestion.

    Chris

  • Søren Spelling Lund 1797 posts 2786 karma points
    Jul 28, 2011 @ 17:08
    Søren Spelling Lund
    0

    Thanks for helping out, Christian. Always appreciated! :)

Please Sign in or register to post replies

Write your reply to:

Draft