Fix handling of extra_query_params in Business::OnlinePayment wrapper.
[interchange.git] / code / SystemTag / price.coretag
1 # Copyright 2002-2007 Interchange Development Group and others
2
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.
7
8 # $Id: price.coretag,v 1.10 2007-03-30 23:40:49 pajamian Exp $
9
10 UserTag price               Order        code
11 UserTag price               addAttr
12 UserTag price               attrAlias    base mv_ib
13 UserTag price               attrAlias    space discount_space
14 UserTag price               PosNumber    1
15 UserTag price               Version      $Revision: 1.10 $
16 UserTag price               Routine      <<EOR
17 sub {
18         my ($code, $ref) = @_;
19         $ref->{code} ||= $code;
20
21         my $oldspace;
22         $oldspace = Vend::Interpolate::switch_discount_space($ref->{discount_space})
23                 if defined $ref->{discount_space};
24
25         my $amount = Vend::Data::item_price($ref);
26         $amount = discount_price($code, $amount, $ref->{quantity})
27                         if $ref->{discount};
28         Vend::Interpolate::switch_discount_space($oldspace) if defined $oldspace;
29         return currency( $amount, $ref->{noformat}, undef, $ref );
30 }
31 EOR