=== RestoPick — Restaurant Pickup for WooCommerce ===
Contributors: nirwannirwan
Tags: woocommerce, pickup, checkout, restaurant, food
Requires at least: 5.8
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.1.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Pickup ordering system for WooCommerce, designed for restaurants and food businesses.

== Description ==

RestoPick — Restaurant Pickup for WooCommerce adds Pickup Date and Pickup Time fields to the WooCommerce checkout page, with full control over weekly schedule, slot interval, minimum lead time, and timezone.

The plugin is built for restaurants and food businesses that need a reliable way to let customers schedule pickup orders without bolt-on UI complexity.

= Features =

* Pickup Date (datepicker) and Pickup Time (dropdown) fields at WooCommerce checkout, rendered side by side without breaking the WooCommerce first name / last name layout.
* AJAX quick-toggle in the settings header to flip pickup on or off; checkout refuses submission with a notice when off.
* ASAP pickup option so customers can order for the soonest available time.
* Weekly schedule with multiple pickup windows per day (e.g. separate lunch and dinner ranges, or weekend-only hours).
* Closed dates to block specific days such as holidays — the checkout datepicker disables them and the server rejects submissions for them.
* Configurable slot interval from 1 to 240 minutes.
* Minimum lead time from 0 to 1440 minutes to prevent last-minute pickups.
* Timezone as a UTC offset, independent from WordPress timezone, no DST.
* Datepicker only exposes days that exist in the schedule; past time slots are automatically hidden on the current day.
* Server-side validation at checkout (date format, lead time, schedule, closed dates).
* HPOS-compatible order meta.
* Integrated into the admin order page, the Order Type column on the orders list, customer and admin order emails, and the thank-you page.
* Auto admin notice when pickup is disabled or when WooCommerce is not active.

= Pro version =

**Restaurant Pickup Pro for WooCommerce** is an optional companion plugin that extends RestoPick with these features, each on its own admin sub-page once Pro is installed and licensed:

* **Menu Hours** — per-product and per-category time windows. Define when specific menu items can be ordered (e.g. breakfast items only 06:00–10:00) and the checkout time dropdown narrows automatically based on what is in the cart, with server-side validation.
* **Tips** — preset percentage buttons plus a custom amount field at checkout, added as a non-taxable fee, with a tips report page.
* **Shortcode** — `[restopick_form]` to render the pickup date/time fields anywhere on the site (popups, landing pages, custom checkout layouts).
* **API Access** — REST endpoint to toggle pickup on or off remotely with Bearer token authentication.
* **License** — submit, regenerate, or revoke the license key from inside WordPress.

The free plugin works fully on its own. The **Restaurant Pickup → Get Pro** admin sub-page (only visible when Pro is not active) lists these features. Learn more at [https://nirwan.work](https://nirwan.work).

== Installation ==

1. Upload the plugin files to the /wp-content/plugins/restopick-restaurant-pickup-for-woocommerce/ directory, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the Plugins screen in WordPress.
3. Open Restaurant Pickup -> Settings to configure the weekly schedule, interval, lead time, and timezone under the General tab.

WooCommerce must be installed and active. If it is not, the plugin shows an admin notice and skips registering the checkout fields.

== Frequently Asked Questions ==

= Does this plugin work with HPOS (High-Performance Order Storage)? =

Yes. Order meta is written via $order->update_meta_data() and is fully HPOS-compatible.

= Can I run multiple pickup time ranges per day (lunch and dinner)? =

Yes. Add multiple rows in the weekly schedule (e.g. lunch 11:30–15:30 and dinner 17:00–21:00 on the same days).

= Where is the pickup info displayed after checkout? =

Pickup date, pickup time, and order type appear on the admin order detail page, the Order Type column on the orders list, customer and admin order emails, and the customer's thank-you page.

= How does the timezone setting work? =

The plugin uses a UTC offset (for example, +07:00) that is independent from the WordPress timezone setting. Daylight saving time is not applied.

= Can I block specific dates such as holidays? =

Yes. Use the Closed dates field on the settings page to add one or more dates. The checkout datepicker greys those dates out and the server rejects submissions for them.

= Does the free plugin require the Pro add-on to function? =

No. The free plugin is fully functional on its own. Pro is optional and adds Menu Hours, Tips, the shortcode, and a REST API.

== Screenshots ==

1. Settings page header with status, today's window, next closed date, and license tier — plus the ASAP option and weekly pickup schedule.
2. Multiple pickup windows per day, including separate weekday and weekend ranges.
3. Closed dates, slot interval, minimum lead time, and timezone offset.

== Changelog ==

= 1.1.4 =
* Internal: introduce `restopick_get_closed_dates( $start_ymd, $end_ymd )` helper and `restopick_pickup_closed_dates` filter so add-ons (e.g. the Pro recurring closed days feature) can extend the closed-pickup-dates list within a window. JS config, settings header summary, and checkout validation now route through the helper.

= 1.1.3 =
* Register the admin JS script handle on every admin page (not just the Settings page) so other admin sub-pages in the same menu can enqueue it without re-declaring the asset path.
* Rename the admin order list column key from `wpc_order_type` to `restopick_order_type_column` for consistent prefixing.
* Rename the checkout pickup HTML class from `woocommerce-pickup-fields` to `restopick-pickup-fields` (and the matching `__field-wrapper` modifier) so all in-plugin selectors share the same prefix.
* Rename the order-received pickup details HTML class from `woocommerce-pickup-details` to `restopick-pickup-details`.
* Drop redundant cross-plugin contract code comments and the now-unnecessary `phpcs:ignore` lines around prefixed hook names.

= 1.1.2 =
* Drop the Tips and Shortcode tab placeholders from the Settings page (those features now live entirely in the Pro companion plugin under their own admin sub-pages).
* Add a **Get Pro** admin sub-page that lists the Pro features and a CTA. The sub-page is only registered when the Pro plugin is not active.

= 1.1.1 =
* Drop Menu Hours UI from the free plugin (the feature now lives entirely in the Pro companion plugin under its own admin page).
* Rename the admin JS global from `wpcPickupAdmin` to `restopickPickupAdmin` for consistent prefixing.

= 1.0.0 =
* Initial release.
