[ic] many warehouses shipping

Rick Eicher II interchange-users@interchange.redhat.com
Tue Apr 16 08:54:02 2002


> -----Original Message-----
> From: interchange-users-admin@interchange.redhat.com
> [mailto:interchange-users-admin@interchange.redhat.com]On Behalf Of Bill
> Carr
> Sent: Tuesday, April 16, 2002 5:55 AM
> To: interchange-users@interchange.redhat.com
> Subject: RE: [ic] many warehouses shipping
>
>
> On Mon, 2002-04-15 at 09:52, Rick Eicher II wrote:
> > > -----Original Message-----
> > > From: interchange-users-admin@interchange.redhat.com
> > > [mailto:interchange-users-admin@interchange.redhat.com]On
> Behalf Of Rick
> > > Eicher II
> > > Sent: Friday, April 12, 2002 1:29 PM
> > > To: interchange-users@interchange.redhat.com
> > > Subject: RE: [ic] many warehouses shipping
> > >
> > >
> > > > I have a customer that will be selling items from many companies.
> > > > So I need
> > > > to calculate the shipping based on the location of the
> item, which is
> > > > different for each item. This is simmular to a company that has many
> > > > warehouses to ship from.
> > > >
> > > > Has any one done this before or know how would be the best way
> > > to go about
> > > > doing it?
> > > >
> > > > I was think about adding a column to the products table to hould
> > > > the zip of
> > > > the items location. Then have shipping pull this information to
> > > calculate
> > > > shipping. I am currently useing the ups-query tag to
> calculate shipping.
> > > > Maybe way off on this. :/
> > > >
> > > > Thank you for your time,
> > > > Rick Eicher II
> > > > www.pbol.net
> > > >
> > > >
> > >
> > > My shipping.asc file now makes use of the ups_query tag.
> > > [ups-query zip="[either][value zip][or][var
> SHIP_DEFAULT_ZIP][/either]"
> > > mode="GNDRES" weight="@@TOTAL@@"]
> > >
> > > I would like to add a column to the products table then read
> it in as the
> > > origin of this tag.
> > > [ups-query zip="[either][value zip][or][var SHIP_DEFA
> > > ULT_ZIP][/either]" mode="GNDRES" weight="@@TOTAL@@"
> origin="origin column
> > > data"]
> > >
> > > Can add column just not sure what would be the best way to
> get it into the
> > > tag.
> > >
> > > Rick
> > >
> >
> > Ok I added the column to the products table called origin. I have filled
> > this column with the origin zip that the product will be shipped from. I
> > have the ups-query tag set up like this.
> >
> > [ups-query mode=1DA weight="@@TOTAL@@" origin="[item-field origin]"]
> >
> > After a quick restart the 1DA shipping mode no longer appears
> in the drop
> > down menu of the check out page.
> >
> > Any one have an idea of how to read the zip out of the products
> table and
> > pass it to the ups-query tag? Or how to read any data into any tag?
> Here is one way that might work (untried, untested):
> catalog.cfg:
> AutoModifer origin weight
>
> UserTag ship_cost Order mode zip
> UserTag ship_cost Routine <<EOR
> sub {
>         my($mode,$zip) = @_;
> 	my $total = 0;
> 	my %origins;
> 	for (@$Items) { # Combine origins to minimize ups-queries
> 		$origins{$_->{origin}} += $_->{weight};
> 	}
> 	for (keys %origins) {
>              $total += $Tag->ups_query( {
> 					mode => $mode,
> 					zip => $zip,
> 					weight => $origins{$origin},
> 					origin => $_
>                                       } );
> 	}
> 	return $total;
> }
>
> Then instead of ups-query as you have above do: [ship_cost mode=1DA]
>
>
> >
> > redhat 7.2, interchange 4.8.3, perl 5.6.1, postgresql-7.1.3-2
> >
> > Rick
> >

Thanks for the reply. I have a user tag created for this, so we are on the
same lines here. But I was told that the user tag would need to be global or
it would run in safe mode. If it runs in safe mode you would not be able to
call the ups-query tag.

I will let you know how well this worked.

Thanks for your time,
Rick