=== FlashQ 1-Hour Delivery ===
Contributors: engahmeds3ed
Tags: woocommerce, delivery, shipping, fast-delivery, logistics
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Enable 1-hour delivery for your WooCommerce store with the FlashQ logistics network.

== Description ==

FlashQ 1-Hour Delivery integrates your WooCommerce store with FlashQ's rapid delivery network, enabling you to offer 1-hour delivery to customers in supported regions across Egypt.

**Features:**

* 1-Hour Delivery - Offer ultra-fast delivery in select districts
* Region-Based Availability - Automatic region detection and product filtering
* Real-Time Inventory Sync - Automatic stock updates from FlashQ
* Customizable UI - 4 header banner styles to match your brand
* Flexible Pricing - Support for free shipping thresholds
* Smart ETA Calculation - Automatic delivery time based on order time
* Order Status Sync - Real-time updates from FlashQ to your store
* API Logging - Built-in logging for debugging and compliance

**How It Works:**

1. Customer selects their delivery region
2. System shows only products available for 1-hour delivery in that region
3. At checkout, customer gets 1-hour delivery option if eligible
4. Order automatically sent to FlashQ for fulfillment
5. Real-time status updates sync back to WooCommerce

**Requirements:**

* WooCommerce 6.0 or higher
* FlashQ API credentials (contact FlashQ for access)
* Products with matching SKUs in FlashQ inventory

== Installation ==

**Automatic Installation:**

1. Go to Plugins > Add New
2. Search for "FlashQ 1-Hour Delivery"
3. Click "Install Now"
4. Activate the plugin

**Manual Installation:**

1. Download the plugin ZIP file
2. Go to Plugins > Add New > Upload Plugin
3. Choose the ZIP file and click "Install Now"
4. Activate the plugin

**Configuration:**

1. Go to WooCommerce > FlashQ 1-Hour
2. Enter your FlashQ API credentials:
   - API URL
   - API Key
   - HMAC Secret
3. Configure general settings (operating hours, delivery time, etc.)
4. Set up the FlashQ shipping method in WooCommerce > Settings > Shipping
5. Share your webhook URL with the FlashQ team

== Frequently Asked Questions ==

= Do I need a FlashQ account? =

Yes, you need to sign up with FlashQ and obtain API credentials. Contact FlashQ at https://flashq.io

= Which regions support 1-hour delivery? =

Currently available in select districts across Cairo and Giza. The list of supported regions is updated automatically with plugin updates.

= How is inventory synced? =

FlashQ sends automatic inventory updates to your store via webhooks whenever stock changes. Your main WooCommerce inventory remains separate.

= What happens if a product is out of stock? =

If a product is available in FlashQ inventory, it will be shown as available for 1-hour delivery regardless of your main WooCommerce stock.

= Can I customize the header banner? =

Yes. You can choose from 4 pre-designed styles in WooCommerce > FlashQ 1-Hour > General settings.

= How are orders sent to FlashQ? =

When a customer selects FlashQ 1-hour delivery and completes checkout, the order is automatically sent to FlashQ's API for fulfillment with an HMAC-signed request.

= What if the FlashQ API is down? =

The order will still be created in WooCommerce with a note indicating the API failure. The plugin will automatically retry up to 3 times (at +1, +3, and +5 minutes).

= Is my data secure? =

Yes. All outbound requests to FlashQ are signed with HMAC-SHA256. Inbound webhook requests are authenticated with an auto-generated API key. No sensitive data is exposed in the frontend.

== Screenshots ==

1. Header banner inviting customers to check 1-hour delivery availability
2. Region selection modal with search functionality
3. Dedicated product page showing 1-hour delivery items
4. Checkout with region selection and 1-hour shipping option
5. Admin settings page for API configuration
6. Regions management showing active delivery areas
7. API logs for debugging and monitoring

== Changelog ==

= 1.0.4 =
* ### Other: feat: WPML Arabic support for checkout city dropdown (#138)
* ### Other: Release v1.0.4 (#139)

= 1.0.3 =
* ### Other: docs: update plugin documentation and add template overrides guide (#134)
* ### Other: fix: remove duplicate regions from checkout dropdown (#135)
* ### Other: feat: show Arabic region names in checkout when WPML language is Arabic (#136)
* ### Other: Release v1.0.3 (#137)

= 1.0.2 =
* ### Other: fix: round bundle sub-product prices correctly (#132)
* ### Other: Release v1.0.2 (#133)

= 1.0.1 =
* ### Other: feat: merge regions into single sortable table with manual ordering (#126)
* ### Other: feat: auto-update readme.txt and deploy to WordPress.org SVN on release (#128)
* ### Other: Release v1.0.1 (#129)
* ### Other: Release v1.0.1 (#130)

= 1.0.0 =
* Initial release
* 1-hour delivery shipping method
* Region-based product filtering
* Real-time inventory sync via webhooks
* Order status synchronization
* Customizable header banner (4 styles)
* Region selection modal
* Dedicated product page
* API logging and monitoring
* Automatic order retry on API failure (3 retries)
* HMAC-SHA256 signed outbound requests
* WooCommerce HPOS compatibility

== Upgrade Notice ==

= 1.0.0 =
Initial release of FlashQ 1-Hour Delivery plugin.

== Developer Documentation ==

**Hooks & Filters:**

Action: `flashq_shipping_upgrade`
Fires when the plugin version is upgraded.
Parameters: `$old_version` (string), `$new_version` (string)

Filter: `flashq_shipping_regions`
Modify the list of available regions before they are displayed.
Parameter: `$regions` (array)

Filter: `flashq_shipping_payment_map`
Customize the payment method mapping sent to FlashQ.
Parameter: `$payment_map` (array)

**REST API Endpoints:**

`POST /wp-json/flashq/v1/webhook`
Receive inventory and order-status updates from FlashQ.
Authentication: `X-FlashQ-API-Key` header (auto-generated; see WooCommerce > FlashQ 1-Hour > API Configuration)

`GET /wp-json/flashq/v1/regions`
Return all active regions flagged for display in the customer modal.
Authentication: none required.

`POST /wp-json/flashq/v1/regions/select`
Store the customer's selected region in their WooCommerce session.
Authentication: WP REST nonce (`X-WP-Nonce` header).

**More Information:**

* Documentation: https://github.com/wordpressfan/flashq-shipping/blob/trunk/docs/PLUGIN_DOCUMENTATION.md
* Support: https://github.com/wordpressfan/flashq-shipping/issues
