=== WPAwesom3 Reseller Sync for WooCommerce ===
Contributors: wpawesom3
Tags: woocommerce, reseller, multistore, affiliate, voice, openai
Requires at least: 6.2
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.0.7
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Connect seller and reseller WooCommerce stores, sync products and commissions, and offer optional voice shopping powered by OpenAI.

== Description ==

https://youtu.be/-APOPHURkuk

WPAwesom3 Reseller Sync for WooCommerce connects two WooCommerce stores: a **Seller Store** and a **Reseller Store**.

The seller shares products; the reseller imports and sells them on their own storefront. Sales and commission data are tracked in a built-in ledger so both sides can monitor performance.

**New in 1.0.7 — Voice Shopping Assistant**

An optional storefront voice agent lets customers shop hands-free after a single mic tap:

* Search your WooCommerce catalog by speaking (English, Urdu, or Hinglish)
* Hear product names and prices read aloud
* Confirm and add items to the cart by voice
* Say "checkout" to go to the payment page
* Configure under **WPAwesom3 → Voice Assistant** (requires your own OpenAI API key)

Product search, pricing, and cart updates run securely on your server via WooCommerce APIs. OpenAI is used only to understand what the customer said.

**Reseller sync capabilities**

* Run as Seller, Reseller, or Both on one install
* Share products from the seller store; import on reseller stores
* Keep imported catalog data updated from the seller
* Referral-based Buy Now from reseller to seller checkout
* Commission ledger for referred sales
* Free tracking stats: page views, clickthroughs, top products and resellers
* Allowlist to control which reseller sites may connect
* Quick Connect pairing between stores

Ideal for partner selling, multi-store WooCommerce, and reseller networks.

== Installation ==

1. Upload the plugin to `/wp-content/plugins/` or install from the Plugins screen.
2. Activate the plugin (WooCommerce must be active).
3. Open **WPAwesom3 Reseller Sync** and configure seller URL, API keys, and Quick Connect.
4. *(Optional)* Open **WPAwesom3 → Voice Assistant**, enable the assistant, and add your OpenAI API key.

== How It Works ==

**Reseller flow**

1. Pair seller and reseller stores (Quick Connect or manual API keys).
2. Seller shares products; reseller imports them.
3. Customers buy on the reseller site; orders sync for commission tracking.
4. Review ledger and tracking stats in the admin.

**Voice shopping flow**

1. Customer taps the microphone button on your store.
2. They say what they want to buy; the assistant searches products and speaks prices.
3. They confirm; items are added to the cart.
4. They say checkout; the browser opens the WooCommerce checkout page.

== Frequently Asked Questions ==

= Does this require WooCommerce? =

Yes. All features require WooCommerce.

= Does the voice assistant require OpenAI? =

Yes, when enabled. Speech is sent to OpenAI for understanding. Add your API key under **Voice Assistant**, or define `WPRN_OPENAI_API_KEY` in `wp-config.php`. Cart and catalog actions stay on your server.

= Is the voice assistant required? =

No. Reseller sync works without it. Enable it only when you want voice shopping.

= Can I control which reseller sites connect? =

Yes. Use the allowlist in settings.

== Screenshots ==

1. Settings – Quick Connect and API configuration
2. Product import (reseller)
3. Commission ledger (seller)
4. Voice Assistant settings

== Changelog ==

= 1.0.7 =
* Added **Voice Shopping Assistant**: floating mic widget on the storefront powered by OpenAI.
* Customers can search products, hear prices, add to cart, and open checkout by voice (English, Urdu, Hinglish).
* New admin screen: **WPAwesom3 → Voice Assistant** (API key, speech language, rate limit, where to show the mic).
* Secure REST API and server-side WooCommerce tools for product search and cart (no direct DB access from the AI).

= 1.0.6 =
* Added REST endpoints `wprn/v1/debug-logs` and `wprn/v1/debug-logs/clear` for paired debug log aggregation.
* Reworked Flow debug admin: merged local and auth JSONL views, safer clear behavior.
* Reseller import matching by seller product ID / SKU; Quick Connect help tooltip.

= 1.0.5 =
* Quick Connect authorization status improvements and Flow debug enhancements.

= 1.0.4 =
* Quick Connect authorization status sync and public status-check endpoint.
* Improved pending/connected/disconnected and revoke handling.
* Auth lifecycle debug events; consistent seller/reseller callback handling.

= 1.0.3 =
* Free tracking stats and Tracking Stats admin screen.
* WPAwesom3 branding in readme.

= 1.0.2 =
* Integration stability and directory packaging updates.

= 1.0.1 =
* Review fixes: proper enqueue, nonces, WooCommerce dependency header.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.7 =
Adds optional Voice Shopping Assistant for hands-free product search and checkout. Set your OpenAI key under WPAwesom3 → Voice Assistant.

= 1.0.6 =
Debug log REST API, improved import matching, and Flow debug UI updates.

= 1.0.5 =
Quick Connect and debug workflow improvements.

= 1.0.4 =
Stronger Quick Connect status sync and disconnect handling.

= 1.0.3 =
Built-in tracking stats for reseller traffic.

= 1.0.2 =
Stability and compatibility update.

= 1.0.1 =
Security and coding standards update.

= 1.0.0 =
First public release.
