[ic] search_region method "quote" query

Sam Batschelet sam at westbranchresort.com
Thu Oct 22 19:56:51 UTC 2009


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
    }


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.icdevgroup.org/pipermail/interchange-users/attachments/20091022/2a29edea/attachment.htm 


More information about the interchange-users mailing list