=== Restaurant Manager — Online Food Ordering, Delivery & Pickup ===
Contributors: raintech357
Tags: restaurant, online ordering, food delivery, pickup, food ordering plugin
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 8.0
Stable tag: 4.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A standalone online food ordering plugin for WordPress — delivery and pickup, custom REST API, React admin dashboard and storefront. No WooCommerce required.

== Description ==

**Restaurant Manager** turns any WordPress site into a fully working online food ordering platform — no WooCommerce, no page builder, no third-party ordering service. It's built specifically for restaurants that want **delivery and pickup ordering** without the overhead of a general-purpose ecommerce plugin.

Everything a restaurant needs to take orders online is included out of the box: a menu with categories and priced variations (sizes, crusts, spice levels), a shopping cart, a guided checkout, live order tracking for customers, and a complete order-management dashboard for staff.

= Why Restaurant Manager? =

* **Purpose-built for restaurants** — the entire plugin is scoped to online food ordering. No table reservations, no floor plans, no dine-in or QR-code ordering to wade through.
* **No WooCommerce required** — a self-contained REST API and custom database tables mean no dependency on WooCommerce, Elementor, or Divi.
* **Fast, modern interfaces** — the admin dashboard and customer storefront are both built in React for a fast, app-like experience instead of clunky page reloads.
* **Accurate pricing, every time** — a server-side pricing engine recalculates every order directly from the database (item price, variations, discounts, delivery fee, tax), so prices sent from a browser are never trusted blindly.
* **Extensible payments** — ships with Cash on Delivery and Cash at Pickup; add Razorpay, Stripe, or any other gateway by implementing a simple payment gateway interface.

= Key features =

* Menu management with categories and per-product variations (e.g. Small/Medium/Large, Regular/Spicy), each with its own price
* Product photos via the native WordPress media library
* Shopping cart with a slide-in side-cart drawer and a guided Cart → Details → Payment checkout flow
* Delivery and pickup order types, with configurable delivery fees, free-delivery thresholds, and bookable time slots
* Customer order tracking by order number
* Admin dashboard: Orders, Menu, Delivery & Pickup, Customers, Discounts, Analytics, and Settings
* Bulk actions for managing products and categories
* Built-in demo data importer to preview the storefront with a sample menu
* Discount codes and promotions
* Custom roles and capabilities for restaurant staff
* REST API under `/wp-json/restaurant/v1/` covering locations, menu, orders, delivery, customers, discounts, analytics, and settings — every endpoint server-side validated
* A simple `[restaurant_app]` shortcode embeds the entire customer-facing storefront (menu, cart, checkout, order tracking) on any page
* A guided Setup wizard creates the storefront page for you automatically

Whether you run a single restaurant or a small chain, Restaurant Manager gives you a dedicated food ordering plugin without paying for or configuring a full ecommerce platform.

== Installation ==

1. Upload the plugin files to `/wp-content/plugins/restaurant-manager`, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. Go to **Restaurant Manager > Setup** in wp-admin and complete the setup wizard — it creates the storefront page for you automatically.
4. Add your menu categories and products under **Restaurant Manager > Menu**, or use the built-in demo data importer to preview the storefront instantly.
5. Configure delivery fees, pickup time slots, and payment options under **Restaurant Manager > Delivery & Pickup** and **Settings**.

== Frequently Asked Questions ==

= Do I need WooCommerce for this plugin to work? =

No. Restaurant Manager is completely standalone — it uses its own custom database tables and REST API, with no dependency on WooCommerce or any other ecommerce plugin.

= Does this plugin support table reservations or dine-in ordering? =

No — Restaurant Manager is intentionally focused on online ordering only: delivery and pickup. There is no table booking, floor plan, or QR-code dine-in ordering.

= Can I add my own payment gateway? =

Yes. Payment gateways are pluggable — Cash on Delivery and Cash at Pickup are included, and additional gateways (Razorpay, Stripe, etc.) can be added by implementing the plugin's payment gateway interface.

= How do I display the storefront on my site? =

Add the `[restaurant_app]` shortcode to any page, or let the Setup wizard create that page for you automatically.

= Can customers choose a delivery or pickup time? =

Yes — configure bookable time slots under Restaurant Manager > Delivery & Pickup, and customers will be able to pick a date and time at checkout.

== Screenshots ==

1. Customer storefront — menu browsing with category sections and priced variations.
2. Slide-in cart with a guided checkout flow.
3. Admin dashboard — order management.
4. Admin menu editor — products, categories, and variations.

== Changelog ==

= 0.6.3 =
* Menu categories and food items are now global instead of scoped per location, matching how delivery zones and pickup time slots already worked — simpler setup for single-location restaurants.
* Added product photos: pick an image from the WordPress media library directly in the product editor, shown on the storefront and falling back to a letter placeholder when no photo is set.
* Redesigned the storefront menu into category-grouped sections with a card-based layout, quick-jump category filter (defaulting to "All"), and inline variation picker pills — replacing the previous popup for choosing sizes/options.
* Added bookable delivery/pickup time slots at checkout, only shown when the restaurant has configured at least one time slot.
* Added a currency symbol setting, applied everywhere a price is shown to customers.
* Added bulk delete for products and categories in the admin.
* Added a built-in demo data importer (sample categories and dishes) for quickly previewing the storefront.
* Simplified delivery zone configuration to a single fixed delivery fee and free-delivery threshold, replacing the distance-tier rate table.
* Cart contents now persist across page reloads.
* General admin and storefront UI consistency pass: unified form control styling, converted interactive elements to accessible link-style controls, and various layout refinements.

= 0.6.1 =
* Removed the external Google Fonts link and the Fraunces/Inter font-family
  references — the storefront and admin now use only the visitor's system
  font stack, no external requests.
* Removed the fixed 640px max-width on the storefront container. Added a
  Storefront layout setting (Restaurant Manager > Settings): Mobile width
  (compact, centered) or Desktop width (wider, more menu columns on large
  screens), read by the storefront via a small public settings endpoint.

= 0.6.0 =
* Replaced the separate Cart and Checkout pages with a slide-in side-cart
  drawer that has its own 3-step flow (Cart -> Details -> Payment), so
  customers never leave the menu page.
* Added a floating bottom-center bar that appears as soon as something is
  added — shows the item count and running total, tap to open the drawer.
* Menu cards now show an inline quantity stepper once an item is already
  in the cart, instead of just an Add button.

= 0.5.1 =
* Fixed "Place order" returning a 500 error: dbDelta only ran on a genuine
  plugin (re)activation, so a site that just had its plugin files replaced
  by a newer zip was left on stale table structure (missing columns like
  orders.access_token), and every order insert silently failed. The schema
  now re-syncs automatically whenever the plugin version changes, the same
  way capabilities already did.
* Order-creation failures now log the underlying SQL error and return a
  more specific message when WP_DEBUG is on, instead of a bare 500.
* Redesigned the customer storefront: Fraunces/Inter typography to match
  the admin, a proper segmented delivery/pickup control, refined food
  cards with monogram thumbnails, veg/spicy/chefs-pick badges, an inline
  quantity stepper once an item is in the cart, and a more considered
  cart/checkout/order-status layout.

= 0.5.0 =
* Removed the entire table-booking system: reservations, table floor plan,
  table sections, dine-in ordering, and table-linked QR codes are gone —
  their database tables, REST endpoints, admin pages, capabilities
  (manage_restaurant_reservations, manage_restaurant_tables, manage_kitchen)
  and the Kitchen Staff role are all removed.
* The plugin is now scoped to online ordering only: delivery and pickup,
  with everything else (menu, cart, checkout, pricing engine, payment
  gateways, delivery zones, pickup slots, discounts, customers, analytics,
  settings) unchanged.
* Cash-at-restaurant gateway now applies to pickup only (dine-in removed).

= 0.4.0 =
* Removed the duplicate Kitchen wp-admin page — Kitchen is now a tab inside
  the main Restaurant Manager app instead of a second identical page.
* Fixed food items/categories created without an explicit location becoming
  invisible on the storefront (API now treats unassigned items as available
  everywhere; admin Menu pages now tag new items with the selected location).
* Setup wizard now prefills from your saved location on revisit instead of
  showing a blank form, and no longer discards saved data if page creation
  fails partway through.
* Capabilities now resync on every plugin version bump, not just activation,
  so upgrades from an earlier build don't leave admins missing capabilities.
* Admin navigation moved from a left sidebar to a top bar.
* Storefront menu/category/location requests are now cached in memory for
  60s to avoid refetching the same data on every tab switch.

= 0.3.0 =
* Reservations, drag-and-drop Tables floor plan, Delivery Zones + rates,
  Pickup Slots, QR Codes, Customers, Discounts, Analytics, Settings —
  REST APIs and admin UI for all of them.
* Customer storefront: reservation booking page, QR-code ordering
  (auto-fills location/table from the URL), bottom nav.

= 0.2.0 =
* Orders, custom cart, checkout, server-side pricing engine, pluggable
  payment gateways (Cash, Cash at restaurant), storefront ordering flow,
  admin Orders page.

= 0.1.0-phase1 =
* Initial foundation: database, permissions, REST API base, Locations + Menu API,
  React admin shell, Setup wizard, frontend shortcode stub.

== Upgrade Notice ==

= 0.6.3 =
Menu categories and food items are now global rather than per-location; product images, redesigned menu layout, and bookable delivery/pickup time slots are added. No manual action required — existing data is preserved.
