Skip Navigation

[Resolved] Creating repeat/multiple connections to the same items

This support ticket is created 6 years, 7 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/Hong_Kong (GMT+08:00)

This topic contains 3 replies, has 2 voices.

Last updated by Luo Yang 6 years, 7 months ago.

Assisted by: Luo Yang.

Author
Posts
#913679

Hi there,

This is what I am trying to do:

I am trying to create a place where people can create multiple menus for a restaurant, using a pre-determined set of food items.
So I have 2 content types:
- Food item
- Menu

I have created a many-to-many relationship between these content types, so that the food items can be reused on multiple menus.

This Food-Menu relationship has a "Price" field, so that they can set different prices for the items depending on the menu it's added to.

All of the above works great.

The issue I have now, is that the restaurant needs the ability to offer the same item, but in multiple sizes (e.g. Small, Medium or Large Coffee).

Of course the simplest solution to this is to create multiple food items, e.g. Coffee (Small), Coffee (Medium) and Coffee (Large), but I would rather have just a single item (i.e. "Coffee"), and then have another field on the relationship where they can optionally define the size.

I've added such a drop-down field, and again that works great. The problem is though, that once I have referenced Coffee once, I can no longer add it again (it disappears from the list of options because a relationship has been created).

So, is there a setting anywhere that will allow me to repeatedly establish a relationship between these items? (i.e. to connect the "Coffee" food item multiple times, each time with a different size and price?)

Thanks,

Alex

#913829

Dear Alex,

Please check these:
Dashboard-> Toolset-> Relationships
Edit the the relationship between "Food item" and "Menu"
Make sure the option "Limits" value is "No limit" to both post types

#914651
Edit_Menu_items_-_Relationships_‹_Menus_TW_—_WordPress.jpg

Thanks Luo Yang, but my site is already set to "Default: No limit".

I think the purpose of "No limit" is actually about how many relationships you can create between 2 types of items, not how many times you can create a relationship between the same 2 items.

Again to reiterate, I'm wondering if there is a way to connect 1 Food item (e.g. "Coffee") with the same Menu item (e.g. "Starbucks menu"), multiple times but with different prices or other options chosen from the fields attached to the intermediary post type of "Food - Menu Relationship".

Thanks,

Alex

#915102

You are right, in the same many-to-many relationship, you can setup only one relationship between Food item ("Coffee") with the same Menu item ("Starbucks menu"), and it is expected result that :
that once I have referenced Coffee once, I can no longer add it again

In your case, you might consider to setup multiple many-to-many relationships between post type "Food" and "Menu". for example:
- size A
- size B
- size C
...

Then you will be able to setup the relationship multiple times