Forums Forums Search & Filter Pro Problems as soon as ajax is activated

Tagged: 

Viewing 10 posts - 1 through 10 (of 14 total)
  • Anonymous
    #188627

    Hello,

    I am discovering the plugin so I might be missing out on something. Sorry about this if it’s the case.

    I am building a e-commerce website with woocommere and storefront. Still working on local dev at the moment.

    Here is my wish :

    I have a sort of blog section within my site that is made of one main category with its own child subcategories. In those subcategories I have all my articles.

    I would like to use the plugin to make something similar to this http://bit.ly/2Nfzmol. My main category should therefore display all the articles and then with the checkboxes the user filters the articles according to its needs, retrieving articles from the chosen subcategories.

    It works great as long as Ajax is not activated. Where could the problem come from?

    I have the Display results method: As an Archive and my custom template is my main category file (category-slug.php) with the slug to render the same URL.

    Finally I display the checkboxes thanks to the <?php echo do_shortcode(‘[searchandfilter id=”242″]’); ?> in that category-slug.php file.

    Thanks for your help.

    Best regards

    Trevor
    #188648

    Hi

    Normally, I would suggest using the WooCommerce display method, and to make sure that the Ajax Container is set to .products (90% of sites with WooCommerce, this is correct).

    There are some settings I would make sure to enable. See these screenshots:

    https://www.screencast.com/t/Qi1FiS6F0S

    https://www.screencast.com/t/DoKL7OyeY

    Anonymous
    #188669

    Hi Trevor,

    Thanks for your reply.

    It does not work as I want. First, it does not count the articles for each subcat (checkbox). It shows 0.

    Then when I click on one checkbox, it brings me to the subcat page instead of displaying the articles in the main category page.

    I am not using the plugin for the e-commerce part at the moment, but only for my articles. And I have been spending a lot of time working on the layout of my articles so changing the container now is really a problem.

    Isn’t there another way to make it work?

    Thanks in advance

    Anonymous
    #188678

    Trevor,

    It works actually, I realised that I had not checked the “Tag, Category, & Taxonomy archives” checkbox in the “Detect default from current page” settings.

    But one problem is remaining. I would like the title of the main category page to be displayed and it is not. The filter provided in the documentation does not seem to work.

    Can you help me out on this?

    Thanks a lot

    Trevor
    #188682

    Which display method are you currently (now) using?

    Anonymous
    #188693

    I am using “As an Archive” with my main category php template set up.

    The articles filter work perfectly, even with ajax. The results are displaying in the main category page as I wanted. Everything works fine except that my header section is not working properly. Only the bold part of the header is displayed.

    <header class=”page-header”>
    <?php the_archive_title( ‘<h1 class=”page-title”>’, ‘</h1>’ );?>
    <div class=”category-description”><h2>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</h2>
    <?php the_archive_description( ‘<div class=”taxonomy-description”>’, ‘</div>’ ); ?>
    </header>

    Trevor
    #188699

    You may need to copy that file and give it a new name and use that as the template, and then edit that code.

    You can modify that php file to create the title inline in the page. One issue is that Ajax refreshes are unlikely to change the title, so the title needs to be inside the Ajax container.

    To access filters being used will require coding, see this documentation page:

    https://searchandfilter.com/documentation/accessing-search-data/

    To then get that to appear in the title may require more coding. Another user who resolved this for his theme/site posted this thread:

    https://support.searchandfilter.com/forums/topic/how-to-actually-output-the-search-results-title/

    Anonymous
    #188707

    Thank you very much Trevor.

    I will try the title inline later on.

    I prefer not using another template because apart from the title, it s working as I wanted to. That main cat displaying all articles and checkboxes filtering subcat.

    I should have thought of trying inline title before.

    Yes I saw the other user’s post but as far as I understood it is to display titles according to the researches. I need permanent title.

    I will let you know.

    All the best

    Trevor
    #188709

    If you want a permanent title, then this would do that:

    <header class="page-header">
    <h1 class="page-title">Title here</h1>
    <div class="category-description"><h2>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</h2></div>
    </header>
    Anonymous
    #188769

    Yes that was I intended to do.

    Everything is working perfectly Trevor. Thanks a lot.

    One more question please. What do you recommend to target the result page when setting up conditions for hooks or when styling css for that specific page.

    The template set up in “Template Options” (main cat in my case) is not the actual page right?

    Thanks again

Viewing 10 posts - 1 through 10 (of 14 total)