Forum Replies Created
-
AuthorPosts
-
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterHi,
No worries 🙂 It is definitely not Ajax Search Pro causing it, I can confirm that.
I will close this ticket now as requested.
Ernest Marcinko
KeymasterWe are working on a complete back-end refactor. It will follow the search statistics UI. With that rework there will be a new way to create filters, that will also include sorting possibilities.
There is still a way via converting a custom field filter to an ordering filter via a bit of custom code. Follow the steps below:
1. Create a drop-down custom field filter for a non-existint field
custom_orderwith these values (see this screenshot):relevance||Relevance date||Publish date date_reverse||Publish date descending alpha||Alphabetical alpha_reverse||Alphabetical descending price||Cheapest first price_reverse||Most expensive first2. Add this code via the Code Snippets plugin or to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines:
add_filter( 'asp_query_args', function ( $args ) { // The values allowed in the the_ordering variable $allowed_orderings = array( 'relevance', 'id', 'id_reverse', 'date', 'date_reverse', 'alpha', 'alpha_reverse', 'price', 'price_reverse', ); $ordering = ''; foreach ( $args['post_meta_filter'] as $k => $filter ) { if ( $filter['key'] === 'custom_order' ) { $ordering = $filter['value']; unset( $args['post_meta_filter'][$k] ); } } if ( $ordering === '' || !in_array($ordering, $allowed_orderings, true) ) { return $args; } switch ( $ordering ) { case 'id': $args['post_primary_order'] = 'id DESC'; break; case 'id_reverse': $args['post_primary_order'] = 'id ASC'; break; case 'date': $args['post_primary_order'] = 'post_date DESC'; break; case 'date_reverse': $args['post_primary_order'] = 'post_date ASC'; break; case 'alpha': $args['post_primary_order'] = 'post_title ASC'; break; case 'alpha_reverse': $args['post_primary_order'] = 'post_title DESC'; break; case 'price': $args['post_primary_order'] = 'customfp ASC'; $args['post_primary_order_metatype'] = 'numeric'; $args['_post_primary_order_metakey'] = '_price'; break; case 'price_reverse': $args['post_primary_order'] = 'customfp DESC'; $args['post_primary_order_metatype'] = 'numeric'; $args['_post_primary_order_metakey'] = '_price'; break; case 'relevance': default: $args['post_primary_order'] = 'relevance DESC'; break; } return $args; } );This will convert the custom field filter into a sorting filter.
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterHi!
can you guide me in the right direction to adding sort to this page?
I’m afraid a sorting filter is not yet possible via Ajax Search Pro. You can set the results primary and the secondary sorting on the back-end, but there is no filter for it yet for the front-end.
Also search number, having issues showing how many results based on search
I assume you mean this number? That shows the remaining results (as it is used with the load-more results feature), not the total results count. While it can’t be changed, it is possible to disable it with a few lines of custom CSS code:
.asp_showmore span { display: none !important; }Ernest Marcinko
KeymasterHi Ross,
It does that automatically, whenever the integration is enabled.
For example, if I search for “test”, then I get these page results in the drop-down. When I hit enter, I get redirected, and the results are the same on the results page.
Some differences can be expected, usually when a non-post type is returned in the drop-down, or if a post type is not fully supported in the grid, but generally it should be very similar.
Ernest Marcinko
KeymasterHi Ross,
Thank you very much for your kind words, I really appreciate it!
You are looking for the loop grid integration feature, but as I was checking the results page I see that you have already successfully connected the search to the Loop Grid.
Ernest Marcinko
KeymasterHi!
I’m afraid selecting the items manually is not possible – the only possiblities are either newest, random or results for a search phrase.
It is however possible to enable a loader in the results area, you can do that here.
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterOkay, I see. So these filters are to narrow down existing results. If you also want to search items by category titles, you have to enable this option, that will do the trick.
Ernest Marcinko
KeymasterHi,
Sure! Thank you for the details.
So, what you want is not this, make sure to turn that off. That is to return taxonomy terms as results, and you want the products by taxonomy terms.
For that just enable this option, it will do exactly what you expect.February 18, 2026 at 12:45 pm in reply to: Clumsy update workflow in CI environments needs to be streamlined #57016Ernest Marcinko
KeymasterYou cannot access this content.
February 18, 2026 at 12:27 pm in reply to: Clumsy update workflow in CI environments needs to be streamlined #57013Ernest Marcinko
KeymasterYou cannot access this content.
-
AuthorPosts