Skip to content
Docs
Get RestroPress

Restropress Menu Cart

Updated 3 min read
On this page

Menu Cart adds a cart link to your site's navigation menu. The link shows the number of items in the cart, the cart total, or both, with a cart icon you choose, and it links to the checkout page. It is meant for sites where the customer should be able to reach the cart from the header on any page.

Requirements#

  • RestroPress, active.
  • A theme menu that is rendered with wp_nav_menu() (for example a Primary menu). The cart item is appended to the menu output, so there must be a menu to append to. The readme says to create one under Appearance › Menus and assign it to the primary location if you have none.
  • Version 1.0.3 is documented here. The readme lists WordPress 5.4 or later and "Tested up to: 7.1".

Installation#

  1. Go to Plugins › Add New › Upload Plugin, choose the ZIP and select Install Now.
  2. Select Activate.

The code contains no licence field and no update checker. The readme FAQ mentions a free licence key from the RestroPress store, but there is no place in the plugin to enter one.

Settings#

Go to RestroPress › Settings › General › Menu Cart. The section is headed "Menu Cart Setting".

SettingWhat it doesDefault
Enable Menu CartMaster switch. When off, nothing is added to the menu and the AJAX endpoint is not registered. Option key enable_menu_cart.Off
Always Display CartWhen ticked, the cart link stays visible even when the cart is empty. When off, the cart link is hidden while the cart has no items. Option key always_display_cart.Off
Choose a Cart Icon.Radio choice of five icons: icon 1 to icon 5. Option key display_icon.None selected
What would you like to display in the menu?Items Only, Price Only, or Both Items and Price. Option key display_menu.None selected

Choose an icon and a display option after enabling the cart, and save. Both radio groups start unselected.

The Menu Cart section of RestroPress general settings

How it works#

  1. When enabled, the extension appends a list item with class menu_cart_heading to the output of every navigation menu on the site, containing the chosen icon and a cart summary.
  2. Every second, a script on every page calls the admin AJAX action restropress_menu_cart_get_cart_details, which returns the item count, the cart total, the currency symbol and the checkout URL.
  3. The script writes a link to the checkout page into the menu item: "N Items", the currency and total, or "N Items" followed by the currency and total, depending on the display setting.
  4. If Always Display Cart is off and the count is 0, the menu item is hidden; it appears when the first item is added.
The cart link with icon, item count and total in the site header menu

There is nothing for the restaurant to see in the admin beyond the settings.

Troubleshooting#

  • Nothing appears. Check that Enable Menu Cart is saved and that your header is built with a WordPress navigation menu. Page builders with their own header or block themes that do not call wp_nav_menu() will not show it.
  • The cart appears in more than one menu. The item is added to every menu rendered through wp_nav_menu(), such as header and footer menus.
  • Empty cart link, no icon, or "Error loading icon" in the page source. The icon file is fetched by the server with an HTTP request to the plugin's own URL each time the menu is rendered. This fails when the site blocks requests to itself (loopback), sits behind a password or maintenance screen, or has a bad SSL setup. Also make sure an icon is selected.
  • PHP notices about display_icon or display_menu. Save the settings once with an icon and a display option chosen.
  • Cart text is out of date or the site makes many requests. The summary refreshes by polling every second. Busy sites should be aware of this polling load.
  • The word "Items" in the link is fixed English text in the script and is not translatable.

Changelog highlights#

  • 1.0.3: fixed compatibility with the latest RestroPress.
  • 1.0.2.5: currency sign integrated.
  • 1.0.2.4: shows cart total price instead of subtotal.
Was this page helpful?