[ic] sorting problem

Daniel Davenport ddavenport at newagedigital.com
Wed Jul 21 01:51:33 EDT 2004



> -----Original Message-----
> From: interchange-users-bounces at icdevgroup.org
> [mailto:interchange-users-bounces at icdevgroup.org]On Behalf Of Alessandro
> Poletto
> Sent: Monday, July 19, 2004 3:19 PM
> To: interchange-users at icdevgroup.org
> Subject: Re: [ic] sorting problem
>
>
> I have solved a part of the problem writing this code (not so good as
> code, i'll write better when all is working!), now the problem is:
> how can I meke a sort by quantity in inventory?
>
> p.s. excuse me for 'italian variables'!
>
> <=====
>
> [tmp linea][data session last_search][/tmp]
> [tmp prova_uscita][/tmp]
> [perl]
>   my $line=$Scratch->{linea};
>   my @list = split(/\//,$line);
>   my $test=2;
>   foreach $record (@list) {
>     if ($record =~ /to=/) {
>     #  Erase from last search other orders
>     } elsif ($record =~ /tf=/) {
>     #  Erase from last search other orders
>       } else {
>       $Scratch->{prova_uscita}=$Scratch->{prova_uscita} . "$record/";
>     }
>  }
> [/perl]
>
> <a href="__VendURL__/[scratch prova_uscita]tf=price/to=n">Price</a>
>
> ====>
>
> Many thanks...

in your search, specify the quantity field (in foundation, that's usually
"inventory:quantity") as one of the fields to search and sort by.  See
http://www.icdevgroup.org/interchange-doc-5.2.0/frames/icdatabase_31.html
for details, and pay particular attention to the examples mentioning "Any in
stock except Sunflowers, Van Gogh". Remember to add a tf= for the quantity
field...or you may be able to use a sort tag in the results page.  (I'm not
sure if a sort tag would work, but something tells me it should.)



More information about the interchange-users mailing list