1 # Copyright 2002-2007 Interchange Development Group and others
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version. See the LICENSE file for details.
8 # $Id: item_list.coretag,v 1.7 2007-03-30 23:40:49 pajamian Exp $
10 UserTag item-list Order name
11 UserTag item-list addAttr
12 UserTag item-list attrAlias cart name
13 UserTag item-list attrAlias space discount_space
14 UserTag item-list hasEndTag
15 UserTag item-list Version $Revision: 1.7 $
16 UserTag item-list Routine <<EOR
18 my($cart,$opt,$text) = @_;
20 my $items = $cart ? ($::Carts->{$cart} ||= []) : $Vend::Items;
23 $oldspace = Vend::Interpolate::switch_discount_space($opt->{discount_space})
24 if defined $opt->{discount_space};
26 $items = [ reverse @$items ] if $opt->{reverse};
27 my $obj = { mv_results => $items };
28 $opt->{prefix} = 'item' unless defined $opt->{prefix};
30 list_compat($opt->{prefix}, \$text);
33 # store the output temporarily, as we need to switch back to the old discount space...
34 my $output = labeled_list($opt, $text, $obj);
35 Vend::Interpolate::switch_discount_space($oldspace) if defined $oldspace;