Custom Fields
Support MB Relationships Using MB to create a restaurant menu builder

  • Creator
  • #14819
    Resolved @mindspark

    Hi Anh - i need to create a menu builder but i'm struggling with using Relationships. hoping you can help...


    • 1 core menu
    • some locations have unique menu items
    • some locations have different prices for the same item
    • 40 locations across several US states


    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:

    1. How to use CPT and custom template to display general price for an item, but then allow for price changes on specific location menus?
    2. I want to create Menus by adding Menu Items. In my mind, I would create CPT for Individual Menu Items. Menu items are assigned to Menu Categories (Appetizers, Soup, Salad, etc), and once all items are entered, a menu is created for a specific location.

    CPTs are:

    • Menu (designated for a location)
    • Menu Items (used to create a specific menu)
    • Locations

    Taxonomies for the Menu CPT are:

    • Menu Category (Appetizers, Salad, Soup, etc)
    • Allergens (Gluten Free, Vegetarian, etc)

    Taxonomies for Locations are:

    • State

    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!!!!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
  • #14824
    Anh Tran

    Hi Neil,

    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:

    • Menu items: each menu item has a default price
    • Locations: each location will has a cloneable group of menu items, like this:
      • Menu item: a post field (for selecting menu items from the list)
      • Custom price: a text field (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:

    • Menu Items => Sections of a typical menu (one-way relationship to Menus + Stores)
    • Menu Types => Core Menu or Specialty Menu (one-way relationship to Stores)
    • Stores => Individual restaurant store locations

    We also used these Taxonomies for the CPTs:

    • Menu Items => Health/Allergens (Gluten Free, Vegetarian, etc)
    • Menu Items => Menu Section (Appetizers, Soups, Salads, etc)
    • Menu Items => Menu Type (Core Menu, Catering Menu, *Outlier)

    *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.

    • Stores => State Location (this helps when filtering locations by state and also geotargeting the closest location to user IP address)
      Creating Menu Items:

    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.

      Creating Menu Types:

    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.

      Creating Store 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!

    Anh Tran

    @Neil: Thanks a lot for your post! I think other people will find this useful, too!

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.