Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Filter not working for all search forms
This topic contains 5 replies, has 2 voices, and was last updated by Jacques Letesson 8 years, 8 months ago.
- AuthorPosts
- August 31, 2015 at 11:33 pm #5728
Hi there,
I have a small problem with the plugin and I can’t figure out what is it.
I added a function to filter the results like mentioned in the documentation.
However this filter works for one of my two search form.
What could prevent the filter to work properly in the other form?
add_filter( 'asp_results', 'restofrais_asp_add_to_cart', 1, 1 ); if ( ! function_exists( 'restofrais_asp_add_to_cart' ) ) { function restofrais_asp_add_to_cart($results) { foreach ($results as $k=>$v) { $results[$k]->link = 'http://www.google.com'; } return $results; } }
The second part of my question is related to the layout of the search result.
I would like the results to be displayed exactly like on the archive page of my woocommerce (see attached file).
Is that possible?
Thanks in advance for your time.
Peace.
Attachments:
You must be logged in to view attached files.September 1, 2015 at 11:53 am #5735Hi!
The only thing I can think of is caching or grouping. The code looks all right to me as it is, and it definitely should work.
Is the results grouping or caching enabled by any chance? For grouped results this code won’t work.
As for the second request, the only possible way I see is to edit the results template file to a similar structure and add corresponding CSS as well. Here is an knowledge-base article explaining how to do that. I only recommend editing these files, if you are falmiliar with PHP, HTML and CSS programming.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
September 1, 2015 at 1:36 pm #5740Oh yeah, I remember playing with the grouping options ! Will check that and let you know.
Thank you for the link to the ‘result templating’ article. Will do that.
It would have been awesome to detect if the user had uploaded those templates into is theme folder.
To avoid any edition to the core plugin. Does it make sense ?
Peace.
September 1, 2015 at 9:49 pm #5756@Ernest.
Everything is going fine with the custom template!
Is there a way of always showing all the results not just the 3-4 first ones?
I don’t want any scroll bar.
Should I edit the js files or is it any other simple way to do that?
Thanks.
J.
September 2, 2015 at 9:42 am #5760Hi again!
It’s actually a good idea to check for uploaded versions in the theme folder. It would solve the problem of making those files persistent. Great idea! I’m putting this on the TODO list right away.
Actually there is an option to increase the viewport size to disable the scrolling. Open the search instance options, then Theme Options -> Vertical Results panel, and scroll to the Results box viewport (in item numbers) option. By default it’s 4. Change that to something bigger, like 100. That should get rid off the scrollbar.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
September 2, 2015 at 9:44 am #5762Thank you Ernest!
WIll continue to update this post, and show you what I have accomplished with your plugin.
Keep up the good work.
- AuthorPosts
You must be logged in to reply to this topic.