[ic] Lock up with custom shipping UserTag

Mike Heins mikeh@minivend.com
Sun, 4 Mar 2001 10:45:00 -0500


Quoting Webmaster of Infothai (webmaster@infothai.com):
> Hello,
> 
> I'm running Interchange 4.6.3 on FreeBSD 4.2 with Perl 5.005_03. I've created 
> a UserTag as follows:
> 
> 	UserTag thship Order weight
> 	UserTag thship Routine <<EOR
> 	sub {
> 	 my ($weight) = @_;
> 	 my $cost=$weight * 4;
> 	 return $cost;
> 	}
> 	EOR
> 
> If I call this usertag from a page, it works as expected.
> 
> However, when I use this in shipping.asc:
> 
> 	test:	Test Custom
> 		criteria	weight
> 
> 		min	0
> 		max	0
> 		cost	e Nothing to ship!
> 
> 		min	0
> 		max	200
> 		cost	m [thship weight="2.3"]
> 
> 		min	200
> 		max	999999
> 		cost	e @@TOTAL@@ lbs too heavy for UPS
> 
> then Interchange will lock up forever. I see two Interchange 
> processes, and both must be manually killed (kill -3) to get 
> them to terminate. The above usage was suggested by Mike Heins 
> in a previous message to the list, but I must not be reading 
> it or doing it correctly.

Using "f" is correct for this.

m is a special mode which allows you to iterate over the shopping cart
and assign a shipping cost per item, and pass the results to chain_cost. I
don't see why it would loop endlessly here, but it is possible it could.

You should not have that problem with "f", and I can't see why you
would short of forgetting to reconfig the catalog after changing
from m.

-- 
Red Hat, Inc., 131 Willow Lane, Floor 2, Oxford, OH  45056
phone +1.513.523.7621 fax 7501 <mheins@redhat.com>

Research is what I'm doing when I don't know what I'm doing.
-- Wernher Von Braun