MiniVend Akopia Services

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

Re: A few questions...



On Wed, Aug 04, 1999 at 11:39:52AM -0700, Trevor Sky Garside wrote:
> ******    message to minivend-users from Trevor Sky Garside <trevor@actaeon.net>     ******
> 
> I have my first shopping cart ALMOST finished...
> 
> The final task is to write the bit of code that will send the user off to a credit card VT on 
> another server (client's preference).
> 
> The VT is hosted on Total Merchant Services, and I need to get all of the items from my shopping 
> cart into oddly named form variables.
> 
> I came up with a neat method to do this, which involved code similar to this snippet:
> 
> [perl interpolate="1"]
> 
> [item-list]
> *a bit of code which set some variables I could reference outside the item-list construct*
> [/item-list]
> 
> *more various code*
> 
> [/perl]
> 
> When I tried to run this inside the last checkout page (one I wrote myself called wizard3.html), I 
> got an error from Safe in my home/mvend/error.log file.
> 
> Looking over the code snippet it provided in the error.log, I noticed that the [item-list] tag had 
> not been fleshed out.
> 

I am assuming that this means that the [item-list] is not giving a list of the items. It should work. I have the following code working on a page of mine with no problems.

[perl interpolate=1]
  my $var = [nitems] || 0;
  my @items = ();
  my $items = '';
  my $out = '';
  [item-list]
  push(@items,'[item-code]');
  [/item-list]
  foreach (@items) {
    $items = $items . " $_";
  }
  if ( ($var <= 2) && !($items =~ /shipping/) ) {
    $out = '
       [order shipping]Click here to calculate shipping[/order]';
  }
  $out;

[/perl]

Hope this helps

> Is there a way to reference all the attributes of the shopping cart items inside a [perl] 
> construct?  I have seen reference various times to things like $Safe::Session and the like, but 
> have avsolutely no understanding of how they work, and can find no help in the documentation.
> 
> Thanks...
> ---
> Trevor Garside
> Actaeon West, Inc.
> trevor@actaeon.net
-------
Brian Kohles
brian@mediabang.com
minivend@mediabang.com


Search for: Match: Format: Sort by: