[ic] Runtime error: Can't call method "open_table"

Mike Heins mikeh@minivend.com
Sat, 7 Oct 2000 09:15:36 -0400


Quoting Walter de Kok (Walter@afa.nl):
> I'm still having this error when I try to order something in my shop. I have
> deleted the products file and made some other files to replace the products
> file. I also added them to catalog.cfg. 
> 
> What can I do to avoid this error:
> 
> 
> 193.78.140.55 gYmgKvNz:193.78.140.55 - [05/October/2000:15:12:48 +0200] shop
> /cgi-bin/shop/process.html Safe: syntax error at (eval 346) line 2, at EOF
> > 
> > 
> > 		my $hash = ;
> > 		my @ary = sort { $hash->{$b} <=> $hash->{$a} } keys %$hash;
> > 		return '' unless @ary;
> > 		my %in_basket;
> > 		splice(@ary, 3);
> > 		for(@{$Carts->{main}}) {
> > 			$in_basket{$_->{code}} = 1;
> > 		}
> > 		@ary = grep ! $in_basket{$_}, @ary;
> > 		return '' unless @ary;
> > 		my $out = <<'EOF';
> > 	<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH="100%">
> > 		<TR><TD BGCOLOR="#669999"><FONT SIZE="1"
> COLOR="#FFFFFF">Customers who bought this item also bought:</TD>
> > 		</TR><TR>
> > 		<TD><FONT SIZE="1">
> > EOF
> > 		for(@ary) {
> >  			my $desc = tag_data( 'products', 'description', $_);
> > 			$out .= <<EOF;
> > 		<A HREF="[area $_]">$desc</A><BR>
> > EOF
> > 		}
> > 		return $out . '</TD></TR></TABLE>';
> > 	
> > 
> 193.78.140.55 gYmgKvNz:193.78.140.55 - [05/October/2000:15:12:48 +0200] shop
> /cgi-bin/shop/process.html Runtime error: Can't call method "open_table" on
> an undefined value at /usr/local/interchange/lib/Vend/Data.pm line 799.
> > 
> 

This is the code for the "others who bought this" links in the basket.

It is caused by not having a "merchandising" table or having bogus values
in the "others_bought" field, I think. Just remove that code from the
basket page if you don't want to use the merchandising feature.

-- 
Akopia, Inc., 131 Willow Lane, Floor 2, Oxford, OH  45056
phone +1.513.523.7621 fax 7501 <heins@akopia.com>

I have a cop friend who thinks he ought be able to give a new ticket;
"too dumb for conditions".