From f04cf29300bca8d8c0a42d66a4b1f07dc88bdcdd Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Wed, 5 May 2010 18:29:03 -0700 Subject: [PATCH] Fix display of the shop credit deduction when there's a recurring item in the cart. Fixes bug #11557 --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Shop/Cart.pm | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 09becbfd4..33fbe504a 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,5 +1,6 @@ 7.9.5 - fixed #11556: New cart doesn't work with other forms on the same page + - fixed #11557: Shop credit deduction calculated incorrectly 7.9.4 - We're shipping underscore.js now for its suite of extremely handy utility diff --git a/lib/WebGUI/Shop/Cart.pm b/lib/WebGUI/Shop/Cart.pm index 668b68c81..ddfe644d9 100644 --- a/lib/WebGUI/Shop/Cart.pm +++ b/lib/WebGUI/Shop/Cart.pm @@ -1183,7 +1183,7 @@ sub www_view { $var{totalPrice} = $var{subtotalPrice} + $var{shippingPrice} + $var{tax}; my $credit = WebGUI::Shop::Credit->new($session, $posUser->userId); $var{ inShopCreditAvailable } = $credit->getSum; - $var{ inShopCreditDeduction } = $credit->calculateDeduction($var{totalPrice}); + $var{ inShopCreditDeduction } = $self->calculateShopCreditDeduction($var{totalPrice}); $var{ totalPrice } = $self->formatCurrency($var{totalPrice} + $var{inShopCreditDeduction}); foreach my $field (qw/subtotalPrice inShopCreditAvailable inShopCreditDeduction totalPrice shippingPrice tax/) { $var{$field} = sprintf q|%s|, $field, $var{$field};