Skip Navigation

[Resolved] Add time schedule custom fields to the relationship of two Post Types

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

Last updated by Minesh 2 years ago.

Assisted by: Minesh.

Author
Posts
#2516755

We have created 2 Post Types , 'Store' and 'Employee'.
Each 'Employee' works at one of the 'Shops'.
At the Content Template of each 'Shop' we need to displaythe related "Employees".
So we created a relationship among them and we display a View with the related "Employees". This works fine!

What we also need, is to display a 'View' with the working now 'Employees' of each 'Shop'. So the 'Store' Content Template should display the 'Employees' who currently work at the specific 'Store' (Working Now) as well as the next days schedule with the 'Employees' shifts.
So, ideally, we need the ability to create a time schedule of each 'Employee' - with time from-to- in relation with the 'Shop' he works for. We added 2 custom fields (Field type: date) to the Relationship but it doesnt really work. I guess we would need something like a 'Repeatable Group' which contains the from-to dates, in order to show the working shift of each 'Employee' to the according 'Shop'.

How would you suggest we develop it?

Thank you in advance

#2519245

please, can somebody review my request? Thank you

#2519419

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

The solution would be based on the what kind of post relationship you created.

Yes - repeatable field group would be the possibility and another possibility will be many-to-many post relationship between your post types 'Store' and 'Employee'. (I assume "shop" will be added as single post of post type "store").

When you create many-to-many post relationship it will allow you to add custom fields to intermediary post type. But if you already created post relationship and if the repeating field group serve your purpose then I suggest you should go with that one.

If you want to play with it then we offer a free test platform http://www.discover-wp.com where we offer reference sites build on top using Toolset: https://discover-wp.com/site-templates/

Here is how many-to-many post relationship works:
- https://toolset.com/course-lesson/many-to-many-post-relationships/

Here is the doc about repeating field group:
- https://toolset.com/course-lesson/creating-and-displaying-repeatable-field-groups/