Results 1 to 9 of 9
  1. #1
    Join Date
    May 2007
    Posts
    136
    Plugin Contributions
    0

    Default Can you change the alpha sorter from a drop down menu in to a text links?

    On the category page how can we change the alpha sorter from a drop down menu in to a text links like so:

    A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z

  2. #2
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,024
    Plugin Contributions
    3

    Default Re: Can you change the alpha sorter from a drop down menu in to a text links?

    Maybe something like this?:

    sperling.com/examples/menuh/

  3. #3
    Join Date
    May 2007
    Posts
    136
    Plugin Contributions
    0

    Default Re: Can you change the alpha sorter from a drop down menu in to a text links?

    Ok there is probably a cleaner way of doing this but, I got this to work on the category page.

    PHP Code:
    <div id="alpha_filter">
      <a href="index.php?main_page=index&cPath=<?=$_GET['cPath']?>&sort=20a&alpha_filter_id=65" class="alpha_filter">A</a>|
      <a href="index.php?main_page=index&cPath=<?=$_GET['cPath']?>&sort=20a&alpha_filter_id=66" class="alpha_filter">B</a>|
      <a href="index.php?main_page=index&cPath=<?=$_GET['cPath']?>&sort=20a&alpha_filter_id=67" class="alpha_filter">C</a>|
      <a href="index.php?main_page=index&cPath=<?=$_GET['cPath']?>&sort=20a&alpha_filter_id=68" class="alpha_filter">D</a>|
      <a href="index.php?main_page=index&cPath=<?=$_GET['cPath']?>&sort=20a&alpha_filter_id=69" class="alpha_filter">E</a>|
      <a href="index.php?main_page=index&cPath=<?=$_GET['cPath']?>&sort=20a&alpha_filter_id=70" class="alpha_filter">F</a>|
      <a href="index.php?main_page=index&cPath=<?=$_GET['cPath']?>&sort=20a&alpha_filter_id=71" class="alpha_filter">G</a>|
      <a href="index.php?main_page=index&cPath=<?=$_GET['cPath']?>&sort=20a&alpha_filter_id=72" class="alpha_filter">H</a>|
      <a href="index.php?main_page=index&cPath=<?=$_GET['cPath']?>&sort=20a&alpha_filter_id=73" class="alpha_filter">I</a>|
      <a href="index.php?main_page=index&cPath=<?=$_GET['cPath']?>&sort=20a&alpha_filter_id=74" class="alpha_filter">J</a>|
      <a href="index.php?main_page=index&cPath=<?=$_GET['cPath']?>&sort=20a&alpha_filter_id=75" class="alpha_filter">K</a>|
      <a href="index.php?main_page=index&cPath=<?=$_GET['cPath']?>&sort=20a&alpha_filter_id=76" class="alpha_filter">L</a>|
      <a href="index.php?main_page=index&cPath=<?=$_GET['cPath']?>&sort=20a&alpha_filter_id=77" class="alpha_filter">M</a>|
      <a href="index.php?main_page=index&cPath=<?=$_GET['cPath']?>&sort=20a&alpha_filter_id=78" class="alpha_filter">N</a>|
      <a href="index.php?main_page=index&cPath=<?=$_GET['cPath']?>&sort=20a&alpha_filter_id=79" class="alpha_filter">O</a>|
      <a href="index.php?main_page=index&cPath=<?=$_GET['cPath']?>&sort=20a&alpha_filter_id=80" class="alpha_filter">P</a>|
      <a href="index.php?main_page=index&cPath=<?=$_GET['cPath']?>&sort=20a&alpha_filter_id=81" class="alpha_filter">Q</a>|
      <a href="index.php?main_page=index&cPath=<?=$_GET['cPath']?>&sort=20a&alpha_filter_id=82" class="alpha_filter">R</a>|
      <a href="index.php?main_page=index&cPath=<?=$_GET['cPath']?>&sort=20a&alpha_filter_id=83" class="alpha_filter">S</a>|
      <a href="index.php?main_page=index&cPath=<?=$_GET['cPath']?>&sort=20a&alpha_filter_id=84" class="alpha_filter">T</a>|
      <a href="index.php?main_page=index&cPath=<?=$_GET['cPath']?>&sort=20a&alpha_filter_id=85" class="alpha_filter">U</a>|
      <a href="index.php?main_page=index&cPath=<?=$_GET['cPath']?>&sort=20a&alpha_filter_id=86" class="alpha_filter">V</a>|
      <a href="index.php?main_page=index&cPath=<?=$_GET['cPath']?>&sort=20a&alpha_filter_id=87" class="alpha_filter">W</a>|
      <a href="index.php?main_page=index&cPath=<?=$_GET['cPath']?>&sort=20a&alpha_filter_id=88" class="alpha_filter">X</a>|
      <a href="index.php?main_page=index&cPath=<?=$_GET['cPath']?>&sort=20a&alpha_filter_id=89" class="alpha_filter">Y</a>|
      <a href="index.php?main_page=index&cPath=<?=$_GET['cPath']?>&sort=20a&alpha_filter_id=90" class="alpha_filter">Z</a>
    </div>
    Is there a way to adapt these links to work on the products all page (tpl_products_all_default.php)?

  4. #4
    Join Date
    May 2007
    Posts
    136
    Plugin Contributions
    0

    Default Re: Can you change the alpha sorter from a drop down menu in to a text links?

    Is it even posible to add an alpha sorter to the all products page? I have been playing with this code now for days

  5. #5
    Join Date
    May 2007
    Posts
    136
    Plugin Contributions
    0

    Default Is it posible to add the alpha sorter to the all products page?

    Is it posible to add the alpha sorter to the all products page?

  6. #6
    Join Date
    Oct 2004
    Location
    Ontario
    Posts
    116
    Plugin Contributions
    1

    Default Re: Can you change the alpha sorter from a drop down menu in to a text links?

    Message me if you are still looking for help.

  7. #7
    Join Date
    Mar 2005
    Posts
    70
    Plugin Contributions
    0

    Default Re: Can you change the alpha sorter from a drop down menu in to a text links?

    just wanted to say thanx for the great post, this was suggested to me to try on our site and i started scratchin my head, thinking of how involved it would be.

    i found this post, and it took all but 5 minutes to setup, and it looks and works great.

    thanks again!!!
    Never be afraid to try something new, remember that amateurs built the ark, professionals built the Titanic

  8. #8
    Join Date
    May 2007
    Posts
    136
    Plugin Contributions
    0

    Default Re: Can you change the alpha sorter from a drop down menu in to a text links?

    Thanks for the reply zskiman

    I have updated the above code and cleaned it up:
    PHP Code:
    function GetAlphabet($type='string',$lower=false){
        
    $spacer "&nbsp;|&nbsp;";
     
    $r = ($type == 'string') ? '' : array();
        
    // chr 65 => A, chr 90 => Z
        
    for ($c=65$c <= 90$c++){
         if (!isset(
    $alpha_filter_id)){$alpha_filter_id 65;}
            
    $ch = ($lower) ? strtolower(chr($c)) : '<a href="index.php?main_page=index&cPath='.$_GET['cPath'].'&alpha_filter_id='.$alpha_filter_id.'">'.chr($c)."</a>$spacer";
            if (
    $type == 'string'){ $r .= $ch; }
            else { 
    $r[] = $ch; }
      
    $alpha_filter_id $alpha_filter_id+1;
        }
        return 
    $spacer.$r;
    }
    echo 
    GetAlphabet(); 

  9. #9
    Join Date
    May 2007
    Posts
    136
    Plugin Contributions
    0

    Default Re: Can you change the alpha sorter from a drop down menu in to a text links?

    I made an update to this code, I added some css when a letter is active it will be bold and black, so that the user knows what page they are on.

    PHP Code:
    function GetAlphabet($type='string',$lower=false){
        
    $spacer "&nbsp;|&nbsp;";
     
    $r = ($type == 'string') ? '' : array();
        
    // chr 65 => A, chr 90 => Z
        
    for ($c=65$c <= 90$c++){
         if (!isset(
    $alpha_filter_id)){$alpha_filter_id 65;}
         if (
    $alpha_filter_id == $_GET['alpha_filter_id']){$style ' style="font-weight:bold; font-size:12px; color:#000000;"';}else{$style '';}
            
    $ch = ($lower) ? strtolower(chr($c)) : '<a href="index.php?main_page=index&cPath='.$_GET['cPath'].'&alpha_filter_id='.$alpha_filter_id.'"'.$style.'>'.chr($c)."</a>$spacer";
            if (
    $type == 'string'){ $r .= $ch; }
            else { 
    $r[] = $ch; }
      
    $alpha_filter_id $alpha_filter_id+1;
        }
        return 
    $spacer.$r;
    }
    echo 
    GetAlphabet(); 

 

 

Similar Threads

  1. Can I remove the Option text from in front of a drop down box?
    By dandandanpie in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 14 Oct 2011, 08:40 PM
  2. Replies: 2
    Last Post: 6 Mar 2010, 07:05 PM
  3. change countries in the drop-down menu
    By redrob in forum General Questions
    Replies: 0
    Last Post: 29 May 2008, 12:47 AM
  4. how do you add a drop down menu for the quanity box?
    By mikeylikesyou in forum General Questions
    Replies: 8
    Last Post: 30 Sep 2007, 11:18 AM
  5. Change from drop down menu to list format
    By Oseymour in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 22 Sep 2007, 05:47 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR