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

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Fri Dec 24 13:00:35 EST 2004


User:      jon
Date:      2004-12-24 18:00:34 GMT
Modified:  lib/Vend Data.pm
Log:
Optimization to item_price routine:

Don't worry about the database the item comes from unless using PriceField,
since it doesn't matter otherwise.

This allows pricing to work when a product isn't in ProductFiles as long as
the CommonAdjust can return a valid price.

Revision  Changes    Path
2.45      +11 -10    interchange/lib/Vend/Data.pm


rev 2.45, prev_rev 2.44
Index: Data.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Data.pm,v
retrieving revision 2.44
retrieving revision 2.45
diff -u -u -r2.44 -r2.45
--- Data.pm	7 Oct 2004 00:10:01 -0000	2.44
+++ Data.pm	24 Dec 2004 18:00:34 -0000	2.45
@@ -1,6 +1,6 @@
 # Vend::Data - Interchange databases
 #
-# $Id: Data.pm,v 2.44 2004/10/07 00:10:01 jon Exp $
+# $Id: Data.pm,v 2.45 2004/12/24 18:00:34 jon Exp $
 # 
 # Copyright (C) 2002-2004 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -1730,16 +1730,17 @@
 
 	my $final = 0;
 	do {
-		my $base;
-		if(not $base = $item->{mv_ib}) {
-			$base = product_code_exists_tag($item->{code})
-				or ($Vend::Cfg->{OnFly} && 'mv_fly')
-				or return undef;
-		}
-
 		my $price;
-		$price = database_field($base, $item->{code}, $Vend::Cfg->{PriceField})
-			if $Vend::Cfg->{PriceField};
+
+		if ($Vend::Cfg->{PriceField}) {
+			my $base;
+			if (not $base = $item->{mv_ib}) {
+				$base = product_code_exists_tag($item->{code})
+					or ($Vend::Cfg->{OnFly} && 'mv_fly')
+					or return undef;
+			}
+			$price = database_field($base, $item->{code}, $Vend::Cfg->{PriceField})
+		}
 
 #::logDebug("price for item before chain $item->{code}=$price PriceField=$Vend::Cfg->{PriceField}");
 		$price = chain_cost($item,$price || $Vend::Cfg->{CommonAdjust});








More information about the interchange-cvs mailing list