[ic] Clear shopping cart?

Robert Smith rsmith@crepsunited.com
Wed, 31 Jan 2001 17:20:42 -0500

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;
 } until $counter > $#{$Carts->{$cart}};

 return '';

Any help would be much appreciated!

Robert Smith