[ic] search_region method "quote" query
Stefan Hornburg (Racke)
racke at linuxia.de
Fri Oct 23 08:34:03 UTC 2009
Sam Batschelet wrote:
> 5.6.2
> standard
>
> Trying to modify standard component results_grid to check variants
> inventory. This was working fine but now complains:
>
> Can't call method "quote" on an undefined value at (tag 'search_region')
> line 66.
>
> I don't understand because all values are defined from what I can see.
>
> $Tag->perl();
> my $db = $Db{inventory};
> my $qsku = $db->quote($sku);
> my $ref = $db->query("SELECT SUM(i.quantity) FROM inventory i INNER JOIN
> variants v WHERE i.sku = v.code AND v.sku=$qsku");
> my $quantity = $ref->[0]->[0];
>
> if ($quantity > 0) {
> $record->{stock} = <<EOF;
> <span style="color: #008000; font-size:10px; font-family: san-serif;
> font-weight: bold;">[L]Yes[/L]</span>
> EOF
> }
> else {
> my $url = $Tag->area('function/stock_alert', $sku);
> $record->{stock} = <<EOF;
> <a href="$url" title="[L]Click here to pre-order this item or get notified
> as soon as this item is available again.[/L]" style="color: #FF0000;
> font-size:10px; font-family: san-serif; font-weight: bold;">[L]No[/L]</a>
> EOF
> }
>
$Db{inventory} isn't defined. Using $Tag->perl({tables => 'inventory'}) in
the first line should fix that.
Regards
Racke
--
LinuXia Systems => http://www.linuxia.de/
Expert Interchange Consulting and System Administration
ICDEVGROUP => http://www.icdevgroup.org/
Interchange Development Team
More information about the interchange-users
mailing list