[interchange-cvs] interchange - jon modified lib/Vend/Ship.pm

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Tue Jan 25 12:47:45 EST 2005


User:      jon
Date:      2005-01-25 17:47:45 GMT
Modified:  lib/Vend Ship.pm
Log:
Make $Session->{ship_message} consistently have a ' ' separator between
messages added to it. (Most places already did this correctly.)

It seems it would be nicer to have an array of shipping messages, but
doing that now would introduce lots of compatibility problems.

Also don't check $Session->{shipping_error}, which seems to be a bug, as
that is never used elsewhere and doesn't make sense in this context.

Revision  Changes    Path
2.10      +6 -7      interchange/lib/Vend/Ship.pm


rev 2.10, prev_rev 2.9
Index: Ship.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Ship.pm,v
retrieving revision 2.9
retrieving revision 2.10
diff -u -u -r2.9 -r2.10
--- Ship.pm	2 Oct 2004 22:21:49 -0000	2.9
+++ Ship.pm	25 Jan 2005 17:47:45 -0000	2.10
@@ -1,8 +1,8 @@
 # Vend::Ship - Interchange shipping code
 # 
-# $Id: Ship.pm,v 2.9 2004/10/02 22:21:49 jon Exp $
+# $Id: Ship.pm,v 2.10 2005/01/25 17:47:45 jon Exp $
 #
-# Copyright (C) 2002-2004 Interchange Development Group
+# Copyright (C) 2002-2005 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
 #
 # This program was originally based on Vend 0.2 and 0.3
@@ -68,8 +68,7 @@
 	Vend::Tags->error({ name => 'shipping', set => $msg });
 	unless ($Vend::Cfg->{Limit}{no_ship_message}) {
 		$Vend::Session->{ship_message} ||= '';
-		$Vend::Session->{ship_message} .= ' ' if $Vend::Session->{shipping_error};
-		$Vend::Session->{ship_message} .= $msg;
+		$Vend::Session->{ship_message} .= $msg . ($msg =~ / $/ ? '' : ' ');
 	}
 	return undef;
 }
@@ -836,7 +835,7 @@
 
 
 	SHIPFORMAT: {
-		$Vend::Session->{ship_message} .= $error_message
+		$Vend::Session->{ship_message} .= $error_message . ($error_message =~ / $/ ? '' : ' ')
 			if defined $error_message;
 		undef $::Carts->{mv_shipping};
 		$Vend::Items = $save;
@@ -1148,7 +1147,7 @@
 	}
 	elsif (!$zone or $zone eq '-') {
 		$Vend::Session->{ship_message} .=
-			"No $type shipping allowed for geo code $zip.";
+			"No $type shipping allowed for geo code $zip. ";
 #::logDebug("tag_ups empty zone $zone.");
 		return undef;
 	}
@@ -1158,7 +1157,7 @@
 	$cost += tag_data($type,$zone,$eas_zone)  if defined $eas_point;
 	$Vend::Session->{ship_message} .=
 								errmsg(
-									"Zero cost returned for mode %s, geo code %s.",
+									"Zero cost returned for mode %s, geo code %s. ",
 									$type,
 									$zip,
 								)








More information about the interchange-cvs mailing list