categories on listing not sorting alphabetically

This topic contains 12 replies, has 4 voices, and was last updated by  Guust 9 years, 5 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #21906

    Kenny Eliason
    Expired Member
    Post count: 54

    Hey there! Love your plugin, and you guys have awesome support which really really goes a long ways.

    On this site we’re working on, the client would like all the categories on the individual listing to be ordered alphabetically. See:

    http://new.musclecarsofamerica.com/listings/bridjit-curb-ramps/

    The last category in the list under their logo is “Rolled Curb” which is out of order from the rest of them. I think the reason the rest of them are in order is because that’s how I imported them. Any ideas?

    #21907

    Guust
    Moderator
    Post count: 29970

    Are you sure the rest is alphabetical?
    Accessories should come before Clubs, should it not.
    Some additional code should be able to sort them I would think, I’ll get one of the code wizards to have a look at your topic.

    #21908

    Kenny Eliason
    Expired Member
    Post count: 54

    True that, they’re not in order either. Good catch. Can’t wait to hear from the wizards! Thanks @guust.

    #21930

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    ok i have added this to core but if u want to use it now plase change this in core file geodirectory_template_actions.php around line 467

    CHANGE FROM:

    
    
    $post_term = array_unique($post_term);
    						if(!empty($post_term)){
    							foreach($post_term as $post_term){
    								$post_term = trim($post_term);
    								
    								if($post_term != ''):	
    									$term = get_term_by( 'id', $post_term, $post_taxonomy); 
    									if(is_object($term)){
    									$links[] = "<a href='".esc_attr( get_term_link($term,$post_taxonomy) ) . "'>$term->name</a>";
    									$terms[] = $term;
    									}
    								endif;
    							}
    							
    						}

    CHANGE TO:

    
    
    $post_term = array_unique($post_term);
    						if(!empty($post_term)){
    							foreach($post_term as $post_term){
    								$post_term = trim($post_term);
    								
    								if($post_term != ''):	
    									$term = get_term_by( 'id', $post_term, $post_taxonomy); 
    									if(is_object($term)){
    									$links[] = "<a href='".esc_attr( get_term_link($term,$post_taxonomy) ) . "'>$term->name</a>";
    									$terms[] = $term;
    									}
    								endif;
    							}
    							// order alphabetically
    							asort($links);
    							foreach (array_keys($links) as $key) {
    								$termsOrdered[$key] = $terms[$key] ;
    							}
    							$terms = $termsOrdered;
    							
    						}
    #21936

    Kenny Eliason
    Expired Member
    Post count: 54

    This is awesome! Thanks! Any chance you could send me the entire geodirectory_template_actions.php file? I swapped out that code but it doesn’t appear to be working…

    #21941

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    i made the change in a newer file, if i send it it could break other stuff.

    Stiofan

    #21946

    Kenny Eliason
    Expired Member
    Post count: 54

    Maybe if I send you mine… you can check it out and send it back? Thanks @Stiofan1

    https://www.dropbox.com/s/avitb1cxnfkftz0/geodirectory_template_actions.php?dl=0

    #22017

    Kenny Eliason
    Expired Member
    Post count: 54

    Just noticed this one was marked as resolved, there any way to help out on that last post I put up? Thanks @stiofan!

    #22037

    Alec
    Lifetime Member
    Post count: 319

    I also cant get the zip code search function to appear, when i go into admin section there is no way to save it as on, click on button to turn it on, but does not save

    #22110

    Guust
    Moderator
    Post count: 29970

    I reopened the topic and alerted Stiofan again.

    #22469

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi kenny, can u post FTP and maybe me or guust can apply the fix.

    Stiofan

    #22474

    Kenny Eliason
    Expired Member
    Post count: 54
    This reply has been marked as private.
    #22509

    Guust
    Moderator
    Post count: 29970
    This reply has been marked as private.
Viewing 13 posts - 1 through 13 (of 13 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket