Skip Navigation

[Resolved] Displaying many related items and assigning individual characteristics

This support ticket is created 5 years, 8 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Karachi (GMT+05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Waqar 5 years, 8 months ago.

Assisted by: Waqar.

Author
Posts
#1227708
screen9.png

Hi, I am trying to set up a weekly dynamic restaurant menu. The WEEK's MENU has a date, an intro text and Mon, Tue, Wed etc.. Therefore I created the post type "weeksmenu". Ideally I want to allow the backend user to populate each day of the "weeksmenu" post type with items from my other post type "dishes" (each dish consists of 3 fields: title, description).

I set up a many-to-many relationship and I can select menu items in the weeksmenu and they are showing nicely in the frontend thanks to a content template and a view. However I don´t have a solution that allows the user to assign a price for each set of 2 dishes of a day (each day, Mon-Sun, has always two menu options).

Can you lead me in the right direction what to do ?

#1228325

Hi Markus,

Thanks for asking! I'd be happy to help.

Based on what you've shared, I'll recommend adding a new post type "Menu Items". This new post type will actually hold the information about the dish (single or set of dishes from the "dishes" post type) and the price of that item.

Once you've added this new post type, you'll need some new post-relationships:

1. A many-to-many relationship between the "Menu Items" and "Dishes"
2. A many-to-many relationship between the "weeksmenu" and "Menu Items".

Next, you can add a new custom field group for the post type "Menu Items" and add a number type field "Menu Item Price", to store price of that item.

The benefits of this approach would be that for each "weeksmenu" entry, you'll be able to show multiple menu item entries with price, which can be for a single dish or a group/set of dishes and you'll not be restricted to show just two menu items/entries.

In your view for the "weeksmenu" you can show all related "Menu items", through a nested view.

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar