[ic] Get value(s) out of mv_searchspec

Stefan Hornburg Racke interchange-users@interchange.redhat.com
Thu Apr 11 13:37:01 2002


Frank <fmueller@adva.de> writes:

> Hello List,
> 
> I am migrating a minivend 3.14 store to ic 4.8 and have
> a problem with embedded perl-code and mv_searchspec on 
> my resultpages.
> 
> I have a one-click search with se=xxx/sf=xxx etc.
> On the resultpage I want to print out a text depending to
> the value of mv_searchspec.
> 
> On minivend 3.14 I did the following (and it works):
> 
> Searchstring: <A HREF="/cgi-bin/shop/scan/se=dmd016/sf=aaa/se=jpg/sf=thumb/ml=10/sp=res_dmd.html">
> 
> Perl-Code on resultpage: 
> 
> [perl interpolate=1]$rub = '[value mv_searchspec]';
>  if ($rub  =~ /^dmd010/) {$txt = 'textstring 1'}
>  if ($rub  =~ /^dmd011/) {$txt = 'textstring 2'}
>  if ($rub  =~ /^dmd015/) {$txt = 'textstring 3'}
>  if ($rub  =~ /^dmd016/) {$txt = 'textstring 4'}
>  $out = "$txt";
>  $out; [/perl]
> 
> On ic 4.8 the [value mv_searchspec] is an array like 'ARRAY(0x8306eb0)'
> and not a string like "dmd016jpg" as it is on mv 3.14.

Try

[calc]
$rub = $Values->{mv_searchspec}->[0];
...
[/calc]

Ciao
        Racke

-- 
Think of it !

For projects and other business stuff please refer to COBOLT NetServices
(URL: http://www.cobolt.net; Email: info@cobolt.net; Phone: 0041-1-3884400)