/
item_list.coretag
33 lines (29 loc) · 1.2 KB
/
item_list.coretag
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Copyright 2002-2005 Interchange Development Group (http://www.icdevgroup.org/)
# Licensed under the GNU GPL v2. See file LICENSE for details.
# $Id: item_list.coretag,v 1.6 2005-11-08 18:14:36 jon Exp $
UserTag item-list Order name
UserTag item-list addAttr
UserTag item-list attrAlias cart name
UserTag item-list attrAlias space discount_space
UserTag item-list hasEndTag
UserTag item-list Version $Revision: 1.6 $
UserTag item-list Routine <<EOR
sub {
my($cart,$opt,$text) = @_;
return if ! $text;
my $items = $cart ? ($::Carts->{$cart} ||= []) : $Vend::Items;
my $oldspace;
$oldspace = Vend::Interpolate::switch_discount_space($opt->{discount_space})
if defined $opt->{discount_space};
$items = [ reverse @$items ] if $opt->{reverse};
my $obj = { mv_results => $items };
$opt->{prefix} = 'item' unless defined $opt->{prefix};
# LEGACY
list_compat($opt->{prefix}, \$text);
# END LEGACY
# store the output temporarily, as we need to switch back to the old discount space...
my $output = labeled_list($opt, $text, $obj);
Vend::Interpolate::switch_discount_space($oldspace) if defined $oldspace;
return $output;
}
EOR