• Resolved Tim Sutherland

    (@681admin)


    Hi all

    Having some troubles when using a search form above the listings on a client site. What happens is when you click on a filter it then updates the search results via ajax correctly.

    Problem is when you click on a resulting listing the back to search results link (which I believe correctly includes all the filters that were used) results in a page cannot be found error. I’ve tried and when you copy and paste the URL generated when you filter the listings page into a new browser window it also fails, so there’s something causing the AJAX on filtering to not work??

    I’ve using DIVI and all other aspects are working as expected. I’ve tried turning off plugins and reverting to default wordpress theme and still the same issue so I can only assume it’s something to do with the estatik plugin.

    Has anyone else experienced this problem? How did you work around it?

    Any advice would be greatly appreciated. I’ve also logged a support ticket with Estatik but realise with the free version they may be limited in how much support they can provide.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Tim Sutherland

    (@681admin)

    I’ve noticed the following: If I remove &post_type=properties from the search string that the AJAX call creates the page will display correctly. Or if I change it to something else that isn’t properties.

    i.e. the query string is ?layout=list&es=1&post_type=properties&location=Coffs+Harbour&page_num=1&paged-1=1

    Change it to ?layout=list&es=1&location=Coffs+Harbour&page_num=1&paged-1=1

    and the page appears correctly.

    Any thoughts on why this would happen? The post type is properties and I’ve resaved permalinks in case there were any issues there but there’s no issues with any other part of the plugin, just appears to be this query that’s created when you filter a search.

    Note if you just change the sort order of the results without any filtering (i.e. sort by lowest price) this is the query that’s created and it works fine with back to search results link working AOK

    ?layout=list&sort=lowest_price&is_address_search_enabled=0&is_collapsed_filter_enabled=0&sort-1=lowest_price&page_num=1&paged-1=1

    It appears the issue is clearly the query string that gets created when you add filters to the search using the shortcode instructions?

    Thread Starter Tim Sutherland

    (@681admin)

    Warning message in logs if this helps in any way:

    [10-Jul-2024 23:57:07 UTC] PHP Warning: Undefined array key “label” in /home/hibbardh/public_html/wp-content/plugins/estatik/templates/front/shortcodes/search/simple.php on line 71

    Thread Starter Tim Sutherland

    (@681admin)

    I’ve found a workaround for now which appears to have ‘fixed’ the problem.

    in /wp-content/plugins/estatik/templates/front/shortcodes/search/simple.php line 24 I simply commented out the code:

                <input type="hidden" name="post_type" value="properties"/>

    This is added when the default search is not detected and then appended to the search query when using a search page that isn’t the ‘default’ search.

    Thought I’d add this for anyone else who’s having a similar issue and needs a workaround. I will update once Estatik respond in case there’s another setting that can be change without having to resort to this.

    Thread Starter Tim Sutherland

    (@681admin)

    Turns out just simply adding the ‘estatik search results page’ even if you don’t use it for search results is enough here. Hopefully someone else doesn’t fall into the same trap when setting up the plugin in the future. I’d suggest it’s automatically created if it’s required for basic functionality.

    All good now.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.