MiniVend Akopia Services

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

Re: Problems Running Embedded Perl Code




> Thanks to your help last weekend, we have solved our CGIWrap problem and we have MiniVend up and running. However, we have a special need to run a perl script on the checkout and receipt pages. I'll give you a little information on what this script does:
> 
> When a visitor comes to our site, he is linked to us from someone else. This other person embeds a unique Eid number in the referring url. When the visitor comes to our page he is actually running a script that grabs this Eid and sets a cookie containing the number on his machine. We need to add a script to the checkout page as well as the receipt page that will read this cookie from the visitor and embed the Eid number into the page. So when the visitor prints the receipt, it has this number. When the invoice is mailed to us, it has the number.
> 
> We have added what we believe to be the proper code to do this, but MiniVend is not executing it properly. Are there any limitations to doing this and are there any work-arounds that you know of?

   If you are running this in the [perl] tags you may be running into safe
issues. But those would show up in your error.log
 
   If you are trying to set a cookie you have to use 
[tag op=header]
Content-Type: text/html
Set-Cookie: foo
[/tag]

I wrote a global tag for storing a referer in the session hash, it'd 
probably work with some adjustment in your case.

Something like the following should work in your
minivend.cfg

UserTag store_eid   Routine <<EOF
sub {
	my ($query_string);
	$query_string = $CGI::query_string;
	... split out your number here ...
        $Vend::Session->{values}{Eid} = $fixed_query_string 
            unless $Vend::Session->{values}{Eid};
	$Vend::Session::put_session();
        '';
}

-- 

Anthony Ball                                                ant@maine.com
MaineStreet Communications, Inc        208 Portland Road, Gray, ME  04039
tel:1.207.657.5078         fax:1.207.657.5048       http://www.maine.com/


Search for: Match: Format: Sort by: