=== AISmart Content Commerce ===
Contributors: aismartcontent
Tags: woocommerce, live chat, cart recovery, order notifications
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 7.4
Requires Plugins: woocommerce, aismart-content-chat
Stable tag: 1.5.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

WooCommerce catalog, order, and cart recovery sync for AISmart Content Chat. Uses the existing chat connection; never adds a second widget.

== Description ==

AISmart Content Commerce is a companion extension for **AISmart Content Chat** and **WooCommerce**. It reuses your site's existing AISmart Content Chat installation connection to provide storefront product cards, catalog synchronization, order status context, and cart recovery workflows without adding a second chat widget.

Key features:

* **Opt-in Commerce Sync:** Catalog synchronization, order context sync, cart recovery snapshots, remote publication, and remote catalog management are all disabled by default on fresh installations until enabled by a store manager.
* **Storefront Cart Bridge:** Lets customers view cart contents and add available simple or variable products directly from chat conversations using native WooCommerce validation.
* **Catalog Synchronization:** Sends paged product and variation metadata (titles, prices, stock status, categories, and full-resolution gallery image URLs) to your connected AISmart Content workspace when enabled.
* **Order & Cart Recovery Context:** Optionally shares order updates and active cart snapshots with your AISmart Content workspace so support and recovery automations have accurate context.
* **Verified Remote Management:** Optional store-manager-approved remote publication and catalog management with signed command verification, product locks, and idempotent operation receipts.

== External Services ==

This plugin connects to the AISmartContent Chat Service (`https://telewhats.com`) operated by AISmartContent.co,ltd through the authenticated **AISmart Content Chat** installation connection:

1. **Catalog Synchronization & Management** (`https://telewhats.com/api/integrations/webchat/wordpress/commerce/catalog`, `/products`, `/catalog/verify`, `/publication/verify`):
   When enabled by a store manager, the plugin sends store URL, currency, product and variation IDs, SKUs, names, prices, stock quantities/statuses, permalinks, categories/tags/brands, and image URLs to the service, and verifies signed catalog or publication commands issued from the connected workspace.
2. **Order Context Synchronization** (`https://telewhats.com/api/integrations/webchat/wordpress/commerce/order`):
   When **Orders & conversations** is enabled, order creation and status changes send the site URL, order ID/number, status, total, currency, billing customer name and email, admin order URL, and line item summaries to the service.
3. **Cart Recovery & Storefront Shopper Context** (`https://telewhats.com/api/integrations/webchat/wordpress/commerce/cart`, `/shopper-context`):
   When **Cart recovery** is enabled or a shopper interacts with the connected chat widget, the plugin sends cart hash/session token, cart totals, currency, checkout URL, item summaries, and (for signed-in customers or checkout sessions) customer name, billing email, and up to five recent order summaries to the service.

* AISmartContent Chat Service: https://telewhats.com
* Service Privacy Policy: https://telewhats.com/privacy
* AISmartContent Privacy Policy: https://aismartcontent.co/privacy-policy
* Terms of Service: https://aismartcontent.co/terms

== Installation ==

1. Install and activate **WooCommerce** and **AISmart Content Chat**, then connect **AISmart Content Chat** to your workspace.
2. Upload the `aismart-content-commerce` folder to `/wp-content/plugins/` or install the plugin ZIP through the WordPress admin.
3. Activate **AISmart Content Commerce** in the **Plugins** menu.
4. Open **WooCommerce > AISmart Content Commerce** and enable the synchronization features (**Catalog synchronization**, **Orders & conversations**, **Cart recovery**, **Remote publication**, or **Remote catalog management**) that your store requires.

== Frequently Asked Questions ==

= Does this plugin send store or customer data immediately upon activation? =

No. All synchronization settings (`catalog_sync`, `order_sync`, `cart_recovery`, `remote_publication`, and `remote_catalog_management`) default to `false` on fresh installations until a store manager enables them and connects AISmart Content Chat.

= Does this plugin add a second chat widget to my storefront? =

No. It uses the single storefront widget provided by AISmart Content Chat.

== Changelog ==

= 1.5.0 =
* Renamed to AISmart Content Commerce to match AISmart Content Chat. Settings from the earlier build move to the new name automatically on activation.

= 1.4.0 =
* Add optional remote catalog management through the existing signed installation connection, disabled by default.
* Edit supported product fields and variants, reconcile downloaded image identities, and move confirmed source deletions to Trash.
* Create explicitly selected cross-platform copies as drafts; publication remains a separate approval and action.
* Keep durable operation receipts and database product locks for retry-safe writes and draft exports.
* Preserve managed-export provenance so destination copies cannot be reimported as duplicate native products.

= 1.3.0 =
* Share the current WooCommerce cart with its signed chat session through the installed connection.
* Add recommended products using WooCommerce stock, option, quantity, and cart validation.
* Supply up to five recent orders only for the signed-in store customer when order sync is enabled. Guest-supplied email addresses never select order history.

= 1.2.0 =
* Add store-manager-approved remote publication, disabled by default, through the existing installed chat connection.
* Verify short-lived, installation-bound commands before changing product status and reject repeated commands.
* Export explicit source publication independently of ShoppungPung publication and catalog sync preferences.

= 1.1.1 =
* Export complete featured and gallery image lists at full resolution, including variation images.
* Keep source image order and send the complete gallery through the existing ShoppungPung catalog connection.

= 1.1.0 =
* Complete paged product metadata and variant snapshots, refreshed on product changes and daily.
* Seller-scoped ShoppungPung import status and CF Live eligibility in the native WooCommerce product list.
* Shopify connection status is separate from product synchronization; products are not automatically copied between stores.