[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] Get value(s) out of mv_searchspec
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.
After looking through the mailing-list archives, I found (and tried) the following:
[set name="dummy" interpolate=1][value mv_searchspec[/set]
[perl arg="scratch"]
my($msg1) = $Safe{'scratch'}->{'dummy'};
my(@items)=split (/\0/, $msg1);
$Safe{'values'}{'se_1'} = $items[0];
$Safe{'values'}{'se_2'} = $items[1];
$rub = $Values->{'se_1'};
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]
---> No textstring, next try with:
$rub = $items[0];
---> No textstring, next try with:
[perl interpolate=1]$rub = '[value my_searchspec]';
--->Again, there is NO textstring printed.
So how can I get (or set a perl variable with) the values
(or one of the values) of the mv_searchspec array??
Anyone any idea????
ThanX in advance
-;-))==
Frank