[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: If I could bother you for onw more question...
- To: MiniVend Users List <minivend-users@minivend.com>
- Subject: Re: If I could bother you for onw more question...
- From: Larry Leszczynski <larryl@furph.com>
- Date: Wed, 4 Aug 1999 19:57:39 -0400 (EDT)
- cc: Trevor Sky Garside <trevor@actaeon.net>
- In-Reply-To: <Pine.LNX.3.96.990804162102.5200A-100000@xaioyou>
- Organization: furph Inc. - ChargeNow.com
- Reply-To: Larry Leszczynski <larryl@furph.com>
Hi Trevor -
> I got everything working great; thanks for the code.
Cool.
> One thing, though, I need to also retrieve the description and price in
> my perl snippet. I tried using simply
>
> $key = 'A' . $counter . '';
> $item_price_hash{$key} = ($item->{'price'});
> $key = 'A' . $counter . 'P';
> $item_description_hash{$key} = ($item->{'description'});
The entries in the cart only contain the item code, the quantity, the
product file they came from, and any attributes - basically just enough
info to display the basket page and do the checkout.
If you want additional info about an item, you need to grab it from the
database. Inside a perl tag, you can do something like:
[perl arg="carts"]
my $out = '';
foreach my $item ( @{$Safe{'carts'}->{'main'}} ) {
my $base = $item->{'mv_ib'};
my $code = $item->{'code'};
my $quan = $item->{'quantity'};
my $desc = tag_data( $base, 'description', $code );
my $noformat = 0;
my $price = tag_price( $code, $quan, $base, $noformat );
$out .= "$desc costs $price<br>";
}
$out;
[/perl]
Look in Interpolate.pm to see what arguments are needed for the tag_xxx()
routines.
Larry Leszczynski
larryl@furph.com
--
furph, Inc. WWW/Unix/Windows Solutions 734-513-7763 (voice)
info@furph.com http://www.furph.com 734-513-7759 (FAX)