Filter not working for all search forms

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 Jacques Letesson 6 years, 11 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #5728
    Jacques Letesson
    Jacques Letesson
    Participant

    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.
    #5735
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    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 :)


    #5740
    Jacques Letesson
    Jacques Letesson
    Participant

    Oh 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.

    #5756
    Jacques Letesson
    Jacques Letesson
    Participant

    @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.

    #5760
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi 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 :)


    #5762
    Jacques Letesson
    Jacques Letesson
    Participant

    Thank you Ernest!

    WIll continue to update this post, and show you what I have accomplished with your plugin.

    Keep up the good work.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.