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

Kevin Walsh interchange-users@interchange.redhat.com
Mon Apr 22 12:18:00 2002


> 
> 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
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/