[ic] Get ActionMap to search 2 fields?
Carl Bailey
carl at endpoint.com
Wed Sep 23 15:01:23 UTC 2009
On Sep 23, 2009, at 9:58 AM, IC wrote:
>> The problem is you're using a coordinated and search for inactive and
>> prod_group and trying to combine it with an or search for category2
>> or
>> category. Interchange is not able to do this the way you want.
>>
>>
>> Peter
>
> Thanks Peter, I have now had to modify the actionmap for a non-
> coordinated
> search:-
>
> $CGI->{mv_coordinate} = 'no';
> $CGI->{mv_substring_match} = 'yes';
> $CGI->{mv_search_file} = 'products';
> $CGI->{mv_return_fields} = 'sku,sale_price';
> $CGI->{mv_search_field} = "category,category2";
> $CGI->{mv_searchspec} = "$category";
> $CGI->{mv_column_op} = "rm";
>
> This works but shows inactive products, to get around this I have
> had to
> modify the results page with:-
>
> [search-list]
> [if-item-field inactive != 1]
>
> Display product...
>
> [/if-item-field]
> [/search-list]
>
> Which again works ok, anyone have a better solution?
>
> Thanks,
> Andy.
Amdy,
That should work OK as long as you are displaying all your results on
one page. If you are using a more-list, then the [if] will cause you
to have different numbers of results on different pages as different
numbers of inactive products are encountered and skipped. Another
approach would be to create a view on your products table. Something
like create view active_products as select * from products where
inactive <> 1. Then run your IC search on the view. Or find a way to
use the [query] tag instetead of search/scan.
Carl
. . . . . . . . . . . . . . . . . . .
Carl Bailey
t: 919-323-8025
carl at endpoint.com
. . . . . . . . . . . . . . . . . . .
More information about the interchange-users
mailing list