[wellwell-devel] [wellwell] Use only existing decimals for discount percentage.

Stefan Hornburg wellwell-devel at rt.icdevgroup.org
Wed Jul 21 10:52:20 UTC 2010


commit c798371708f596d6d005c3200e73ec446789f41d
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date:   Wed Jul 21 12:51:31 2010 +0200

    Use only existing decimals for discount percentage.

 lib/WellWell/Coupon.pm |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/lib/WellWell/Coupon.pm b/lib/WellWell/Coupon.pm
index 30a19ac..e87f4a3 100644
--- a/lib/WellWell/Coupon.pm
+++ b/lib/WellWell/Coupon.pm
@@ -154,6 +154,9 @@ sub apply_discounts {
 
 			Vend::Tags->discount({code => 'ENTIRE_ORDER', body => '$s * ' . $factor});
 
+			# use only existing decimals
+			$value =~ s/\.0+$//;
+				
 			$self->{discount} = $value;
 			$Vend::Session->{coupons}->[1]->{$self->{coupon_number}}->{discount} = $value;
 		}



More information about the wellwell-devel mailing list