Skip Navigation

[Resolved] Best approach to creating user "favorite" posts

This support ticket is created 4 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

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 1 reply, has 2 voices.

Last updated by Minesh 4 years, 6 months ago.

Assisted by: Minesh.

Author
Posts
#1627293

Tell us what you are trying to do?
I need to implement a "favorites" function for a real estate site, where a registered user can add or remove a homes from their own "favorites" list.

Is there any documentation that you are following?
I've seen a few threads about similar topics, but all were rather old and I'm wondering which approach would work best for me. I'm currently using a plug-in, but it is a bit cumbersome to work with, and does not integrate well with Views. I would prefer a method that does not require a page refresh after adding or removing a favorite.

Here are threads to similar questions that I have referenced:
https://toolset.com/forums/topic/favorites-view-conditional-button-on-post-add-to-remove-from-favorite-list/
https://toolset.com/forums/topic/add-post-to-a-favorite-list/

Which approach is most efficient, adding a repeating field to the "Homes" post type to store User IDs, or creating an intermediate post type?

I think that many people would find this type of functionality useful. Would you consider creating a tutorial on the Toolset site for others to follow?

Is there a similar example that we can see?
The current site (which uses a plugin) works, but I have limited options on how the user favorites are displayed on the front end (on the "My Favorites" page)

What is the link to your site?
hidden link

#1628417

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

As you already know that there is no such feature available with Toolset. Your requirement is a customs requirement and as per our support policy, it may need custom programming which is beyond the scope of our support policy.
=> https://toolset.com/toolset-support-policy/

Howerver, what if you create a another post type "Favorite Posts" and create a one-to-many relationship between your post type and this "Favorite Posts". After that use the Toolset form to create favorites/unfavorite and use post-relationshp API using Toolset form's hook cred_save_data to connect the post so that favorite relationship will be established between your post type and "Favorite Posts".

Please check the following related ticket that might help you:
=> https://toolset.com/forums/topic/creating-a-shortlist-system-for-members-similar-to-airbnb/page/2/#post-1342931
Or
You can even follow the step by step guidance shared by Nigel here:
=> https://toolset.com/forums/topic/add-post-to-a-favorite-list/#post-459894