Forums Forums Search & Filter Pro Woocommerce integration: Avoid redirection to shop page

Viewing 5 posts - 1 through 5 (of 5 total)
  • Anonymous
    #208436

    Hi,

    I am trying to integrate your plugin with a Woocommerce product category page. I would like the search form to show only on the category pages and the user to not be redirected to the Woocommerce shop page (that is, the user should stay on the current page). Is this possible? How can I make a custom template to implement this?

    Thanks in advance.

    Trevor
    #208464

    There are three conditions to stop the page re-directing.

    Your Product Category (still) needs to be a field in the form (if you do not want the use to be able to use this, use custom CSS to hide it), and you can then set the form to AutoDetect. These screenshots are for the Post Type Archive method, but you should see similar options.

    You need to set autodetect category/taxonomy:

    https://www.screencast.com/t/3B40jPYRF4SA

    And also enable filtering on Taxonomy Archives:

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

    Note that you could hide the form on the shop page. If you look at the classes on the body tag for each page, does the shop have one that the category pages do not, or vice versa? In which case, using CSS to hide the form is possible.

    Anonymous
    #208559

    Hi Trevor,

    Thanks for your reply. I solved my problem by creating a non-Woocommerce page for showing the form and filtering the products (as in any case I needed to create a page for sorting by attributes).

    I have selected ‘as an archive’ for display results method and have created a custom search results template following your documentation. The Ajax is also working as expected.

    I now have a problem making the pagination work / show on the search results page:

    • I have a standard WordPress loop (no custom query or WP_query) in the search-results template
    • I have tried enabling and disabling the AJAX
    • I am calling WP functions previous_posts_link( ) and next_posts_link( )

    Any tips / documentation would be greatly appreciated.

    Thanks

    Anonymous
    #208567

    My bad! I hadn’t changed the number of results to show while creating the form.

    Trevor
    #208573
    This reply has been marked as private.
Viewing 5 posts - 1 through 5 (of 5 total)