Skip to content
Docs
Get RestroPress

RestroPress - Multilocation

Updated 7 min read
On this page

RestroPress Multilocation lets one restaurant business run several branches from a single site. You define each branch as a location, draw its delivery area on a Google map, and assign menu items to the branches that sell them. Customers choose a branch (for pickup) or enter an address and are matched to a branch whose area covers it (for delivery). The branch is saved with the order, shown in the orders list and receipt, and branch managers can be limited to their own branch's orders.

Requirements#

  • RestroPress (free plugin) active. If it is not active, the extension shows an admin notice and deactivates itself.
  • A Google Maps API key with the Maps JavaScript and Places libraries enabled (the extension loads the places and geometry libraries). The key is needed to draw delivery areas and to match delivery addresses.
  • Optional: RestroPress - Delivery Fee. When it is active, Multilocation uses its branch hooks and can share its Google Maps key.
  • Optional: RestroPress - Store Timing & Delivery Cutoff, for per-branch opening times.
  • Tested up to WordPress 7.1 according to the readme.

Installation#

  1. Go to Plugins › Add New › Upload Plugin, choose the ZIP file and select Install Now.
  2. Select Activate Plugin.
  3. Open RestroPress › Settings › General › Multilocation and enter your Google Maps API key.

The plugin has no licence field and no update code of its own, so there is nothing to enter under RestroPress › Settings › Licenses.

Settings#

Settings are in RestroPress › Settings › General › Multilocation.

The Multilocation settings section
SettingWhat it doesDefault
Google Map ApiYour Google Maps API key. Used on the location edit screen (map and search box) and on the storefront (address autocomplete and delivery-area matching). If this field is empty and RestroPress - Delivery Fee has a key saved, that key is used instead.Empty
Default LocationA drop-down of your locations, labelled "Choose a default location". Used to pre-fill the delivery address field with that branch's name when the customer has not chosen a branch yet. If no locations exist, the setting shows "Location not available."None

Adding branches#

  1. Go to Menu Items › Locations and add a location. The name is what customers see.
  2. Edit the location. The edit screen has read-only fields (Address, Place ID, Lat/Lng, Lat/Lng String, Encoded Path) that are filled by the map, plus a "Search branch address" box.
  3. Search for the branch address and choose a suggestion. Then use Draw area, click the map to add boundary points (at least three), and select Finish area. Undo point removes the last point and Remove area deletes the drawn area.
  4. Update the location to save. The page notes "Required: Enter the base location of the branch and draw an area on the map where this branch will be delivering to."
The location edit screen with the delivery area map

Assigning menu items#

Edit a menu item and tick its branch in the Locations box on the right. A menu item can belong to several locations.

Branch managers#

On a user's profile, the "Restropress Multilocation" section has a "Manager of Location" drop-down. A user with the Shop Manager role (and not Administrator) who has a location chosen sees only the orders whose branch matches that location. The branch is saved on the user as rp_sm_branch_id and rp_sm_branch_name.

How it works#

Storefront#

  1. In the delivery and pickup service options (and in the date/time pop-up), the extension adds a branch selector after the service time.
  2. Pickup: the customer sees "Select a Location" and a list of all branches, each with its saved address, and picks one.
  3. Delivery: the customer enters an area or address in the "Choose your area" field (Google Places autocomplete). The extension tests the chosen point against each branch's drawn area and lists the branches that cover it. If none do, it shows "No restaurants delivering to this location".
  4. Selecting the branch is required. Without it the customer gets "Please select a branch!!"; a delivery without an address gets "Please enter a location!!".
  5. The choice is stored in the cookies branch, branch_name, delivery_address and store_lat_long (30 days), and in the browser's local storage so a returning customer keeps the last branch.
  6. The menu is filtered to the chosen branch: only menu items assigned to that location are listed. Items with no location are not shown once the branch filter applies.
  7. On the checkout page, the delivery branch selector is replaced by a "Change Store Branch" link, with the note that changing the branch clears the current cart and address details.

With Delivery Fee#

When RestroPress - Delivery Fee is active, the extension hands it the selected branch's coordinates so the fee is calculated from that branch, validates the address through Delivery Fee first, and empties the cart after a branch is set. Without Delivery Fee, Multilocation does its own branch and address check.

With Store Timing#

If RestroPress - Store Timing & Delivery Cutoff is active, the extension has an AJAX action, rp_multilocation_get_location_store_time, that returns the selected branch's available dates, times and closed message.

Orders and emails#

  • When the order is saved, the branch ID, delivery address and branch name are copied from the cookies into the order meta branch, delivery_address and branch_name, and the cookies are cleared.
  • The Orders list gets a "Branch" column.
  • The order preview in the admin shows a "Branch Information" box with the branch and delivery address.
  • The receipt shows "Branch" and, if present, "Delivery Address".
  • A new email tag, {branch_address} (description "Address of the branch"), is available in email templates. See the note below about what it returns.

Developer reference#

HookTypeParametersPurpose
rp_shared_google_map_api_keyfilter$resolved, $delivery_settings, $multi_location_settingsOverride the Google Maps key used by the extension.
rpress_get_multi_location_settingfilter$multi_location_settingsFilter the saved rp_multi_location option.
rpress_fooditem_location_argsfilter$argsArguments for the fooditem_location taxonomy.
rpress_fooditem_location_labelsfilter$labelsLabels for the taxonomy.
rpress_location_stringfilter$textChange the storefront strings "Choose your area", "Select a Location", "Change Store Branch" and the branch-change note.

It also hooks core actions and filters such as rpress_after_service_time, rpress_popup_service_time, rpress_fooditems_query, rpress_payment_saved, rpress_payments_table_columns, rpress_email_tags and, with Delivery Fee, rp_delivery_fee_multi_branch_before, rp_delivery_fee_multi_branch_after, rp_delivery_fee_store_position, rp_delivery_fee_branch_position and rp_postdata_store_position. Without Delivery Fee it uses rpress_check_service_slot.

Each branch's address and map data are stored in an option named taxonomy_{term_id}; the Google key and default location are in the option rp_multi_location.

Example: take the Google Maps key from a constant.

add_filter( 'rp_shared_google_map_api_key', function ( $key ) {
    return defined( 'MY_MAPS_KEY' ) ? MY_MAPS_KEY : $key;
} );

Troubleshooting#

  • The map on the location screen does not load. The status text reads "Add a Google Maps API key in RestroPress Multilocation settings to load the map." Add the key and make sure the Maps JavaScript and Places APIs are enabled for it.
  • The menu is empty. The menu is filtered by the chosen branch, so menu items must be assigned to a location. A customer with no branch chosen sees no filtered items.
  • "No restaurants delivering to this location". The address is outside every branch's drawn area, or a branch has no area drawn.
  • "Please select a branch!!" or "Please enter a location!!". The customer pressed update without choosing a branch or entering a delivery address.
  • Branch missing from an old order. Branch data is read from cookies at the moment the order is saved. Orders placed with cookies blocked or without selecting a branch have no branch.
  • Cart emptied after choosing a branch. This is intended when Delivery Fee is active, and the checkout page warns that changing branch clears the cart.
  • Branch manager sees no orders. They only see orders whose branch_name meta equals their assigned location's name.

Changelog highlights#

  • 2.0.2: tested up to WordPress 7.1; translation template updated.
  • 2.0.1: compatibility with the RestroPress schedule-summary flow; closed-branch pop-up consistency.
  • 2.0: branch selection reworked (persistent branch memory, Google geocoding and polygon matching, shared Google Maps key with Delivery Fee, checkout branch-change link).
Was this page helpful?