<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7638.1">
<TITLE>search_region method "quote" query</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>5.6.2<BR>
standard<BR>
<BR>
Trying to modify standard component results_grid to check variants<BR>
inventory. This was working fine but now complains:<BR>
<BR>
Can't call method "quote" on an undefined value at (tag 'search_region')<BR>
line 66.<BR>
<BR>
I don't understand because all values are defined from what I can see.<BR>
<BR>
$Tag->perl();<BR>
my $db = $Db{inventory};<BR>
my $qsku = $db->quote($sku);<BR>
my $ref = $db->query("SELECT SUM(i.quantity) FROM inventory i INNER JOIN<BR>
variants v WHERE i.sku = v.code AND v.sku=$qsku");<BR>
my $quantity = $ref->[0]->[0];<BR>
<BR>
if ($quantity > 0) {<BR>
$record->{stock} = <<EOF;<BR>
<span style="color: #008000; font-size:10px; font-family: san-serif;<BR>
font-weight: bold;">[L]Yes[/L]</span><BR>
EOF<BR>
}<BR>
else {<BR>
my $url = $Tag->area('function/stock_alert', $sku);<BR>
$record->{stock} = <<EOF;<BR>
<a href="$url" title="[L]Click here to pre-order this item or get notified<BR>
as soon as this item is available again.[/L]" style="color: #FF0000;<BR>
font-size:10px; font-family: san-serif; font-weight: bold;">[L]No[/L]</a><BR>
EOF<BR>
}<BR>
<BR>
<BR>
</FONT>
</P>
</BODY>
</HTML>