Support › MB Relationships › Using MB to create a restaurant menu builderResolved
Hi Anh - i need to create a menu builder but i'm struggling with using Relationships. hoping you can help...
Client website contains a dedicated page for each location. Location specific menu is displayed on each page. I want to centralize the food menu builder to avoid manually recreating an entire menu for each location. The business is growing and adds new locations several times per year.
I have 2 questions here:
Taxonomies for the Menu CPT are:
Taxonomies for Locations are:
I can't figure how to handle variable prices and then allow for location specific unique items.
All locations in Florida have Hamburgers. All are priced at $5.00 each. But in Texas, one store wants to charge $5.50 each for the same burger.
If I use normal CPT and custom template method to display burger for both Florida and Texas locations, how can I update the price for only one location without making a problem for the other locations?
Any suggestions are appreciated!!!!
This is an interesting case.
I think you probably don't need a CPT for Menu. Since each location has a specific menu, a CPT Menu probably serves nothing.
If I do this, I probably will set CPTs this way:
postfield (for selecting menu items from the list)
textfield (if that location has a different price for that menu item)
If some locations have unique menu items, they should be added as a new posts under Menu items first. Then users can select from the list when edit a Location.
Thought I would get back to you and explain how we are doing this - in case it can be helpful to others...
In this case, all Store locations follow a Core Menu, but then some of the locations have items unique to their location. In addition, there can be situations where multiple Store locations may charge a different price for the same Menu Item. This makes sense for us because we are dealing with 40+ locations across 8 US states. Below is a description of how we built a 'Food Menu Builder' for this project that handles all of our requirements.
We set up a total of 3 CPTs and then added code to relate them to each other. the CPTs are:
We also used these Taxonomies for the CPTs:
*Outlier = Menu Item that is not a part of any established Menu Type but still appears as an option on some Store location menus. Example - 3 locations have a regional item on their menu but the item is not part of the company's Core Menu or Catering Menu. These items appear on some menus but not all.
We enter a Menu Item Title, Menu Item Description, and Menu Item Price for each entry. Then we add any applicable Taxonomies (Menu Section, Gluten Free, etc). Then we assign the Menu Item to the applicable Menu Type (Core Menu, Specialty Menu, etc). If the Menu Item is an Outlier - then we classify it as such.
We have *Core Menu, Catering Menu, and Specialty Menu categories set up. Each Menu Item is assigned to all applicable Menu Types upon entry. This is how specific Menu Types are built out.
*Once the Core Menu is created, it is automatically assigned to all current and future locations.
The input screen for the Store CPT captures basic info about the individual location, but we also added custom code so that the Core Menu is displayed on the Store location input page.
The Menu Item Title and Menu Item Descriptions are displayed but cannot be edited here. But, the Menu Item Price - which was initially set when creating the Menu Item - can be edited from the Store location input page. This gives us the ability to start with default menu information for each Store, but then change the price on a 'per store' basis as needed.
Also displayed on each Store location input page is a list of Menu Items classified as Outliers. We can choose any items from the Outlier list and these will appear on the specific location menu, but not on menus for other locations.
We used Beaver Themer for the Store location display template. We created our own shortcode to display all of the MB fields (because by default the MB integration with Themer cannot handle grouped fields or fields within a Tab).
Hope its OK to post this. Let me know if you have any questions!
@Neil: Thanks a lot for your post! I think other people will find this useful, too!