Merge commit '4635b91554' into WebGUI8. Syntax clean up to 7.10.2
This commit is contained in:
commit
87326192a3
46 changed files with 956 additions and 969 deletions
|
|
@ -53,7 +53,8 @@ around BUILDARGS => sub {
|
|||
|
||||
=head2 adjust ( amount, [ comment ] )
|
||||
|
||||
Adjusts the amount of credit this user has by a specified amount.
|
||||
Adjusts the amount of credit this user has by a specified amount. Returns 0 if the current user is Visitor.
|
||||
Otherwise, returns the amount set.
|
||||
|
||||
=head3 amount
|
||||
|
||||
|
|
@ -157,6 +158,20 @@ A unique id for a user that you want to adjust the credit of. Defaults to the cu
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 purge ( )
|
||||
|
||||
Removes all shop credit for the current user.
|
||||
|
||||
=cut
|
||||
|
||||
sub purge {
|
||||
my ($self) = @_;
|
||||
$self->session->db->write("delete from shopCredit where userId = ?",[$self->userId]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 session ()
|
||||
|
||||
Returns a reference to the current session.
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ sub appendCartVariables {
|
|||
my $session = $self->session;
|
||||
my $credit = WebGUI::Shop::Credit->new($session, $cart->getPosUser->userId);
|
||||
$var->{inShopCreditAvailable} = $credit->getSum;
|
||||
$var->{inShopCreditDeduction} = $credit->calculateDeduction($var->{totalPrice});
|
||||
$var->{inShopCreditDeduction} = $credit->calculateDeduction($totalPrice);
|
||||
$var->{totalPrice } = $cart->formatCurrency($totalPrice + $var->{inShopCreditDeduction});
|
||||
return $self;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue