categories on listing not sorting alphabetically
This topic contains 12 replies, has 4 voices, and was last updated by Guust 10 years, 11 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
November 18, 2014 at 11:21 pm #21906
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?
November 18, 2014 at 11:58 pm #21907Are 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.November 19, 2014 at 12:17 am #21908True that, they’re not in order either. Good catch. Can’t wait to hear from the wizards! Thanks @guust.
November 19, 2014 at 12:45 pm #21930ok 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; }November 19, 2014 at 3:14 pm #21936This 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…
November 19, 2014 at 4:42 pm #21941i made the change in a newer file, if i send it it could break other stuff.
Stiofan
November 19, 2014 at 5:20 pm #21946Maybe 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
November 20, 2014 at 10:35 am #22017Just noticed this one was marked as resolved, there any way to help out on that last post I put up? Thanks @stiofan!
November 20, 2014 at 3:05 pm #22037I 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
November 20, 2014 at 11:52 pm #22110I reopened the topic and alerted Stiofan again.
November 24, 2014 at 4:01 pm #22469Hi kenny, can u post FTP and maybe me or guust can apply the fix.
Stiofan
November 24, 2014 at 5:55 pm #22474This reply has been marked as private.November 24, 2014 at 9:42 pm #22509This reply has been marked as private. -
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket