Akopia Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

[ic] Ambiguous result



1) How do I use the [more] in this case?: I want to show up to 20 items per 
page

2) The variable $istock get only "N" even if the $invsplit is less than zero. 
 I did the same code in plain perl and works.  Could you please tell me 
what's wrong?

Below is the code:
========================================================================
[loop search="
st=db
sq=select * from inventory where 
ml=10000
"]


[perl]
push (@f,'[loop-data inventory sku]');
push (@l,'[loop-data inventory quantity]');
[/perl]

[/loop]

[perl]
@indices = sort { $l[$a] cmp $l[$b] or
$f[$a] cmp $f[$b]} (0..$#f);

foreach (@indices){
$la = $l[$_];
$fa = $f[$_];

$key = $fa . "\0" . $la ;
}


foreach $key (sort keys %models){
($skusplit,$invsplit) = split (/\0/, $key);


if($invsplit > 0){
$istock='Y';
}else{
$istock='N';
}

$return .= "SKU: $skusplit,INV: $invsplit, Is is in Stock: $istock";
}
return $return;
[/perl]
======================================================================
SAMPLE OUTPUT:
SKU: ORANGE,INV: 100, Is is in Stock: N
SKU: LIME,INV: 0, Is is in Stock: N
SKU: PEAR,INV: 14, Is is in Stock: N
SKU: FROG,INV: 23, Is is in Stock: N
...ETC


_______________________________________________
Interchange-users mailing list
Interchange-users@www.minivend.com
http://www.minivend.com/mailman/listinfo/interchange-users


Search for: Match: Format: Sort by: