=== OrderTable – Local Commerce & Operations ===
Contributors: shemuls
Donate link: https://shemuls.com/donate
Tags: ordering, woocommerce, restaurant, retail, dine-in
Requires at least: 6.2
Tested up to: 7.0
Requires PHP: 8.1
Stable tag: 0.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Manage your shop on WordPress: online + walk-in orders, daily sales, invoices, customers. Works standalone; optional WooCommerce sync.

== Description ==

OrderTable turns WordPress into a complete operations system for any local business — restaurants, retail shops, salons, repair shops, pharmacies. One place to take orders (online AND from walk-in customers), run the kitchen / counter / service queue, track daily sales and revenue, send branded invoices, and manage your regulars. No 15-30% commission to delivery aggregators, no separate point-of-sale software, no spreadsheets glued together with hope.

OrderTable works on its own with a built-in menu and a cash-first checkout. **WooCommerce is optional** — when it's active, OrderTable uses your existing WooCommerce products as the catalog and lets customers pay online through any WooCommerce gateway (Stripe, PayPal, SSLCommerz, bKash, and more). Without WooCommerce, you still get the full menu, ordering, dashboard, kitchen display, invoices, and customer tools.

**Key features**

* Three order modes — Delivery, Pickup, Dine-in — each with its own checkout flow.
* Password-protected dine-in — a daily-rotating password keeps fake orders from outside the venue.
* Hybrid product catalog — sell the same item online and in-house with optional per-mode pricing.
* Manager dashboard with live orders, kitchen / order display, analytics, and invoicing.
* Cash workflow built in. For online payments, hand off to any WooCommerce gateway — Stripe, PayPal, SSLCommerz, bKash, and others your store already supports.
* Translation-ready (`order-table` text domain) — community translations welcome on translate.wordpress.org.
* Customer-facing menu shortcode + an Elementor "Menu Display" widget. Additional widgets and Gutenberg blocks ship with OrderTable Pro.
* Themeable templates, REST API, hooks and filters throughout — agency-friendly.

**Why OrderTable?**

OrderTable covers both online ordering AND in-store workflow, designed from day one for small operators who run both at once. No commission to aggregators, no separate point-of-sale, no spreadsheets — one plugin handles the full shop.

== Installation ==

1. Upload the `order-table` folder to `/wp-content/plugins/`, or install via the Plugins screen.
2. Activate **OrderTable** through the **Plugins** menu in WordPress.
3. (Optional) Activate **WooCommerce** to use your existing products as the catalog and to accept online payments. OrderTable also works standalone with its built-in menu and cash checkout.
4. Run the Setup Wizard from the **OrderTable** menu.

== Frequently Asked Questions ==

= Does this require WooCommerce? =

No. OrderTable works standalone with a built-in menu and a cash-first checkout. WooCommerce is optional: when it's active, OrderTable uses your existing WooCommerce products as the catalog and enables online payments through any WooCommerce gateway. You can install WooCommerce at any time — OrderTable will pick it up automatically.

= Can the same product be sold online and dine-in? =

Yes — toggle modes per product, with optional separate pricing for each.

= How does the dine-in password work? =

A daily password is generated automatically (or manually). Customers scanning the table QR are required to enter today's password before submitting an order — preventing fake orders from outside the restaurant.

= How do I get support? =

Email **getordertable@gmail.com** or visit the contact page at [getordertable.com/support](https://getordertable.com/support). Include your WordPress version, OrderTable version, active theme, and a screenshot of the issue — speeds up the response.

== Screenshots ==

1. Manager dashboard with live order feed.
2. Kitchen Display System optimized for tablets.
3. Customer menu page (mobile-first).
4. Dine-in checkout with password gate.

== Privacy ==

OrderTable stores order data locally inside your own WordPress database — nothing is sent to any third-party service.

**Customer data stored per order:**

* Name
* Phone number
* Email address (optional, captured when the customer provides one at checkout)
* Delivery address (only when the customer selects Delivery mode)
* Order line items and totals
* Payment method and status

**Customer recall cookie**

When a customer places an order from the storefront, OrderTable sets an encrypted cookie containing only the customer's phone (so they can see their previous orders on their next visit). The cookie expires after the configured retention window (default: 90 days) and is removable by the customer at any time by clearing site cookies.

**Audit log**

Privileged actions performed by site staff (status changes, password rotations, order deletes, etc.) are logged with the staff user ID, timestamp, IP address, and User-Agent string. The audit log lives in your database and is never transmitted externally. Customer anonymisation removes PII from prior orders without losing the audit trail.

**External services**

The free version of OrderTable does NOT connect to any external service out of the box. Online payment, when enabled, hands off to WooCommerce's own gateways — those gateways have their own privacy practices, documented by the WooCommerce gateway plugin you install.

The `ordertable/frontend/webfonts_url` filter is intentionally empty by default — no external webfont stylesheet is requested. Site owners who explicitly return a URL from that filter (for example, a Google Fonts CSS URL) take responsibility for disclosing that third-party connection in their own site privacy notice.

== External services ==

OrderTable makes **no** outbound network calls in its default configuration. Every feature — invoices, QR codes, customer share links, order notifications — runs entirely on your own server.

The areas below are the only places the plugin can be configured to reach the outside world, and each is opt-in by the site owner:

**1. WhatsApp click-to-chat (`https://wa.me/`) — when staff click "Share via WhatsApp"**

When a staff member clicks the "Share via WhatsApp" button on an order, the browser is redirected to `https://wa.me/{phone}?text={pre-filled message}`. This is a redirect from the staff's browser to WhatsApp's own click-to-chat endpoint; the plugin never contacts WhatsApp servers directly from PHP. The customer's phone number and a short pre-filled message (restaurant name, order number, total, optional tracking URL) are passed in the URL.

- Service provider: WhatsApp / Meta
- Terms: https://www.whatsapp.com/legal/business-terms
- Privacy: https://www.whatsapp.com/legal/privacy-policy

**2. Telegram share endpoint (`https://t.me/share/url`) — when staff click "Share via Telegram"**

Same pattern as WhatsApp: the staff's browser is redirected to Telegram's official share URL with the order tracking link and a short message. The plugin makes no server-to-server call.

- Service provider: Telegram
- Terms: https://telegram.org/tos
- Privacy: https://telegram.org/privacy

**3. Facebook Messenger (`https://m.me/`) — when staff click "Share via Messenger"**

Browser redirect to Messenger using the Facebook Page username the site owner configures under Settings → Notifications. No data is sent from the server.

- Service provider: Meta / Facebook
- Terms: https://www.facebook.com/legal/terms
- Privacy: https://www.facebook.com/privacy/policy/

**4. Custom webfont URL — opt-in only**

The `ordertable/frontend/webfonts_url` filter is empty by default. A theme or site owner that explicitly returns a URL (e.g. a self-hosted webfont stylesheet, or a Google Fonts CSS URL) accepts responsibility for any third-party request that URL triggers. No webfont URL ships with the plugin.

**5. WooCommerce payment gateways — when an online payment is taken**

The plugin reuses whatever WooCommerce payment gateway plugins the site already has installed (Stripe, PayPal, SSLCommerz, bKash, etc.). Each gateway has its own privacy / terms documentation, surfaced by the respective gateway plugin's own readme.

**Right to be forgotten (GDPR)**

The "Anonymise customer" feature (Pro) replaces stored PII with placeholders across every matching order while keeping the audit log intact. Free admins can manually delete a customer record from the Customers screen.

== Changelog ==

= 0.1.0 =
* First public release.
* Three order modes: Delivery, Pickup, Dine-in.
* Daily-rotating password protection for dine-in orders.
* Manager dashboard with live order feed and today's revenue.
* Kitchen / Order Display screen (tablet-optimised).
* Hybrid product catalog with per-mode pricing.
* Tables management with QR-friendly URLs.
* Customer records (Phase E) with phone + email dedup.
* Invoice generation in three formats (thermal 58mm / 80mm + A4).
* Analytics page with revenue trends and top-items breakdown.
* Industry-aware label resolver — Restaurant / Retail / Service / Generic vocabulary.
* Elementor "Menu Display" widget with full styling controls.

== Upgrade Notice ==

= 0.1.0 =
First public release of OrderTable.
