/
price.coretag
29 lines (26 loc) · 1.11 KB
/
price.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
# Copyright 2002-2007 Interchange Development Group and others
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version. See the LICENSE file for details.
UserTag price Order code
UserTag price addAttr
UserTag price attrAlias base mv_ib
UserTag price attrAlias space discount_space
UserTag price PosNumber 1
UserTag price Version 1.10
UserTag price Routine <<EOR
sub {
my ($code, $ref) = @_;
$ref->{code} ||= $code;
my $oldspace;
$oldspace = Vend::Interpolate::switch_discount_space($ref->{discount_space})
if defined $ref->{discount_space};
my $amount = Vend::Data::item_price($ref);
$amount = discount_price($code, $amount, $ref->{quantity})
if $ref->{discount};
Vend::Interpolate::switch_discount_space($oldspace) if defined $oldspace;
return currency( $amount, $ref->{noformat}, undef, $ref );
}
EOR