Tokurabo Takeout Orders: Manual

For web designers, developers, and the person who looks after the shop's website.

Everyday use for shop staff is in the guide. First setup is in Guide: 1. First Setup.

1. Requirements and How It Works with Takeout Menu

2. All Settings

The admin pages are under Takeout Menu in the admin menu, and only administrators (manage_options) can open them.

Takeout Menu > Order settings

SectionSettingNotes
Taking ordersStop taking orders / Resume taking ordersWorks when clicked (separate from Save Changes). The menu stays on the site. The "+" and Add to cart disappear, the cart shows the message instead of Checkout, and the server refuses new orders.
Message while pausedShown to customers while paused. Empty = "We are not taking online orders right now. Please try again later."
Pickup timesPreparation time0–240 minutes. Default 30.
Time slotsEvery 5, 10, 15, 20, 30 or 60 minutes. Default 15. Aligned to the clock (10:00, 10:15 ...).
Days ahead1–60 days, counting today. Default 7.
Daylight saving timeShown only if the store's time zone changes clocks within the next year. See 3.
Special daysDate / Status (Closed, Special hours) / HoursCome before the usual hours. Past days are removed when you save. If the same date appears twice, the last one is used.
CheckoutNotice to customersShown at the top of the order form. Line breaks, <strong> and <a> only.
Order emailsShop nameShown as the sender name, and in the subject and body of order emails. Empty = site title.
From email addressThe sender of order emails, and where new orders are sent. Up to 5 addresses, separated by commas (the first one is the sender). Empty = site admin email. If an address is not valid, nothing is saved. See 4.
Send test emailSends a test email to all the addresses in From email address, with the saved settings.
Order numbersPrefixLetters and numbers, up to 10. Lowercase letters become uppercase, and other characters are removed. Default TO.
Order historyKeep orders for ... days after pickup0 = keep forever (default). Up to 3650.
StylesUse the plugin stylesOn by default. Turn it off to write your own CSS for the cart and the order form. See 8.

Takeout Menu > Availability

Uncheck an item to stop taking orders for it. It shows as "Sold out" until checked again, and syncing does not change it. It works per item (not per variation or option). To stop an option, mark it sold out in Square.

3. How Pickup Times Are Calculated

  1. Store hours: the business hours from the register (Square location hours, via Takeout Menu 0.2.0 or later. Some regions or POS apps have no place to set them). If there are none, there are no store hours (the hours of other menus are not used).
  2. Pickup times: times when at least one menu is served. Menus with no hours follow the store hours. If there are no store hours either, items only in those menus are arranged by the shop (see below).
  3. Special days come first. A closed day cannot be chosen. Special hours replace the store hours for that day (menus with their own hours are limited to the overlap).
  4. Today starts from now plus the Preparation time. "ASAP" is offered when today is open. An end time is included (until 9:00 pm means 9:00 pm can be chosen). Hours past midnight continue into the next day.
  5. If an item in the cart is not served at the chosen time, the form lists it with its usual hours, and Place order is disabled.

Times are counted in the store's time zone (the one Takeout Menu saved from the register), or the WordPress time zone if there is none. Times are shown in the WordPress time format (Settings > General).

Arranged by the shop: if the cart has an item that is only in menus with no hours, and the register has no business hours, the customer does not choose a time. The whole order is marked To be arranged, and the shop contacts the customer. Order settings explains this under Pickup times. If no menu has hours at all, every order works this way and a yellow notice is shown. Set menu hours in the register to switch back (at the next sync).

Daylight saving time: times skipped when clocks go forward are never offered. The repeated hour when clocks go back is not offered unless you turn it on, because one time could mean two different moments.

The server checks the pickup time again when the order arrives. If it is no longer available, the customer is asked to choose again.

4. Orders, Order Numbers and Emails

What the server checks

The browser sends only IDs, options and quantities, never prices. The server rebuilds the order from the current menu: items and options must be on a shown menu and not sold out, required options and limits are checked, and prices are calculated the same way as on the menu page (tax included or before tax, following the Takeout Menu setting). Items with variable prices make the subtotal "Price varies".

Order numbers

Prefix + month and day + 4 random characters (0–9 and A–F), for example TO-1017-A3F9.

Emails

Plain text emails sent with wp_mail(), in the site language.

EmailToSubjectReply-To
To the customerCustomer emailOrder received: TO-1015-A3F9 - shop nameThe first address in From email address
To the shopFrom email address (all)New order TO-1015-A3F9 - pickup Oct 17 12:00 pmCustomer email

The sender (From) is "shop name <the first address in From email address>" (Shop name and From email address in Order settings. If empty, the site title and the site admin email). If an SMTP plugin is set to force its own sender, its settings are used instead. The subtotal is followed by "(tax incl.)" or "(before tax)", matching how Takeout Menu shows prices (the same in the cart and the Orders list). In customer emails and the cart, it is labeled "Estimated subtotal", because the register may round tax differently by a cent. The final price is calculated at the counter. If emails land in spam or are not sent, use an SMTP plugin (see the guide for how to set one up). If sending fails, the order is still saved, and the customer sees "We could not send the confirmation email. Please note your order number."

5. Order List, CSV and Order History

6. Customer Data and Privacy

Add these points to your site's privacy policy as needed.

7. Spam Protection

Page cache plugins

Pickup times are loaded each time the order form opens (Cache-Control: no-store), so cached pages still offer current times. The REST nonce is sent only for logged-in users, so cached pages do not break orders.

8. Changing the Look

The cart and the order form take their colors and fonts from the menu (or the page). There are no color settings. To change more, write your own CSS. Class names start with takeout-orders-.

/* Move the cart button */
:root {
  --takeout-orders-cart-right: 24px;
  --takeout-orders-cart-bottom: 24px;
}

Writing all the CSS yourself

Turn off Use the plugin styles in Order settings > Styles. The plugin then stops loading its stylesheet for the cart button, the cart, the order form, the quantity and Add to cart in the item window, and the "+" on the menu. The admin pages keep their styles.

A small base stylesheet is still loaded. It hides the hidden field that catches bots (if customers can see it and fill it in, their orders are refused), and sets icon sizes and a few small rules. Everything except the bot field has zero specificity (:where()), so your own CSS overrides it as is.

This setting is separate from the one in Takeout Menu. To turn off the styles in code, use the tokurabo_takeout_orders_load_css filter.

9. For Developers: Hooks and REST API

Filters

FilterWhat it changes
tokurabo_takeout_orders_store_hoursStore hours by day of the week (1 = Monday ... 7 = Sunday => list of periods).
tokurabo_takeout_orders_prep_minutesPreparation time in minutes, used for the earliest time and ASAP. The saved setting is not changed.
tokurabo_takeout_orders_open_periodsPeriods that can be chosen on a given day (periods, date).
tokurabo_takeout_orders_pickup_messageA short message shown under the Pickup time heading. Empty by default.
tokurabo_takeout_orders_checkout_fieldsAdd fields to the end of the order form: key, label, type (text / textarea), required, maxlength, placeholder. One per order.
tokurabo_takeout_orders_check_fieldsCheck the added fields ([ { key, label, value } ]). Return a WP_Error to refuse the order with its message.
tokurabo_takeout_orders_emailEach email before sending: kind (customer / store), to, subject, body, headers, and the order.
tokurabo_takeout_orders_rate_limit[ 'ip' => [ 5, 600 ], 'email' => [ 5, 3600 ] ]. Set a count to 0 to turn it off.
tokurabo_takeout_orders_load_cssReturn false to stop loading the plugin styles, the same as turning off Use the plugin styles.

Separate carts for add-on plugins

An add-on plugin can make its own cart, with its own items and pickup times, next to the usual one. The cart button and the usual cart are not affected.

Actions

REST API (namespace tokurabo-takeout-orders/v1)

Database tables

{prefix}tokurabo_takeout_orders (one row per order) and {prefix}tokurabo_takeout_order_items (one row per item). Names and prices are copied at the time of the order.

10. Troubleshooting and Logs

What happensWhat to check
Emails do not arriveSpam folder, then an SMTP plugin (guide). Check the log for the sending error.
"Could not load pickup times."The REST API is blocked (security plugin, server rule) or the site returns an error. Open /wp-json/tokurabo-takeout-orders/v1/pickup.
Times look shifted by some hoursThe store time zone in Square and Settings > General > Timezone.
"Too many orders. Please wait a few minutes and try again."The rate limit. Many people on the same network? Use the tokurabo_takeout_orders_rate_limit filter.
Old orders are not deletedWP-Cron is disabled or the site has few visitors. Run wp-cron.php from the server's cron.

Detailed errors are written to wp-content/debug.log only when WP_DEBUG_LOG is enabled in wp-config.php.

When you delete the plugin

Deactivating keeps everything. Deleting the plugin removes all orders (both tables), settings, and scheduled tasks. Export the orders to CSV first. The plugins list has an Export orders link next to Deactivate. Takeout Menu and its settings are not affected.

Get Takeout Orders for Free

Tokurabo Takeout Orders is free on WordPress.org.

Download from WordPress.org

You can also install it from Plugins > Add Plugin in your WordPress dashboard.

When Orders Pick Up

A paid plugin that works on top of Takeout Orders.

Takeout Order Board Paid

Turns the orders from Takeout Orders into an order board on your shop's tablet. Move each order along with one tap, and the customer gets an email. Busy mode, seasonal pre-orders and an order history are included too.

See Takeout Order Board