[ic] sorting problem

Alessandro Poletto alessandro at polet.to
Mon Jul 19 15:19:19 EDT 2004


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...


> At 04:33 PM 7/16/2004, you wrote:
> 
> >I have a problem with sorting when I use the search interchange
> >syntax to dig some datas from products database (eg from the main
> >menu).
> >
> >The results page presents the results without any problem, i can
> >expose all the datas: price, description, etc...
> >
> >Now I have the need of sorting the results by price, by available
> >quantity and by discount (additional field that I've inserted in
> >merchandising table).
> >
> >I've inserted a link and via cgi (in the url: "&price_sort=1")
> >so I try to make 'coditional' sorting:
> >
> >[search-list]
> >[sort products:price:rf]
> >   [if cgi price_sort eq'1']
> >     [sort products:price:rf]
> >   [/if]
> >[/search-list]
> >
> >
> >on the browser appear several times: [sort products:price:rf], a
> >numerber equal to the extracted items.
> >
> >Is possibile to make this type of sorting?
> >
> >Is better to "remake" the search adding or altering the search
> >criteria putting sf=price and if so, how is possible?
> >
> >many thanks in advance!
> 
> I have not used it in a long time, but I believe the [sort] tag comes
> immediately after the [search-region] opener, i.e.
> 
>          [search-region]
>          [if cg price_sort eq '1']
>                  [sort products:price:rf]
>          [/if]
>          ...
>          [search-list]
> 
> 
> You will find with multi-page results that the scope of [sort] is
> limited to each page as opposed to the entirety of the search results.
> Performance is also slower. It is better to pre-sort within the search
> parameters themselves.
> 
> - Ed
> 
> 
> 
> ===============================================================
> New Media E.M.S.              Technology Solutions for Business
> 11630 Fair Oaks Blvd., #250   eCommerce | Consulting | Hosting
> Fair Oaks, CA  95628          Ed.LaFrance at newmediaems.com
> (916) 961-0446                http://www.newmediaems.com
> (866) 519-4680 Toll-Free      (916) 961-0447 Fax
> =============================================================== 
> 
> _______________________________________________
> interchange-users mailing list
> interchange-users at icdevgroup.org
> http://www.icdevgroup.org/mailman/listinfo/interchange-users
> 


============================================
Toth di
Alessandro Poletto
http://www.toth.it
E-mail: alessandro at polet.to
============================================



More information about the interchange-users mailing list