[ic] nd Post - pls help -> Delete button for items close
to possible solution
Joachim Leidinger
joachim at Leidinger.net
Sun Oct 26 21:58:04 EST 2003
videotaxi.nuernberg wrote:
> Hi list,
>
> after digging further in the maillists and faqs i found the button usertag
> and the following info
>
> [button text="Delete item" confirm="Are you sure?" src="delete.gif"]
> [comment]
> This is the action, same as [set Delete item] action [/set]
> [/comment]
> [mvtag] Use any Interchange tag here, i.e. ....[/mvtag]
> [perl] # code to delete item [/perl]
> [/button]
>
> I also found
>
> http://www.icdevgroup.org/i/doc/wiki/FaqHowDoIDeleteAnItemFromTheCart.html
>
> where Racke gives the perl code to delete an item in the cart :
>
> [calc] @$Items = grep {$_->{code} ne '123.456.789'} @$Items [/calc]
>
> 123.456.789 being the item-sku (i guess)
>
> after trying for several hours, with the button tag and the perl code I
> still cant get the button to work,
> it looks like this
>
> [button text="Delete item" src="/images/mainpics/delete.gif" getsize=1
> hidetext=1]
> [calc] @$Items = grep {$_->{code} ne '[item-sku]'} @$Items [/calc]
> [bounce page=[area ord/basket]]
> [/button]
Because, the [item-sku] is not parsed in your case or or not in the same
"line" of your item or it is outside of [item-list]...[/item-list] or
whatelse. Hmm...try
[seti delitem][item-sku][/seti]
(or [seti delitem][item-code][/seti])
[button text="Delete item" src="/images/mainpics/delete.gif" getsize=1
hidetext=1]
[calc] @$Items = grep {$_->{code} ne $Scratch->{'delitem'}} @$Items [/calc]
[bounce page=[area ord/basket]]
[/button]
> well, it does not delete any items and somehow, it doesn't refresh the page
> but jumps to the results page ???
>
> any hints, pls
How about
<INPUT TYPE=checkbox NAME="[quantity-name]"
onClick="this.form.action='[process-target]', this.form.submit()" VALUE=0>
in the same line of the item in your cart?
Joachim
--
Hans-Joachim Leidinger | Dipl.-Phys.Ing.
[joachim at leidinger.net]
http://www.leidinger.net
More information about the interchange-users
mailing list