Add session bookings to WooCommerce without the WooCommerce Bookings extension

Published Updated 3 min read

WooCommerce Bookings is a first-party extension for operations that schedule rooms by the hour, assign bookings to staff, juggle several resources per reservation and price differently by time of day. It is a complete reservation engine, on purpose.

A yoga studio, a boat tour operator, an escape room or a cooking school needs none of that. They have a few session types, fixed days for each, and a fixed number of places. A customer picks a date and a session, and the store needs to know when a slot is full. That is all.

WooCommerce already holds the data: product settings for the sessions, order meta for what was booked, and order status for whether a place is still taken. A small plugin joins those three up, and for most simple session businesses that replaces a paid extension.

Why WooCommerce Bookings is more than most venues need

Bookings was designed for scheduling complexity: several bookable resources per location, per-person and per-unit pricing, buffer time between bookings, availability that follows staff calendars, Google Calendar sync, and a back-office calendar spanning every product and booking.

A studio running three session types a day with twelve places each uses none of it. The schedule does not change by the hour, nothing needs assigning, and the calendar you actually want is a list of who booked which date. Bookings is paid and takes real setup, so it is worth listing which of its features you would use before reaching for it.

Capacity counted from real orders

There are three moving parts: session types per product with their days and capacity, a date and session picker on the product page, and a capacity check that counts orders.

When a customer picks a date and session, the plugin counts orders for that combination in processing, on-hold or completed status. There is no separate bookings table to drift out of step; the count reflects the store at the moment of purchase. A cancelled or refunded order drops out of the count at once, so a freed place needs no manual action.

The date picker only offers days the chosen session runs. If Morning sessions run Wednesday to Friday, Monday and Tuesday are refused as soon as Morning is selected.

Three session types, a picker and a Bookings page

The product's Inventory tab gets three session types (Full Day, Morning and Evening), each with day-of-week checkboxes and a capacity. Enable only the ones a product offers; a product with only Morning and Evening never shows Full Day.

Above Add to Cart, the product page shows the date picker and session selector, with the places left beside the dropdown, recalculated whenever the date or session changes. A sold-out session disables Add to Cart and shows a notice. To book two sessions in one order, a customer adds the product twice with different selections; each cart line is checked against capacity on its own.

The chosen date and session are stored as order item meta and shown in the cart, at checkout, on the confirmation page, in the order email and on the admin order screen. A Bookings page in the WooCommerce menu lists upcoming bookings by date, with session, product, customer, a link to the order and its status: the screen to check each morning before sessions start.

When scheduling is the service itself

Staff assignment, resource allocation per booking, Google Calendar sync, custom pricing per slot and waiting lists all need the full Bookings extension or a dedicated appointment tool.

Amelia, Bookly and WooCommerce Bookings earn their place where scheduling is built into the service: a clinic matching patients with particular practitioners, a hotel assigning rooms, a gym where a trainer's own calendar decides which slots exist. This is no replacement for them there.

The quick test: if your schedule is a fixed table that changes maybe once a season and the only variable is places left per date, this covers it. If the schedule moves, or depends on calendars and per-practitioner availability, use a dedicated tool.

What you get

Included

  • Three configurable session types (Full Day, Morning, Evening) per product with per-session day-of-week availability and capacity
  • A date picker on the product page constrained to the selected session's available days
  • Live remaining capacity shown on the product page, with sold-out blocking when capacity is reached
  • Booking date and session type stored as order item meta, visible in cart, checkout, and order screens
  • An admin Bookings page listing upcoming bookings grouped by date with order links

Not included

  • Custom session type names: Full Day, Morning, and Evening are fixed in the plugin code
  • Per-date capacity overrides: capacity is set per session type and applies to every date equally
  • Specific date blocking for holidays or closures: dates can only be excluded by day of week
  • Booking multiple sessions in a single add-to-cart action: to book two different sessions, add the product to cart twice with different selections
  • Google Calendar sync, SMS or email reminders, and waiting lists

WooCommerce Bookings does the things on the right. This build covers the part most sites use.

Questions

Can I rename Full Day, Morning and Evening?

Not from the admin; the three types are fixed in the plugin code. Edit the labels and key strings in the plugin file, or use a follow-up message to have the names and the number of sessions read from a settings field.

Can I block bookings on one date, such as a public holiday?

Dates can only be excluded by day of week. The simplest workaround is to set that session's capacity to zero for the affected period and restore it afterwards. Per-date closures are not supported.

Does it work for variable products?

Session types are set on the parent product and capacity is shared across all variations. Per-variation sessions are not supported.

Build it in Steem

The button opens the builder with this guide's prompt filled in, so you can change anything before it runs. Nothing is built, and nothing is charged, until you send it.

Build this pluginAbout 55 credits. The free plan includes enough for one.
Read the prompt (569 words)

Build a WooCommerce plugin called Session Booking for WooCommerce. Plugin Name: Session Booking for WooCommerce. Description: Per-product session bookings with capacity tracking. Single PHP file. No dependencies beyond WooCommerce. Session types are hard-coded as three slots with keys fullday, morning, evening and labels Full Day, Morning, Evening. On each product Inventory tab (using woocommerce_product_options_inventory_product_data), render a fieldset labelled Session booking with one row per session type. Each row has: a checkbox to enable the session (id/name _session_fullday_enabled etc.), seven day-of-week checkboxes (value 0 for Sunday through 6 for Saturday, stored as a comma-separated string in _session_fullday_days, _session_morning_days, _session_evening_days), and a capacity number input (_session_fullday_capacity, _session_morning_capacity, _session_evening_capacity, min=1). Save all meta on woocommerce_process_product_meta using update_post_meta with absint for capacity and sanitize_text_field for days strings and enabled checkboxes. On woocommerce_before_add_to_cart_button for simple and variable products, output: a date input (type=date, name=sbfw_date, id=sbfw_date, min=today in Y-m-d format) and a select (name=sbfw_session, id=sbfw_session) populated only with enabled session types for this product. For each option include a data attribute data-days containing the comma-separated days string for that session. Below the select, output a paragraph (id=sbfw_remaining) showing remaining capacity for the default-selected session on today's date, calculated server-side: remaining = capacity minus count of woocommerce_order_itemmeta rows where meta_key=sbfw_session AND meta_value=the session key AND there exists another meta row on the same order item with meta_key=sbfw_date AND meta_value=the date, joined with wp_woocommerce_order_items and wp_posts where post_type=shop_order and post_status IN (wc-processing,wc-on-hold,wc-completed) and the order item has a meta_key _product_id matching this product. Register a nonce-protected wp_ajax and wp_ajax_nopriv action sbfw_get_remaining. It reads POST fields product_id, session, date; runs the same capacity query; returns JSON {remaining: N, capacity: N}. Add inline JavaScript on the product page. On change of sbfw_session or sbfw_date: if both have values, fetch sbfw_get_remaining via admin-ajax, update sbfw_remaining text to X of Y spaces remaining. If remaining is 0, set the text to Sold out for this date and session and disable the add-to-cart button; otherwise re-enable it. On change of sbfw_session, also validate the currently selected date: read the new session option data-days attribute, split on comma, check if getDay() of the selected date is in the array; if not, clear the date value and show an inline message below sbfw_date reading This session does not run on [day name]. Pass the admin_ajax url and nonce to JS via wp_localize_script. Validate in woocommerce_add_to_cart_validation: sbfw_date must be a valid date in Y-m-d format and must be today or later; sbfw_session must be one of the enabled session keys for this product; the day of week of sbfw_date must be in the session days list; remaining capacity must be at least 1. On any failure add a wc_add_notice error and return false. Store cart item meta via woocommerce_add_cart_item_data (add sbfw_date and sbfw_session). Display in cart via woocommerce_get_item_data with labels Date and Session. On woocommerce_checkout_create_order_line_item save both as order item meta with wc_add_order_item_meta. Escape all output with esc_html. Add a submenu page Bookings under WooCommerce (add_submenu_page, parent_slug woocommerce, capability manage_woocommerce, slug wc-session-bookings). Query order items that have sbfw_date meta with value >= today, joining sbfw_session meta and wp_posts for status, and wp_postmeta for customer first and last name (_billing_first_name, _billing_last_name). Output an HTML table. Group rows by date: print a full-width heading row for each new date. Columns: Session, Product (linked to product edit screen), Customer, Order (order number linked to order edit screen), Status. Order by sbfw_date ASC then order_id ASC. Escape all output.