Skip Navigation

[Resolved] How can I pass post_ids for pagination?

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 12 replies, has 3 voices.

Last updated by Minesh 2 months ago.

Assisted by: Minesh.

Author
Posts
#2769349

I am trying to ajax paginate to the next page but my initial filtered posts got reset when I click on next page. I need my link to be hidden.

So on load I got all the post listed out. After I entered an address it returned a list of filtered post based on the selected address. In my frontend I did a console.log to log the filtered post ids. After I click the next page my filtered list of post got reset.

#2769355

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Can you please share problem URL and exact steps I will have to follow with what address search string I should use and send me admin access details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2769976

I have changed the pw as the post here is not secure.

#2771052

Any support will be appreciate

#2774284

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I checked the staging site you shared but as soon as I enter the zipcode you shared 522663 and
click on the suggested item, the ajax spinner keep spinning and I on the browser's console that many requests are blocked and I also see few JS errors as well.

For example:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at
hidden link

Can you please fix all those and set required permissions so that the page should work as expected.

#2774376

Hi, I have fixed the issue. Please continue with your checks. Please also assist in this https://toolset.com/forums/topic/how-to-overwrite-toolset-sort-setting/ as I test the code you provided and is still not sorting by nearest distance. Thanks.

#2774456

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

When I checked the view you are using:
- hidden link

I see the distance search is implemented using custom way using much custom JS code.

Here is the Doc that shows how you should normally implement the distance search:
=> https://toolset.com/documentation/legacy-features/maps-plugin/filtering-and-ordering-map-markers-by-distance/

In this case AJAX pagination will not work as it will require distance search to be implemented as per Toolset standard. So, you are advise to implement the distance search as per the Toolset standard.

#2776831

Hi Minesh,

Thanks for the reply, notice the documentation is a legacy feature. Can check is the distance filter still available in my current toolset or it is deprecated?

#2776914

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - as you can see with your view:
- hidden link

You are using the legacy view and I do not see you added the distance filter normal way as it should how it should be added with legacy views:
- https://toolset.com/documentation/legacy-features/maps-plugin/filtering-and-ordering-map-markers-by-distance/

Here is the Doc about implementing the Map distance filter using the Block view:
- https://toolset.com/course-lesson/filtering-and-ordering-map-markers-by-distance/

#2776952

Hi Minesh, you mean even though I am using a third party map instead of toolset map?

#2777381

Mateus Getulio
Supporter

Languages: English (English )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi Nicholas,

Minesh is not available today, so I will take over the ticket temporarily.

Thanks for the clarification.

Even though you're using a third-party map, since the filters are being applied within the View itself, using the regular Toolset distance filter should still work as expected. I recommend testing the standard Toolset distance filter to see if it resolves the issue, as it is designed to handle distance-based filtering efficiently within the View setup.

Please give that a try and let us know how it goes. If you run into any issues, feel free to reach out, and we can assist further.

Best regards,
Mateus

#2778106

Hi Mateus, manage to figure out the sorting by using view_arg, is there any way for the pagination?

#2778117

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

As shared with my previous reply:
- https://toolset.com/forums/topic/how-can-i-pass-post_ids-for-pagination/#post-2776914

You are using custom code to filter your view with distance search and its not the normal configuration how distance search works with Toolset:
- https://toolset.com/course-lesson/filtering-and-ordering-map-markers-by-distance/

Pagination works with "wpv_paged" URL param when if you try to hook in that and check if that helps.

For any such custom programming requirement, you can always get in touch with any of our certified partners: https://toolset.com/contractors/