MiniVend Akopia Services

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

Confusing error with embedded perl



I'm in the process of coding an 'inventory checker' into my checkout
basket.

The method I've decided on is to put some Perl just before the shopping
cart display that checks for bad input and/or orders over the maximum
available quantity.

I have my quantities stored in "inventory.asc" (TAB file).

I'll append the piece of Perl I'm using at the bottom of this message.

The error is:

Safe: Can't locate object method "open_table" via package
"Vend::Table::DB_File" at
/home/sites/home/users/tgarside/mvend/lib/Vend/Data.pm line 933.

I don't understand what it's trying to tell me.


Thanks in advance...

Trevor Garside
Actaeon West, Inc.
trevor@actaeon.net

---

Here is the perl (it's not finished yet, all it does is check the
inventories, there's no code to change them yet.  Also notice that it
doesn't do any bad character checking yet -- that'll be added when I get 
the perl to go through 'Safe' properly):

[perl arg="carts" interpolate="1"]
my $display_reduce = "N";
my $display_bad = "N";

my $output_string = "";

foreach $item ( @{$Safe{'carts'}->{'main'}} ) {
   my $base = $item->{'mv_ib'};
   my $code = $item->{'code'};
   my $order_quantity = $item->{'quantity'};
   my $available_quantity = tag_data('inventory', 'inv', $code);
   my $desc = tag_data($base, 'description', $code);
   my $price = tag_data($base, 'price', $code);

   if ($order_quantity > $available_quantity) {
      $output_string .= qq!Reduced $desc <br>\n!;
   }
}

foreach $item ( @{$Safe{'carts'}->{'main'}} ) {
   my $base = $item->{'mv_ib'};
   my $order_quantity = $item->{'quantity'};
   my $available_quantity = tag_data('inventory', 'inv', $code);
   my $desc = tag_data($base, 'description', $code);
   my $price = tag_data($base, 'price', $code);

   if ($order_quantity < '0') {
      $output_string .= qq!Fixed $desc <br>\n!;
   }
}

return $output_string;
[/perl]



Search for: Match: Format: Sort by: