=== Nanokart for WooCommerce ===
Contributors: abinashnanokart, nanokart
Tags: woocommerce, virtual try-on, nanokart, fashion, size recommendation
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 8.0
Requires Plugins: woocommerce
Stable tag: 0.1.5
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Nanokart virtual try-on for WooCommerce: Tryon Studio, per-product size charts, Moments, and add to cart.

== External services ==

This plugin connects your storefront to **Nanokart** (NanoKart India Private Limited), an AI platform that powers virtual try-on, optional "Moments" lifestyle scenes, and AI-assisted size recommendations.

* **When:** Each time a shopper uses Tryon Studio, size recommendation, or related features, your site sends the request to Nanokart’s API using the API key you save under WooCommerce → Nanokart.
* **What is sent:** Product image URLs, optional shopper-uploaded photos, optional garment uploads, height and size-chart data you configure, optional store/customer labels you set, and API authentication headers (`X-API-Key`, optional `X-Partner-Id`). Responses (e.g. generated image URLs, try-on keys, size suggestions) are returned through your WordPress site to the shopper’s browser.
* **Legal:** Nanokart [Terms & Conditions](https://nanokart.ai/terms), [Privacy Policy](https://nanokart.ai/privacy).

== Description ==

**Nanokart for WooCommerce** brings [Nanokart](https://nanokart.ai) virtual try-on to your store. Shoppers open **Tryon Studio** from the product page; try-on and size requests are sent to your **Nanokart Try-On API** through your WordPress site, with API keys stored in **WooCommerce → Nanokart**.

= Features =

* **Tryon Studio** button on product pages (when the product has an image and Nanokart is configured).
* **Size recommendations** using measurement data you provide as JSON.
* **Per-product size charts** — edit **Edit size chart (JSON)** under *Product data → General* for each product; leave empty to use the store default from Nanokart settings.
* **Variable products** — set the size chart on the **parent** product; variations inherit it.
* **Optional Moments** — enable or restrict scene types (e.g. workday, unwind) in Nanokart settings.
* **Add to cart** after try-on, integrated with WooCommerce AJAX cart behavior.

= Requirements =

* WordPress 6.0 or higher
* PHP 8.0 or higher
* WooCommerce 8.0 or higher
* A Nanokart account and Try-On API URL + API key (configured in **WooCommerce → Nanokart**)

== Installation ==

1. Upload the plugin files to `/wp-content/plugins/nanokart-for-woocommerce/` (WordPress.org uses this slug; your zip’s top-level folder should match), or install the zip from **Plugins → Add New → Upload Plugin**.
2. Activate **Nanokart for WooCommerce** through the **Plugins** screen.
3. Ensure **WooCommerce** is installed and active.
4. Go to **WooCommerce → Nanokart** and enter your **Try-On API URL**, **API key**, and any optional defaults (default size chart JSON, Moments, etc.).
5. Edit each product that should offer try-on and add **Edit size chart (JSON)** if that product needs its own measurements.

== Frequently Asked Questions ==

= Where do I configure the plugin? =

**WooCommerce → Nanokart** — API URL, API key, default size chart, Moments, and related options.

= Where do I set a different size chart per product? =

Edit the product → **Product data** → **General** → **Edit size chart (JSON)**. Must be valid JSON. Clear the field to fall back to the store default.

= Does this work with variable products? =

Yes. Set **Edit size chart (JSON)** on the **parent** variable product.

= What folder name / text domain should I use? =

Use the slug **`nanokart-for-woocommerce`** (allowed “for WooCommerce” pattern on WordPress.org). The **Text Domain** in code matches that slug; WordPress loads translations automatically for plugins hosted on WordPress.org—no manual `load_plugin_textdomain()` call is required.

== Changelog ==

= 0.1.5 =
* Security: nonces on rewrite API routes, stricter upload MIME handling, JSON/size-chart sanitization before proxying to Nanokart.
* `Requires Plugins: woocommerce` header; readme external-service disclosure with Terms/Privacy links; prefixed product meta key `nnk_woo_size_chart_cm` (legacy `size_chart_cm` still read).
* Settings: default size chart JSON normalized on save.

= 0.1.4 =
* Text domain set to `nanokart-for-woocommerce` (matches recommended WordPress.org slug).
* Removed `load_plugin_textdomain()` (discouraged on WordPress.org since WP 4.6; core loads translations).

= 0.1.3 =
* Plugin header: GPLv2 license; `/languages` folder for translators.
* PHPCS/Plugin Check: safer `$_SERVER` handling, multipart/POST annotations, readme short description length and Tested up to.

= 0.1.2 =
* Per-product size chart field (**Edit size chart (JSON)**) on product edit screen.
* Readme and documentation updates.

= 0.1.1 =
* Earlier releases and refinements (Tryon Studio, WooCommerce cart integration, Moments settings).

== Upgrade Notice ==

= 0.1.5 =
Security hardening and WooCommerce dependency header; migrate per-product size charts by re-saving products if you rely on the old meta key.

= 0.1.4 =
Text domain `nanokart-for-woocommerce`; removed manual `load_plugin_textdomain` for WordPress.org compatibility.

= 0.1.3 =
Plugin Check fixes: license header, readme metadata, and security sniff cleanups.

= 0.1.2 =
Adds per-product size chart editing in the product editor and readme for directory submission.
