=== Foxta ===
Contributors: pointwels
Tags: pos, erp, inventory, stock, woocommerce
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
Stable tag: 0.9.13
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Sync your WooCommerce store with Foxta (ERP/POS): two-way sync of products, stock, prices and orders between your shop and your website.

== Description ==

Foxta links your online store with the Foxta ERP/POS so that stock, prices and orders stay aligned between your physical shop and your WooCommerce store.

Foxta and Foxta Comercio are products of the plugin author. This plugin is an independent integration and is not affiliated with, endorsed by, or sponsored by WooCommerce or Automattic.

Features:

* Two-way sync of products, stock, prices, descriptions, images and categories.
* Online-store orders are sent to Foxta as soon as they happen.
* **Retry queue**: if the connection fails, no event is lost; it is re-sent automatically.
* **Reconciliation**: detects and fixes mismatches between the store and Foxta.
* Compatible with **HPOS** (High-Performance Order Storage).
* Support for variable products (variations).
* Diagnostics screen (queue status, HPOS, connection).

You need a Foxta account (https://panel.foxta.app) to obtain your store token. The plugin does nothing on its own until you connect it to your account.

== External services ==

This plugin connects your store with **Foxta Comercio**, an ERP/POS service by the plugin author, to keep stock, prices and orders synchronized between your WooCommerce store and your Foxta account.

When and what data is sent: only when the administrator enables synchronization and enters their token. In that case, when products, stock or orders are created or modified, the plugin sends to the Foxta API the product data (name, SKU, price, stock, category, image URL, description) and the order data (line items, totals, and the order's billing name and email). Nothing is sent while synchronization is disabled.

Where the data is sent: to the Foxta API hosted at `https://ffvuyvsmnepwvsrkofjt.supabase.co` (configurable in the plugin settings).

This service is provided by Foxta. See its terms and privacy policy:
- Terms: https://foxta.app/terminos.html
- Privacy: https://foxta.app/privacidad.html

== Installation ==

1. Upload the `foxta-comercio` folder to `/wp-content/plugins/`, or install the ZIP from Plugins > Add New > Upload.
2. Activate the plugin.
3. Go to WooCommerce > Foxta Comercio.
4. Paste the Endpoint, the API key and the Token from your Foxta Comercio panel, tick "Enable" and save.
5. Use "Test connection" to verify.

== Frequently Asked Questions ==

= Do I need WooCommerce? =
Yes. The plugin requires WooCommerce to be active.

= Is any change lost if the internet goes down? =
No. Changes are stored in a local queue and re-sent automatically when the connection is restored.

= Does it work with HPOS? =
Yes, the plugin declares compatibility with WooCommerce High-Performance Order Storage.

= Is this an official WooCommerce plugin? =
No. It is an independent integration built by Foxta. It is not affiliated with WooCommerce or Automattic.

== Changelog ==

= 0.9.13 =
* Renamed the plugin to "Foxta" (same plugin, clearer brand).
* Compatibility: the REST token is now also accepted via the standard Authorization: Bearer header (and a query-param fallback), so it keeps working on hosts/firewalls/CDNs that strip non-standard headers.
* Compatibility: orders placed through the new block-based checkout (Store API) are now captured reliably.
* Security: the API key and store token fields are masked in settings.
* Hardening: guard against the plugin being loaded twice (duplicate copies no longer double every sync event).
* Self-reporting: the plugin now reports its own fatals/exceptions and dead-letter queue events to the Foxta support console (rate-limited, technical metadata only) so issues can be detected and fixed faster.

= 0.9.12 =
* New read-only endpoint (foxta/v1/orders, paginated) so Foxta can do a one-time import of the store's past orders into the ERP for full sales history and AI analysis. No data is written to the store.

= 0.9.11 =
* Health diagnostics: the plugin now reports environment info (WP/PHP/WooCommerce, HPOS, queue status) and detects likely conflicts (caching, security/firewall, other POS/sync plugins) so the Foxta Support console can show and help fix installation issues. New "Send diagnostics to support" button.

= 0.9.10 =
* Performance & resilience: the retry queue no longer floods Action Scheduler (one flush is scheduled at a time instead of one action per event). Smaller batches with shorter timeouts, a circuit breaker that backs off when the endpoint is unreachable, automatic pruning of old queue rows, and a new "Discard queue & retries" button to clear an accumulated backlog. Prevents site slowdowns caused by a growing queue.

= 0.9.9 =
* Two-way sync of multiple categories, product tags and custom attributes. CDN-friendly images: a product image is only re-downloaded when its URL changes (no duplicate media on repeated syncs).

= 0.9.8 =
* Sends product brand to Foxta when available (native WooCommerce Brands, common brand plugins, or a "brand/marca" attribute). Nothing is sent if the store has no brand data.

= 0.9.7 =
* Orders with "local pickup" shipping are flagged to Foxta as in-store pickup (Click & Collect); billing phone is sent so the shop can notify the customer.

= 0.9.6 =
* Endpoint to create a Foxta customer as a WooCommerce account (set-password email).

= 0.9.5 =
* Readme translated to English; clarified third-party affiliation; fixed external-service links.

= 0.9.0 =
* Hardened for distribution (nonces, prepared queries, license, text domain, uninstall cleanup).

= 0.8.0 =
* Variation support in snapshot and sync.

= 0.7.0 =
* Retry queue (outbox), reconciliation (snapshot/health), HPOS compatibility and diagnostics.

= 0.6.0 =
* Category synchronization.

== Upgrade Notice ==

= 0.9.5 =
English readme and clearer service disclosure for the WordPress.org directory.
