Skip to content
Docs
Get RestroPress

Block storefront

Updated 6 min read
On this page

RestroPress 3.5 adds five blocks that you combine to build your own online ordering page in the block editor: a service bar, menu category navigation, menu search, a grid or list of menu items, and a live cart panel. A ready-made pattern puts them together in one click. They are for owners and designers who want to lay out the ordering page themselves. They are optional. Your existing [fooditems] menu page, the Menu block and your template pack keep working exactly as before.

Turn it on#

There is no setting to switch on. The blocks are always registered. A page uses them when you add them to it, so nothing changes on your site until you build a page with them. The blocks need WordPress 6.5 or later, because they use the WordPress Interactivity API. On older WordPress the Menu Items block shows the classic [fooditems] menu in its place, and the other four blocks show nothing, so you do not get duplicates.

Set it up#

Use the ready-made pattern#

  1. Go to Pages › Add New (or edit the page you want to use for ordering).
  2. In the block editor click +, open the Patterns tab and choose the RestroPress category.
  3. Click RestroPress Storefront.
  4. Publish the page.

The pattern is a wide group with the service bar and the category navigation on top, then two columns: menu search and the menu items on the left (two thirds) and the cart panel on the right (one third). On a phone the columns stack and the cart panel sits below the menu.

A page built from the RestroPress Storefront pattern, with service bar, categories, search, items and cart

Block themes: the page template#

If you use a block (full site editing) theme and WordPress 6.7 or later, there is also a page template called RestroPress Storefront. Choose it in the page's Template picker. It adds your theme's header and footer, the page title and the same pattern. It is never applied on its own.

Use it as your menu page#

To make this page the one customers land on, select it under RestroPress › Settings › General › Store Setup › Menu Items Page. The page gets the storefront styles and the item popup scripts as soon as it contains any of the blocks, the pattern or the template.

Or place the blocks one by one#

Click + and look under the RestroPress block category. Use only the blocks you need and arrange them in any layout. The category navigation, search and cart panel all work with the Menu Items block on the same page. Each block lets you set alignment (wide or full), margin and padding in the block sidebar.

The blocks#

BlockWhat it showsOptions in the block sidebar
Service BarThe delivery or pickup choice, with the order date and time. It is the same bar the classic menu uses, so the date and time popup and your service choice behave as before.None.
Menu CategoriesLinks to the menu's category sections. A sticky bar that highlights the section in view.Show only these categories, Exclude these categories, Orientation (Horizontal bar or Vertical list), Sticky while scrolling, Filter instead of scroll.
Menu SearchA search box that filters the menu items on the page as you type, hiding items that do not match and categories left empty.Placeholder.
Menu ItemsYour menu items grouped by category, as a grid or a list. The Add button opens the usual item popup for sizes, add-ons and special instructions.Show only these categories, Exclude these categories, Layout (Grid or List), Columns (1 to 4, for the grid), Order items by (Name, Newest or Menu order), Direction, and Image, Description and Price switches under Card.
Cart PanelA mini cart with each item's options, quantity buttons, the subtotal, fees, tax and total, and a checkout button. It updates as items are added.Title (empty means "Your Order"), Sticky while scrolling (desktop).

The category pickers take names, IDs or slugs, the same as the category and category_exclude options of [fooditems]. Defaults: the category bar is horizontal and sticky and jumps to a section; the grid has 2 columns and shows image, description and price; items are sorted by name, ascending; the cart panel is sticky.

How it works#

What customers see#

  • Categories. With the default setting, clicking a category scrolls to that section and the current section stays highlighted as the customer scrolls. With Filter instead of scroll on, an All link is added and clicking a category shows only that category's items.
  • Search. Matches the item name only, ignoring capital letters and accents. If nothing matches, a message says no menu items match the search. Escape clears the box.
  • Menu items. Each card shows the name, the short description (not the full description), the price and the photo. Variable items show a price range. Prices follow your tax display settings. Items marked sold out show as unavailable.
  • Cart. Customers change quantities with the plus and minus buttons, and see the fees and tax. When the store is closed for the chosen service, the panel shows the closed message and the checkout button is disabled. The checkout button runs the same checks as the classic cart, for example asking for a date and time if none is chosen, and then goes to your checkout page.

What staff see in the editor#

Each block shows a preview of the real menu in the editor, with its options in the sidebar. The preview is read-only.

Good to know#

  • Short descriptions only. The item cards show the short description. Items with no short description show no text.
  • Dietary labels and allergen badges are not shown on these cards. The classic menu and the Menu block show them.
  • Search and categories work on this page only. They filter the item grid on the same page.
  • Legacy Ordering Flow. If Legacy Ordering Flow is on under Settings, the Service Bar block shows only the date and time part, not the delivery and pickup tabs.
  • Menu structured data. The Google menu data (see Menu QR codes and menu structured data) is added to the Menu Items Page and to pages with the Menu block or [fooditems]. A page that only uses these new blocks gets it when it is your Menu Items Page.
  • Menu block or storefront blocks. The Menu block is one block with its own switches for the category list, service bar, search and cart. The storefront blocks split those into separate pieces you can place yourself. Do not put both on the same page.

For developers#

NameTypePurpose
rpress_block_storefront_supportedfilterWhether the Interactivity API is available. Return false to force the classic fallback.
rpress_block_storefront_price_textfilterFilters the price text on an item card. Receives the text, the item ID and the price.
rpress_block_storefront_cart_statefilterFilters the cart data (lines, totals, labels) sent to the cart panel.
rpress_block_storefront_empty_cart_textfilterFilters the empty cart message.
rpress_storefront_cartAJAX actionRead-only cart and store state used to refresh the cart panel.
rpress_block_storefront_in_post()functionWhether a post uses any storefront block, the pattern or the page template.
rpress_block_storefront_cart_state()functionBuilds the cart state array.
rpress_block_storefront_store_state()functionReturns whether the store is open for the current service, and the closed message.
rpress_block_storefront_blocks()functionLists the five block names.

The block names are rpress/service-bar, rpress/category-nav, rpress/menu-search, rpress/item-grid and rpress/cart-panel. The pattern is restropress/storefront and the template is restropress//rpress-storefront. The blocks share one Interactivity API store named restropress, loaded as the script module @restropress/storefront. The cart panel also reuses the existing filters rpress_cart_title and rpress_cart_sidebar_render_fee, and the category and item queries reuse time_based_menu_rpress_foods and rpress_fooditems_query.

Was this page helpful?