[ic] shipping charges and weights...

Mark Weaver mark at americanmicroinc.com
Thu May 20 08:02:46 EDT 2004


Steve wrote:
>>Unless I'm missing something important this user tag isn't working out
>>for me. the error I'm getting upon restart is this:
>>
>>.UserTag 'ship_cost_i' subroutine failed safe check: syntax error at
>>(eval 202) line 22, near "}
>>EOR
>>
>># Allow customers to have their passwords emailed to them.
>>ActionMap  "
>>
>>In line 287 of the configuration file 'catalog.cfg':
>>
>>
>>Here is what I placed in the catalog.cfg file:
> 
> 
> 
> 
> Here is the copy from my catalog.cfg
> We are Using IC 4.8.x so there may have been some changes - you might need
> to ask one of the guru's.
> 
> 
> The ship_cost does an on-line lookup
> ship_cost_i does the internal lookup
> 
> 
> Code follows:
> -----------------------------
> 
> #
> # break large weight into smaller units and calculate new freight amounts#
> # search ic by Shipping Questions - Multiple Boxes per Item - How to?
> #
> 
> UserTag ship_cost Order weight mode zip
> UserTag ship_cost Routine <<EOR
> sub {
> 	my($weight,$mode,$zip) = @_;
> 	return unless $weight;
> 	$mode = $Variable->{SHIP_DEFAULT_MODE} unless $mode;
> 	$zip = $Variable->{SHIP_DEFAULT_ZIP} unless $zip;
> 	my $total = 0;
>         if ($weight < 1)
>            { $weight = 1 }
> 	$total = int($weight/145) * $Tag->ups_query( {
> 						      mode => $mode,
> 						      zip => $zip,
> 						      weight => 145
> 						    } );
> 	$total += $Tag->ups_query( {
> 				    mode => $mode,
> 				    zip => $zip,
> 				    weight => $weight % 145
> 				   } );
> 	return $total;
> }
> EOR
> 
> #==========================================================================#
> #
> # break large weight into smaller units and calculate new freight amounts#
> # used for internal ups lookup
> #
> 
> 
> UserTag ship_cost_i Order weight mode zip upsmode
> UserTag ship_cost_i Routine <<EOR
> sub {
> 	my($weight,$mode,$zip,$upsmode) = @_;
> 	return unless $weight;
> 	$mode = $Variable->{SHIP_DEFAULT_MODE} unless $mode;
> 	$zip = $Variable->{SHIP_DEFAULT_ZIP} unless $zip;
>         my $zone = '760';
> 	my $total = 0;
>         my $w_weight = $weight;
>         if ($weight < 1)
>            { $weight = 1 }
> 	$total = int($weight/145) * Vend::Interpolate::tag_ups($mode, $zip,
> 145,$zone);
> 	$total += Vend::Interpolate::tag_ups($mode, $zip, $weight % 145,$zone);
> 	if ($total < 1)
>           {$total = $Tag->ship_cost($w_weight, $upsmode, $zip)}
> 
>         return $total;
> }
> EOR
> 
> 
> ==================
> end of code
> 
> -Steve
> 

Hi Steve,

Again, thank you for all your help with this. It is greatly appreciated. 
I guess I should let you know that our test server is running 5.0.1. I 
suppose it would be a good idea to get the test server running the same 
thing the production server is running to make sure everything with work 
there as well.  I'm noticing that the learning curve for Interchange is 
quite steep!

What is the value in SHIP_DEFAULT_MODE to specify the method GNDCOMI as 
the default shipping method, or shouldn't I even be concerned about this 
and just use uspg as the default? I'm a lilttle unclear how this is 
supposed to work. Does IC default to GNDCOMI when GNDCOM ( UPS Ground 
Commercial ) is unable to deal with doing the shipping?

-- 
Mark Weaver
American Micro - Webmaster
1-800-558-2058




More information about the interchange-users mailing list