[ic] Adding list of items to cart in perl code.

Tim Nelson interchange-users@interchange.redhat.com
Mon Apr 22 15:06:01 2002


----- Original Message -----
From: "Tim Nelson" <nelsonx@earthlink.net>
To: <interchange-users@interchange.redhat.com>
Sent: Monday, April 22, 2002 2:39 PM
Subject: Re: [ic] Adding list of items to cart in perl code.


> ----- Original Message -----
> From: "Kevin Walsh" <kevin@cursor.biz>
> To: <interchange-users@interchange.redhat.com>
> Sent: Monday, April 22, 2002 12:18 PM
> Subject: RE: [ic] Adding list of items to cart in perl code.
>
>
> > >
> > > I've checked through the list to find a simple example
> > > of adding a list of items into the cart using perl...to no avail.
> > >
> > > Basically, I have a hash of item and qty that I want
> > > dump into the cart and then show the basket.
> > >
> > > Any help would be appreciated.
> > >
> > How about something like this?
> >
> >     push @{$Carts->{main}},{
> >         code => '00-0010',
> >         quantity => 100,
> >     };
> >
> > Or this:
> >
> >     my %myhash =(
> >         code => '00-0010',
> >         quantity => 100,
> >     );
> >     push @{$Carts->{main}},\%myhash;
> >
> > Of course, both of those will ignore whatever "SeparateItems"
> > configuration you have specified.
> >
> > --
> >    _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
> >   _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
> >  _/ _/    _/          _/ _/     _/    _/  _/_/    kevin@cursor.biz
> > _/   _/  _/_/_/_/      _/    _/_/_/  _/    _/
> >
> > _______________________________________________
> > interchange-users mailing list
> > interchange-users@interchange.redhat.com
> > http://interchange.redhat.com/mailman/listinfo/interchange-users
>
> Cool .... Kevin,
> The only problem I see is that the AutoModifiers are not getting picked up
> and put into the cart.  Is there a
> way to pick them up and toss them into the hash/cart
> also?
> Thanks.
>
>
> _______________________________________________
> interchange-users mailing list
> interchange-users@interchange.redhat.com
> http://interchange.redhat.com/mailman/listinfo/interchange-users

Actually, I think I found an easier way....
   &Vend::Order::add_items("sku","quantity");
does the trick.
Can anyone verify I am not doing something
dumb here.