Home › Toolset Professional Support › [Resolved] Creating a shortlist system for members similar to airbnb – favorite system
Problem:
Creating a shortlist system for members similar to airbnb - build a add to favorite post using Toolset
Solution:
You can find the proposed solution in this case with the following reply:
https://toolset.com/forums/topic/creating-a-shortlist-system-for-members-similar-to-airbnb/page/2/#post-1342931
Relevant Documentation:
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)
Tagged: Views plugin
This topic contains 32 replies, has 2 voices.
Last updated by Minesh 5 years, 1 month ago.
Assisted by: Minesh.
For our casting &B location databases I am trying to create a shortlist system simliar to airbnb: our users (for example a director) should log in to the website, then see the location database and select their favourties.Ideally, they have the option to tag an entry with 3 levels of priority. Once they have selected all their favourites, they should be able to send the selected entries to their personal shortlists. The shortlists can be defined and deleted by only the current user and are only viewable by themselves.
Here's the single steps (I need help from step 3 on)
1. login to website as a user
2. browse the database of locations
3a. in the grid overview, mark entries as favourites (ideally choose from 3 levels: prio1, 2 and 3) ---
3b. or click on the entry, and in the details single page view, mark the entry as favourite (ideally choose from 3 levels: prio1,2 and 3)
4. when finished browsing, click on a 'add to shortlist' button on the main page or from the mainmenu
5. on the 'my account' page, see all my personal shortlists, choose from a shortlist, or create a new one
6. all selected items are added to the selected shortlist
7. on the my account page all personal shortlists show up, can be deleted and new ones added
Looking forward to your thoughts, thank you very much!
Tobi
So I was able to install the favorites plugin and do a simple test:
hidden link
login at the top with:
user: toolset
pass: bl(bOL#n2$cJ)b%JMeP!CG12
Check out this page:
hidden link
Now my problem:
- each user should be able to create several 'lists' in the admin area to save different 'favourites' in different 'lists' (see aitbnb attachment)
How could I achieve this?
Thx
Tobi
Ok - in that case, the list should be defined as a new post type.
But I've a question, when we set the post as favorite how to determine to which list you want to add the post which you mark as favorite?
Ideally:
- the user picks several favourites from the grid list or the single page entry
- then user clicks on a button 'add to shortlist' on the main menu or on the main page
- this opens a page or whatever where the user can pick from previously user-defined lists
- when he clicks on a list, the selected favourites are added to that list
Does this make sense?
Thx a lot for your help!
Tobi
I understand what you need but there is no such feature available with Toolset. Your requirement is a custom 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/
Basically, if you want to build such a feature with Toolset:
=> you need a new post type "shortlist" and "favorites"
- https://toolset.com/documentation/user-guides/create-a-custom-post-type/
=> you can connect each entry where you should create a one-to-many post-relationship between post type "shortlist" and "favorites"
- https://toolset.com/documentation/post-relationships/how-to-set-up-post-relationships-using-toolset/
=> Then, you should create a Toolset form to mark post as the favorite:
- https://toolset.com/forums/topic/favorite-posts-by-logged-in-user-add-to-remove-not-working-properly/
[this is a related ticket that may help you]
But once you mark the post as favorite, at this moment we need to assign the posts marked as favorite to selected list of "shortlist" and I do not have any way to offer where we can identify what posts were marked as favorite recently by user so we can assign those to selected list of "shortlist".
This is pure custom programming need and I suggest you to contact our certified partners for such custom programming need:
=> https://toolset.com/contractors/
I recommend you rather get help from the "favorites" plugin support team as they will be able to guide you more and you will have to add less custom programming as "favorites" plugin already there to mark posts as favorites but you need to check with them how you can assing the selected favorites posts to specific list.
Thank you very much for the detailed answer, if I could solve it just with toolset, I think this might be more flexible in the future? I have recently solved something that might be related with Nigel from your support, see this link:
https://toolset.com/forums/topic/adoption-sponsoring-system-for-charity-website/
Do you think with this method, the shortlist problem could be solved too?
Thanks for your help! Greatly appreciated.
Tobi
if I could solve it just with toolset, I think this might be more flexible in the future?
==> Yes, it may give you more control as it will be a newly added feature to your site build on top with Toolset but it will require lot of efforts.
The problem with your requirement is not marking posts as favorites but how to connect those posts that is marked as a favorite to selected shortlist because at that time we will not have post ids which marked as favorites or we can not track which posts currently marketed as favorites and what posts already marked having said that we can not differentiate the newly posts marked as favorites and older posts which is already marked as favorites by current user.
You need to find this solution. Maybe what if you add a dropdown select at top of list where the user should select the list to which they want to assign the favorite item and then once they chose the list option from the dropdown, they should start to mark post as favorite.
Ou wow, Minesh. That is a great and simple idea!
Just so I understand correctly, you are saying, the following workflow would be possible with only toolset?
- user defines/creates several ‘lists’ on his ‘my account’ page
- user goes to locations page and pre-selects one of these previously defined lists from a dropdown menu on the main locations page
- user starts browsing locations and selects favourites from the grid overview and/or details page
- the selected favourites are automatically added to the user-selected list in the dropdoen menu
- user can change the list in the dropdown menu to change the list, all previiously selected favourites are cleared from the current selection (but not from the previuos list) and from them on his favourites are added to this list instead
- user can go to my account page at a later time and click on the several predefined lists to see his favourites per list
If I understood correctly and this is possible, please let me know how you would go about it? More or less like you described above? What would I have to change? Thanks for your precise steps, I am not a programmer 🙂 This sounds great and I would be very happy to make it work like that 🙂
Thanks again!
Tobi
So I've setup everything as you suggested above, and it starts coming together 🙂 but I am struggling to get the details to work:
1. the 'favourite' feature does not seem to create any entries in 'Favourites' at the moment, just the front end javascript seems to react (and also only in the single view)
2. in the grid overview the javascript 'add to favourites' reacts always to all the items in the grid
3. where and how should I now add a dropdown list from where the user can select the shortlist, to which he wants to add his favourites?
4. and once that works, how do I add the favourited location to the selected shortlist in the dropdown list?
Thanks so much for your support.
Tobi
Actually, I cannot provide the solultion for you but I can describe the way of implementing it.
Because any favouriting mechanism (if you consider to built with Toolset) involves using a form to create a child "favourite" post which records which post is being favourited and the user doing it (the post author). And there is no way for such a form to know what the value of some select field displayed (but not saved) on the parent post is, unless you can think of some way to customise the link to the form to create a child post so that as well as passing the parent ID it also passes the list ID (the shortlist being another post type) as I described to create listing post type.
I guess that could work actually, with favourites children of the original post type and a list post type, and you manually create the child post form links so that it includes as URL parameters the IDs of both.
=> https://toolset.com/documentation/post-relationships/how-to-create-custom-searches-and-relationships-for-users/
So if you had a list select field shown on the main post page which had the ID of the list posts as values, you could add JS with an onchange event listener to that dropdown so that it updated the href of the link to the child form to update the ID if the list was changed or you can use forms hook or any alternate method to grab the selected listing IDs.
=> https://toolset.com/documentation/programmer-reference/cred-api/
The form to create the child post would just need to include both parent fields, the posts being favourited and the list.
Later, you can list the shotlist posts whose author is the current author:
=> https://toolset.com/documentation/post-relationships/how-to-create-custom-searches-and-relationships-for-users/
Hey Minesh. Thanks for all the Tipps. I have tried to follow your steps, but I am struggling with the on eventhandler of the Dropdown menu. Could you have a look and let me know what I should be doing next? Or could you send me to the best link where I can learn how to create a Js listener that gets the variable from a toolset select field and send the url param ?
Or even better a step by step guide would be greatly appreciated. I am sure that many people would benefit from. Shortlist/Favourite solution in toolset 🙂 thank you!
Can you please share problem URL and access details so I can check where you added the drop-down?
Do you mean that you want to create a drop-down selection for the following post type on the page you shared:
=> hidden link
Nope, sorry. I would like to create the ability for a user to be able to browse the post type 'locations', select the post type 'shortlists' from a dropdown menu and then mark some of the post type 'locations' as 'favourites'. These 'favourites' should then be saved in the selected shortlist (in the dropdown menu). - a favourite/shortlist system like the ones in airbnb.
So from your notes I understood the following:
- create a post type called 'shortlists'
- create a post type called 'favourites' as a child of post type 'locations'
- create a dropdown select field on the main page hidden link that shows all entries of the post type 'shortlists' created by the current user
- with javascript onchange listener take the selected shortlist-id from the dropdown menu and put it in the url string for later use
-- this is where I am stuck right now --
does this help? did I missunderstand something?
Ok - I've created the following test page:
=> hidden link
Where I've created the shortlist dropdown select using the following view:
=> hidden link
Now, I would like to know, have you added any select change event to your project as when I try to select the option from the dropdown select it automatically fires the change event.