=== SetaLabs External Catalog ===
Contributors: setalabscom
Tags: woocommerce, catalog, external, marketplace, api
Requires at least: 6.9
Tested up to: 7.0
Requires PHP: 8.1
Requires Plugins: woocommerce
Stable tag: 1.0.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Connects a SetaLabs-powered external marketplace catalog to WooCommerce. Works with any theme.

== Description ==

WordPress/WooCommerce plugin that connects product and category catalog data from the **SetaLabs marketplace API / OT Box-compatible API** to your store.

Products are not stored in WordPress until checkout — they are rendered on the fly through WooCommerce template hooks. When a customer purchases, the item is materialized as a real `WC_Product` for orders, admin, and reports.

**Key features:**

* Virtual OT product catalog at customizable URLs
* Any WordPress theme via standard WooCommerce hooks
* OT API response caching via WordPress transients
* HPOS (High-Performance Order Storage) compatible
* Settings page at WooCommerce → SetaLabs Catalog

**Virtual URLs (default slugs):**

* `/otc-catalog/` — OT category tree
* `/otc-product/{slug}/` — product page from OT API
* `/otc-search/` — search with filters and AJAX; search form shortcode: `[otc_ec_search_form]`

Slugs are editable in WooCommerce → SetaLabs Catalog → Settings (`catalog_slug`, `product_slug`, `search_slug`).

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/` or install via **Plugins → Add New**.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Go to **WooCommerce → SetaLabs Catalog** and enter your API Base URL and Instance Key.
4. After activation, virtual catalog URLs become available (defaults listed above).
5. If virtual pages return 404, visit **Settings → Permalinks** and click **Save Changes** (rewrite rules are also flushed automatically on plugin upgrade).

== Frequently Asked Questions ==

= Where do I get an Instance Key? =

Contact SetaLabs at https://setalabs.com/ to obtain your API credentials.

= What WooCommerce versions are supported? =

WooCommerce 8.0 and above. Tested with WooCommerce 9.4.

== External services ==

This plugin connects to the **SetaLabs marketplace API / configured OT Box-compatible endpoint** to fetch product catalog data, categories, and search results.

After an administrator configures an Instance Key, the site sends that key plus product IDs, category IDs, search terms, filter values, and language parameters required to retrieve catalog data. If a visitor explicitly uses photo search, the selected image file is uploaded to OT Box for matching. The plugin does not intentionally send WordPress account, order, billing, shipping, or contact data to OT Box.

SetaLabs terms: https://setalabs.com/legal/terms-and-conditions.html

SetaLabs privacy policy: https://setalabs.com/legal/privacy-policy.html

== Changelog ==

= 1.0.2 =
* WordPress.org review fixes: enqueue debug panel assets, keep instance_secret unslashed-only, drop bundled locale .po/.mo from release ZIP.

= 1.0.1 =
* Updated WordPress.org plugin metadata to match the assigned plugin slug.
* Improved output escaping and documented intentional PHPCS exceptions.

= 1.0.0 =
* Initial release: settings page, AJAX diagnostics (API ping, cache flush), plugin architecture.
* Virtual catalog page `/otc-catalog/` with OT category tree; slug configurable via `catalog_slug`.
* Theme-overridable template: `templates/otc-catalog/catalog.php` → `yourtheme/woocommerce/otc-catalog/catalog.php`.
* Virtual product page `/otc-product/{slug}/` and search page `/otc-search/` with filters, pagination, and AJAX.
* Theme-overridable templates: `single-product.php`, `search.php` under `templates/otc-catalog/`.

== Translators ==

Translation template: `languages/setalabs-external-catalog.pot`
Community translations are managed on translate.wordpress.org after directory approval.
Locale `.po`/`.mo` files may exist in the development repository for local testing and are excluded from the WordPress.org release package.

== Upgrade Notice ==

= 1.0.2 =
WordPress.org Plugin Directory review fixes.

= 1.0.1 =
WordPress.org compatibility and code-quality improvements.

= 1.0.0 =
Initial release.
