[ic] [delete-checked] and 5.2

Ed LaFrance (New Media E.M.S.) ic_users at newmediaems.com
Thu Oct 7 17:04:46 EDT 2004


At 01:26 PM 10/7/2004, you wrote:

> > >I'm using the delete-checked usertag, but it doesn't seem to work well
> > >when deleting more than one line-item from the cart at a time.  It
> > >only ends up deleting one and it leaves a strange blank-titled and
> > >$0.00-priced item in the cart.  The tag was originally written for 4.6
> > >but it says it should work in all future versions.
> > >
> > >The tag is very short, does anyone see any reason it might have
> > >problems like this in 5.2:
> > >
> > >-----
> > >UserTag delete-checked Order cart
> > >UserTag delete-checked PosNumber 1
> > >UserTag delete-checked addAttr
> > >UserTag delete-checked Routine <<EOF
> > >sub {
> > >     my $cart = shift || 'main';
> > >     my $opt = shift;
> > >     my $key;
> > >     my $counter = 0;
> > >     my $removed = 0;
> > >     foreach $key (keys %{ $CGI }) {
> > >         next unless $key =~ s/^\^\^DELETE_//;
> > >         do {
> > >             if ($Carts->{$cart}[$counter]{code} eq $key) {
> > >                 $removed++;
> > >                 splice @{$Carts->{$cart}}, $counter--, 1;
> > >             }
> > >             ++$counter;
> > >         } until $counter > $#{$Carts->{$cart}};
> > >     }
> > >}
> > >EOF
> > >-----
> > >
> > >Here's the original link to the tag:
> > >
> > >http://www.icdevgroup.org/pipermail/interchange-users/2001-April/007099 
> .html
> > >
> >
> > Did you set your basket code up according to the original post?
> >
> > - Ed
>
>I've got it set just right, but it won't work when trying to delete
>more than one item at a time.  Here's what I have:
>
>-----
>[item-list]
>    <tr>
>       <td>[item-field title]</td>
>       <td>[item-price]</td>
>       <td><input class="small_padding" type="text"
>name="[quantity-name]" value="[item-quantity]" size="3" maxlength="2"
>/></td>
>       <td class="padding">[item-subtotal]</td>
>       <td class="padding"><input type="checkbox"
>name="^^DELETE_[item-code]" value="1" /></td>
>    </tr>
>[/item-list]
>-----
>
>[delete-checked] is at the top of the page.
>
>- Grant

It may be irrelevant, but should not your input tags end with > instead of />?

- Ed


===============================================================
New Media E.M.S.              Technology Solutions for Business
11630 Fair Oaks Blvd., #250   eCommerce | Consulting | Hosting
Fair Oaks, CA  95628          Ed.LaFrance at newmediaems.com
(916) 961-0446                http://www.newmediaems.com
(866) 519-4680 Toll-Free      (916) 961-0447 Fax
=============================================================== 



More information about the interchange-users mailing list