[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: HELP: perl variable in a minivend tag
Hi Ezra -
> [perl interpolate=1]
> $code = [item-code];
> $GRS = [data products GRS $code];
> [/perl]
> The above doesn't work.
You're telling MiniVend to interpolate the MiniVend tags first, so it will
interpolate "[item-code]" and "[data products GRS $code]" before any perl
code is executed. So "$code" is not determined yet at that point.
You could try something like:
[perl interpolate=1]
$code = [item-code];
$GRS = tag_data("products","GRS",$code);
[/perl]
> UserTag price-mod Routine <<EOR
> sub {
> my $item = $Vend::Interpolate::item;
> my $code=$item->{code};
> my $GRS=[data products GRS $code];
> return $GRS;
> }
This might work for you:
UserTag price-mod Routine <<EOR
sub {
my $item = $Vend::Interpolate::item;
my $code = $item->{code};
my $GRS = Vend::Interpolate::tag_data("products","GRS",$code);
return $GRS;
}
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)