[ic] ActionMap Search

Ton Verhagen interchange-users@icdevgroup.org
Fri Jun 27 13:00:01 2003


Quoting Jamie Neil <jamie@versado.net>:
>Hi all,
>
>can anyone explain why the following ActionMap doesn't work properly?
>
>ActionMap  cat  <<EOR
>sub {
>         my ($action, $category) = split ('/', shift);
>         $CGI->{mv_todo} ='search';
>         $CGI->{mv_nextpage} = 'results';
>         $CGI->{mv_search_file} = 'products';
>         $CGI->{mv_searchtype} = 'db';
>         $CGI->{mv_coordinate} = 'yes';
>         $CGI->{mv_return_fields} = 'sku';
>         $CGI->{mv_matchlimit} = '10';
>         $CGI->{mv_sort_field} = 'manufacturer,price';
>         $CGI->{mv_sort_option} = 'f,n';
>         $CGI->{mv_search_field} = 'category';
>         $CGI->{mv_search_field} = 'inactive';
>         $CGI->{mv_column_op} = 'rm';
>         $CGI->{mv_column_op} = 'ne';
>         $CGI->{mv_searchspec} = "$category";
>         $CGI->{mv_searchspec} = '1';
>         $CGI->{banner_text} = "$category";
>         $Tag->update('process');
>         return 1;
>}
>EOR
>
>If I call <BASE_URL>/cat/Category1 it should return all active products in
>Category1, but it returns every product in the database.
>
>If I reverse the order of the two search terms or strip out the "inactive ne
>1" search then it works fine. The same search also works fine as a oneclick
>search, so I'm thinking there might be something special about stacking in
>perl subroutines.

No, you are assigning a new value to the cgi variables.

Try this to stack em up:

$CGI->{mv_search_field} = 'category';
$CGI->{mv_search_field} .= '\0inactive';




Best regards,

Ton

--
Alamerce Nederland --- Cornerstone of eBusiness
Phone +31-40-2374381    info@alamerce.nl    http://www.alamerce.nl

eCommerce Solutions -- Consulting -- Website & Interchange Hosting