[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] many warehouses shipping
> -----Original Message-----
> From: interchange-users-admin@interchange.redhat.com
> [mailto:interchange-users-admin@interchange.redhat.com]On Behalf Of
> Kevin Walsh
> Sent: Tuesday, April 16, 2002 11:52 AM
> To: interchange-users@interchange.redhat.com
> Subject: RE: [ic] many warehouses shipping
>
>
> >
> > I have a usertag that is global:
> >
> > ########################################################
> > UserTag ups-query Order mode origin zip weight country
> > UserTag ship Routine <<EOR
> > sub {
> > my( $mode, $zip, $weight, $country) = @_;
> > $country =
> $::Values->{$::Variable->{UPS_COUNTRY_FIELD}} if
> > ! $country;
> > $zip =
> $::Values->{$::Variable->{UPS_POSTCODE_FIELD}} if
> > ! $zip;
> > $country = uc $country;
> >
> > my $shipping = 0;
> > my %origins;
> > $origins{$_->{origin}} = $_->{weight} for (@{$Carts->{main}});
> >
> > foreach (keys %origins){
> > $shipping += $Tag->ups_query({
> > mode => $_,
> > origin => $origin,
> > zip => $zip,
> > country => $country,
> > weight => $origins{$_},
> > });
> > }
> >
> > return $shipping;
> > }
> > EOR
> > #############################
> >
> > I have origin as a hiden field in the buy now forms. I pull
> this data from
> > an added column of the products table.
> >
> >
> > I call the user tag from my shipping.asc file.
> >
> > ...
> > 1DA UPS Next Day Air weight 0 150 f [ship
> zip="[value
> > zip]" mode="1DA" weight="@@TOTAL@@"]
> > ...
> >
> >
> > But when I check out I get:
> >
> > Shipping mode '1DA': bad formula. Returning 0.No match found for mode
> > '1DA', quantity '1',
> > returning 0.
> >
> > If I change the formula to a ups-query tag it works fine, so I
> believe the
> > problem is with my tag of with the way I call it.
> >
> The problem is clearly with the usertag.
>
> You are doing this:
>
> UserTag ups-query Order mode origin zip weight country
> UserTag ship Routine <<EOR
>
> Have you tried using the same tag name on both of those lines?
>
> Also, since your tag is designed to work out the weights for itself,
> why is it necessary for you to pass in a 'weight' parameter?
> If you set the UPS_POSTCODE_FIELD variable, you can avoid having to
> pass the zip parameter as well.
>
Ok have fixed the top two lines of the user tag, so they now match. And I
am no longer passing the weight to the user tag.
:( But I get the same results.
Rick