=== Patro Appointment Booking ===
Contributors: arjunchhetri100
Author URI: https://arjunregmichhetri.com
Tags: booking system, appointments, booking, booking form
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.4
License:  GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Let customers book appointments 24/7 via a Gutenberg block — manage services, staff, and bookings from one clean WordPress admin dashboard.

== Description ==

Take control of your appointment business with **Patro Appointment Booking** — a fast, modern WordPress booking plugin built around a beautiful Gutenberg block. Customers complete a clean, guided multi-step form to pick a service, choose a staff member, select a date and time, fill in their details, and confirm — all without ever leaving your site. You manage every booking from a dedicated, React-powered admin dashboard.

No coding required. No complex setup. Just drop the block onto any page and start taking bookings. 📅

Who is Patro Appointment Booking For?
Patro Appointment Booking is built for any individual or business that takes scheduled appointments and wants an elegant, hassle-free booking experience for their customers.

**Salons & Beauty Studios**
Give clients the freedom to book haircuts, treatments, and styling sessions around the clock. Block holidays, close weekdays, and let your calendar manage itself while you focus on the work.

**Consultants & Coaches**
Let prospects book discovery calls and sessions directly from your site. Assign bookings to specific team members, get instant email alerts, and never miss a new client inquiry.

**Healthcare & Wellness Providers**
Collect patient or client details at booking time, set a custom booking window, and manage appointment status — Pending, Approved, Canceled, Rejected, Completed — from one clear screen.

**Fitness Trainers & Gyms**
Set your available days and hours, block out personal-training sessions per staff member, and let members self-book 24/7 without picking up the phone.

**Tutors & Educators**
Create sessions as services, set their duration and price, and let students pick the slot that works for them. The form works equally well on desktop, tablet, and mobile.

**Any Service-Based Business**
If your business runs on scheduled appointments, Patro Appointment Booking gives you the tools to automate bookings, reduce no-shows through email confirmations, and grow without adding admin overhead.

A free booking system gives your business the freedom to grow 📈

No more missed bookings — automatic confirmation emails keep customers informed.
Your calendar, your rules — block dates, close weekdays, and set how far ahead clients can book.
Mobile-first — the booking form looks great and converts on every screen size.
Developer-friendly — REST API plus WordPress action and filter hooks for add-ons.

== Patro Appointment Booking Free Features ==

**Beautiful Multi-Step Booking Form**

* React-powered booking flow: Services → Date & Time → Your Details → Review → Confirmation
* Step-by-step sidebar navigator with active-state indicators and icon-headed panels
* Collapsible sidebar for a distraction-free experience on smaller screens
* Radio-style service cards with duration pills for instant clarity
* Real-time calendar with blocked-date and closed-weekday enforcement
* Fully responsive — sidebar collapses to a top bar on mobile, single-column on small screens

**Service List Block**

* A second Gutenberg block that renders your services as a grid of cards, fetched live from the booking API
* Built-in detail view so visitors can read a full service description without leaving the page
* Configurable cards per row, number of services shown, and "Book now" button label from the block inspector

**Services & Staff Management**

* Create unlimited services with name, duration, and price
* Organise services into categories for easier browsing
* Add a staff member (one on the free plan), give them a profile photo, and assign them to one or more services
* Set each employee's own work hours, days off, and special days on top of your business schedule
* Optional staff-selection step in the booking flow — let customers choose who they book with

**Bookings Dashboard**

* Central bookings screen with per-booking status management (Pending, Approved, Canceled, Rejected, Completed) plus search and date filtering
* Update any booking status in one click
* Full customer details stored per booking for easy reference
* Automatic confirmation email to the customer on every new booking
* Instant admin notification email so you never miss a reservation
* Export bookings to CSV, with a date-range filter

**Calendar View**

* See every booking on a real calendar in day, week, or month view
* A live current-time line on the day and week views so today is easy to read at a glance
* Click any booking to open its full details in a modal, without leaving the calendar

**Customers**

* A Customers screen listing everyone who has booked, built from your booking history
* Contact details, last booking date, and total booking count per customer
* Export your customer list to CSV

**Finance**

* A Transactions screen backed by a real, persisted payment record per booking, kept independent of the booking's own status
* Each transaction shows its subtotal, discount, tax, and total in your configured currency
* Export transactions to CSV

**Email Notifications**

* A Notifications screen for editing the email sent on each event — appointment approved, pending, rejected, and cancelled, payment received, and follow-up
* Merge tags for appointment, customer, employee, service, company, and payment details
* Sensible templates seeded on activation, so email works before you customise anything

**First-Run Setup Wizard**

* A guided wizard after activation that walks you through your business details, working hours, first service, and first staff member

**Flexible Settings**

* A searchable settings sidebar grouped into Business, Payment, Date & Time, Manage schedule, Booking Rules, and Privacy & Data
* Set your business working hours and days off in one place
* Set your booking window — control how many days ahead customers can schedule
* Block individual dates using the built-in date picker
* Close recurring weekdays so your calendar reflects your real availability
* Choose your currency and how prices are displayed
* Customise the thank-you message displayed after a successful booking
* Configure admin notification email address and sender name
* Per-user column layout and rows-per-page preferences on every admin list screen

**Developer Friendly**

* REST API support
* WordPress hooks and filters
* Extensible architecture for custom integrations

== Patro Appointment Booking Pro *(separate plugin)* ==

Unlock powerful premium features with the optional Pro add-on:

* **Online Payments** — accept card payments via Stripe or PayPal, with automatic refunds and downloadable invoices
* **Coupons & Discounts** — create percentage and fixed-amount coupon codes for promotions
* **Tax** — configure tax rates that apply automatically at checkout
* **Service Extras** — offer optional add-ons customers can attach to a booking
* **Unlimited Employees & Scheduling Overrides** — remove the free plan's staff limit and set per-employee or per-service schedule exceptions
* **Multiple Locations** — run bookings across several business locations from one dashboard
* **SMS & WhatsApp Notifications** — send booking confirmations and reminders by text or WhatsApp, alongside email
* **Google Calendar & Zoom Integration** — two-way calendar sync and automatic video meeting links for appointments

== 5 Easy Steps to Get Started ==

1. Install and activate the plugin from **Plugins → Add New** in your WordPress admin. The setup wizard opens automatically so you can enter your business name, contact email, and currency.
2. Go to **Patro Booking → Services** and add at least one service (name, duration, price).
3. Go to **Patro Booking → Employees** and add at least one employee — set their work hours and assign your services to them. Every bookable time slot comes from an employee's schedule, so a service with nobody assigned to it has no times to offer.
4. Open any page or post in the Gutenberg editor, search for **Booking Form**, and insert the block.
5. Publish the page — your customers can now book 24/7.

Optional: fine-tune your booking window, slot interval, buffers, days off, and notification emails under **Patro Booking → Settings** — every setting ships with a sensible default, so the form works before you touch any of them.

== What Makes Patro Appointment Booking Stand Out ==

**Gutenberg-native** — no shortcodes, no iframes. The booking form is a first-class Gutenberg block that works seamlessly with the WordPress editor and any block-based theme.

**React-powered, fast-loading** — the multi-step form is built with React for smooth, animated step transitions and a snappy user experience with no full-page reloads.

**Zero configuration clutter** — every setting has a sensible default. You can have a working booking form live in under five minutes.

**Extensible by design** — REST API endpoints and WordPress action and filter hooks let third-party add-ons build cleanly on top of the free core without hacks.

**Transparent booking flow** — the collapsible sidebar shows customers exactly where they are in the process at all times, reducing drop-off and improving completion rates.

== Installation ==

1. Upload the `patro-appointment-booking` folder to `/wp-content/plugins/`, or install via **Plugins → Add New** in WordPress.
2. Activate the plugin through the **Plugins** screen.
3. Go to **Patro Booking → Services** and create at least one service.
4. Go to **Patro Booking → Employees** and create at least one employee, set their work hours, and assign your services to them. This step is required — bookable slots are read from employee schedules.
5. Go to **Patro Booking → Settings** and configure your booking window and notifications.
6. Open any page or post in the Gutenberg editor, search for the **Booking Form** block, and insert it.
7. Publish the page — your booking form is live.

== Frequently Asked Questions ==

= Where do I manage bookings? =

Go to **Patro Booking → Bookings** in the WordPress admin menu. You can search bookings and filter them by date, and update each booking's status (Pending, Approved, Canceled, Rejected, Completed) from there.

= How do I add a booking form to my page? =

In the Gutenberg editor, click the **+** block inserter, search for **Booking Form**, and insert it. The block renders the full multi-step form on the frontend automatically.

= What is the Service List block? =

It is a second block that displays your services as a grid of cards anywhere on your site, with a detail view for each one. Insert it the same way as the booking form — search for **Service List** in the block inserter. You can set how many services to show, how many cards per row, and the label on the booking button.

= Can customers book without logging in? =

Yes. The booking form is publicly accessible by default. No WordPress account is required to make a booking.

= Can I assign bookings to specific staff members? =

Yes. Create an employee under **Patro Booking → Employees**, assign services to them, and enable the staff-selection step in **Settings**. Customers will then be able to choose who they book with. The free plan includes one staff member; Pro removes that limit.

= Why does my booking form show no available times? =

Availability comes entirely from employee schedules. Check that you have at least one employee under **Patro Booking → Employees**, that the service is assigned to that employee, and that the employee has work hours saved for the weekday you are testing. Business working hours in **Settings** only pre-fill a new employee's hours — on their own they do not make any time bookable.

= Where are booking emails sent? =

The customer receives a confirmation email at the address they enter in the form. The admin receives an alert at the address configured in **Settings**, which defaults to the site admin email.

= Is the booking form mobile-friendly? =

Yes. The form is fully responsive. On screens below 900 px the sidebar collapses into a compact top navigation bar. On very small screens the layout becomes a single column with full touch support.

= How do I block specific dates or days of the week? =

Go to **Patro Booking → Settings**. Use the **Blocked Dates** date picker to block individual dates and the **Closed Weekdays** checkboxes to disable recurring days of the week.

= Does Patro Appointment Booking work with page builders? =

The booking form is a native Gutenberg block and works best in the WordPress block editor. For Elementor and other builders that support Gutenberg widgets or HTML embeds, you can use a Custom HTML widget with the block markup, though native Gutenberg is recommended for the best experience.

= Is there a Pro version? =

Yes. The optional **Patro Appointment Booking Pro** plugin extends the free version with online payments (Stripe/PayPal), coupons, tax, service extras, unlimited employees with scheduling overrides, multiple locations, SMS/WhatsApp notifications, and Google Calendar/Zoom integration.

= Can developers extend the plugin? =

Yes. Patro Appointment Booking exposes REST API endpoints and WordPress action and filter hooks (such as `patrabk_booking_created`) for add-on developers.

== Screenshots ==

1. Frontend booking form — Services step with icon header, service cards, and duration pills
2. Frontend booking form — Date & Time step with real-time calendar and time slot grid
3. Frontend booking form — Your Details step with customer contact fields
4. Frontend booking form — Review step showing a full summary before confirmation
5. Booking confirmation screen with customisable thank-you message
6. Admin bookings screen — filter by date, service and status, then open any booking in a side panel to see full customer and payment details and change its status
7. Admin services configuration screen
8. Gutenberg block inspector showing the Booking Form block options

== Changelog ==

= 1.0.4 =
* The Booking Form block's editor preview now renders the same service cards, step labels and icons the published form does, instead of an older layout it had drifted away from
* The Service Selection layout setting (List or Dropdown) now takes effect in the editor preview, not just on the published page
* The editor preview now shows your own services, priced in your configured currency, instead of placeholder ones always priced in US dollars
* The editor preview now reports when no service is bookable yet — and why — instead of filling the form with sample services

= 1.0.3 =
* Added a first-run Setup Wizard shown after activation to help you create your first service and staff member
* Added a Service List block — a Gutenberg-native service directory that renders your services as cards with a built-in detail view, and configurable cards-per-row, service count and button label
* Added a Calendar screen with day, week and month views, a live current-time line, and a click-through booking modal
* Added a Customers screen listing everyone who has booked, with contact details, last booking date and total booking count
* Added CSV export for bookings, customers and transactions
* Added a Finance screen backed by a real, persisted payment record per booking, independent of the booking's own status
* Finance: payments now track discount and tax amounts alongside the base price; each transaction shows its subtotal, discount, tax and total
* Added a Notifications screen for the email sent on each event — appointment approved, pending, rejected and cancelled, payment received, and follow-up — with merge tags for appointment, customer, employee, service, company and payment details
* Employees now have their own work hours, days off and special days, plus a profile photo
* Settings reorganised into a searchable sidebar: Business, Payment, Date & Time, Manage schedule (working hours and days off), Booking Rules, and Privacy & Data
* Added an Upgrade page introducing the upcoming Pro add-on
* Added per-user, per-table column layout and rows-per-page preferences on the admin list screens
* Fixed the Dashboard, Bookings, Services and Finance screens ignoring the configured currency symbol and always showing amounts as if the currency were USD
* Deleting a service now also removes its staff assignments; deleting a category that still has services in it is blocked instead of leaving those services orphaned
* Various dashboard, admin UI, translation and bug fixes

= 1.0.2 =
* Added a "View details" popup for bookings and services — click any row in the admin tables to see every detail in a modal, with no page reload
* Booking and service table rows are now clickable and keyboard-accessible (Enter/Space to open, Esc to close)

= 1.0.1 =
* Fixed dashboard header actions ("View bookings", "Manage services") rendering as plain links instead of buttons

= 1.0.0 =
* Initial release
* Gutenberg booking form block — place the booking form on any page with a single block insert
* React-powered multi-step booking flow: Services → Date & Time → Your Details → Review → Confirmation
* Collapsible sidebar step navigator with active-step highlighting and icon-headed panels
* Service cards with radio-style selection and clock-icon duration display
* Admin dashboard built with React: Bookings, Services, Categories, Employees, and Settings screens
* Real-time date picker with blocked-date and closed-weekday enforcement
* Time slot grid with automatic filtering of past slots for same-day bookings
* Staff/employee assignment with optional customer-facing staff selection step
* Automatic email notifications — confirmation to the customer and alert to the admin
* Booking status management: Pending, Approved, Canceled, Rejected, Completed
* REST API endpoints for services, time slots, employees, and bookings
* WordPress action and filter hooks for add-on developers

== Upgrade Notice ==

= 1.0.4 =
Corrects the Booking Form block's preview in the editor so it matches the form your visitors see. The published booking form is unchanged. Safe to update.

= 1.0.3 =
Adds a Service List block, Calendar and Customers screens, CSV export, Finance and Notifications screens, and a first-run Setup Wizard. Also fixes several screens ignoring the configured currency symbol. Safe to update.

= 1.0.2 =
Adds a per-row "View details" popup for bookings and services. Safe to update.

= 1.0.1 =
Fixes the dashboard header actions so they display as buttons. Safe to update.

= 1.0.0 =
Initial release — no upgrade steps required.

== Development ==

The React admin app, the Gutenberg block, and the frontend booking form are
compiled from the human-readable source in the `resources/` directory using
@wordpress/scripts. The compiled output ships in `build/`. Both the source and
the build manifest (`package.json`) are included in the plugin so the code can
be inspected and rebuilt.

To build from source:

1. `npm install`
2. `npm run build`

Source locations:

* `resources/admin/` — React admin app (compiled to `build/admin/`)
* `resources/blocks/booking-form/` — Gutenberg block (compiled to `build/blocks/`)
* `resources/frontend/` — frontend booking form components
