MiniVend Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: Using @@global@@ variable in usertag



Quoting Ezra Gilbert (egilbert@CYBERNEX.NET):
> 
> Well, guess the topic says it all -
> Im writing a usertag in catalog.cfg and would like to access a global variable like this:
> 
> UserTag price-mod Routine <<EOR
> ## this code has rips from CFM and Mike :) thx guys
> sub {
>      my $s = $Vend::Interpolate::s;
>      my $item = $Vend::Interpolate::item;
>      my $adj=0;
>      # Do whatever you want to price here
> 
>      if ( $item->{code} eq "01-001" ) {
>          return @@GVALUE@@; ## this doesn't work
>      }
>      return $adj;
> }
> EOR
> 

Variables are not parsed in minivend.cfg, which is where you may be
having trouble. If this is in the minivend.cfg file, then you can use

	$Global::Variable->{GVALUE}

If this is in catalog.cfg -- which would work in this case I think, as
references to Vend::Interpolate and Vend::Session are allowed -- then
you can probably set 'ParseVariables Yes' somewhere above and have it
work.

-- 
Mike Heins                          http://www.minivend.com/  ___ 
                                    Internet Robotics        |_ _|____
                                    131 Willow Lane, Floor 2  | ||  _ \
It's a little-known fact            Oxford, OH  45056         | || |_) |
that the Y1K problem caused         <mikeh@minivend.com>     |___|  _ <
the Dark Ages. -- unknown           513.523.7621 FAX 7501        |_| \_\


Search for: Match: Format: Sort by: