[ic] Clear shopping cart?

Ron Phipps rphipps@reliant-solutions.com
Wed, 31 Jan 2001 22:26:36 -0800


Here's the code I use to clear the cart, I have this on my basket page.

[button
       text="Clear Basket"
            src="other/clear_basket.gif"
       hidetext=1
       form=basket
      ]
      mv_todo=cancel
      mv_nextpage=index
[/button]

This should work for you.  The mv_todo=cancel should clear the cart and the
mv_nextpage=index will bounce you to index.html.  Take it easy!

-Ron

----- Original Message -----
From: "Robert Smith" <rsmith@crepsunited.com>
To: <interchange-users@lists.akopia.com>
Sent: Wednesday, January 31, 2001 2:20 PM
Subject: [ic] Clear shopping cart?


> Hey everybody...2 little questions:
>
> 1) Anybody have any code for clearing the shopping cart via a button or
> similar? How would I go about that?
>
> 2) I was trying to write a Usertag to do #1, but I keep getting an error:
>
> UserTag 'clear_cart' code is not a subroutine reference
> In line 332 of the configuration file 'catalog.cfg':
> UserTag clear_cart Routine <<EOR
>
> Yet here is how it is in catalog.cfg:
>
> UserTag clear_cart Order cart
> UserTag clear_cart Routine <<EOR
> sub {
>  my ($cart) = @_;
>
>  $cart = 'main' unless $cart;
>  my $counter = 0;
>
>  do {
>   splice @{$Carts->{$cart}}, $counter--, 1;
>   ++$counter;
>  } until $counter > $#{$Carts->{$cart}};
>
>  return '';
> }
>
> Any help would be much appreciated!
>
> Robert Smith
>
>
> _______________________________________________
> Interchange-users mailing list
> Interchange-users@lists.akopia.com
> http://lists.akopia.com/mailman/listinfo/interchange-users