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

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Sat Oct 2 18:21:49 EDT 2004


User:      jon
Date:      2004-10-02 22:21:49 GMT
Modified:  lib/Vend Ship.pm
Log:
Allow variable and ITL interpolation in the "free" shipping argument.

Since existing installations will have been using either undef/'' or '1',
this won't slow them down, but it does allow more advanced free shipping
logic, such as (in multi-line shipping.asc notation):

free [if session something]1[/if]

Or in older single-line notation:

{ free => '[if session something]1[/if]' }

Revision  Changes    Path
2.9       +3 -2      interchange/lib/Vend/Ship.pm


rev 2.9, prev_rev 2.8
Index: Ship.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Ship.pm,v
retrieving revision 2.8
retrieving revision 2.9
diff -u -u -r2.8 -r2.9
--- Ship.pm	5 Jul 2004 21:59:56 -0000	2.8
+++ Ship.pm	2 Oct 2004 22:21:49 -0000	2.9
@@ -1,8 +1,8 @@
 # Vend::Ship - Interchange shipping code
 # 
-# $Id: Ship.pm,v 2.8 2004/07/05 21:59:56 mheins Exp $
+# $Id: Ship.pm,v 2.9 2004/10/02 22:21:49 jon Exp $
 #
-# Copyright (C) 2002-2003 Interchange Development Group
+# Copyright (C) 2002-2004 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
 #
 # This program was originally based on Vend 0.2 and 0.3
@@ -845,6 +845,7 @@
 #::logDebug("ship options: " . uneval($o) );
 		$final /= $Vend::Cfg->{PriceDivide}
 			if $o->{PriceDivide} and $Vend::Cfg->{PriceDivide} != 0;
+		$o->{free} = interpolate_html($o->{free}) if $o->{free} =~ /[_@[]/;
 		unless ($o->{free}) {
 			return '' if $final == 0;
 			$o->{adder} =~ s/\bx\b/$final/g;








More information about the interchange-cvs mailing list