=== Aronity for WooCommerce ===
Contributors: wizwebitsolutions
Tags: woocommerce, crm, abandoned cart, cart recovery, leads
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Connect your WooCommerce store to Aronity CRM to automatically sync customers, orders, and recover abandoned carts with 1-click links.

== Description ==

**Aronity for WooCommerce** connects your WooCommerce store to Aronity CRM in real-time. It synchronizes customers and order lifecycles into your CRM, captures abandoned carts directly from the checkout page as shoppers type, and provides dynamic 1-click cart recovery links.

= Key Features =

* **Automated Customer & Order Sync**: Orders in selected statuses (Processing, Completed, On hold, Cancelled, Refunded) are immediately dispatched to Aronity CRM as enriched customer journeys.
* **Real-Time Abandoned Cart Capture**: Captures customer phone and email on the checkout page before order submission.
* **1-Click Cart Recovery**: Generates a secure, direct link that restores the shopper's exact cart items, variations, quantities, and pre-fills their checkout billing details.
* **Action Scheduler Background Processing**: Asynchronous background dispatching ensures your checkout page speed is never impacted.
* **HPOS Compatible**: Declares compatibility with WooCommerce High-Performance Order Storage (Custom Order Tables).
* **Cart & Checkout Blocks Compatible**: Seamlessly works with both Classic shortcode checkout and modern WooCommerce Checkout Blocks.
* **Privacy Tools**: Saved abandoned carts are removed after 90 days and are included in the WordPress Personal Data Export & Erasure tools.

== External Services ==

This plugin relies on and connects to Aronity CRM via the Aronity API (https://api.aronity.com) to synchronize WooCommerce customers, orders, and abandoned checkout carts for automated CRM workflows, marketing automation, and WhatsApp communications.

* **What the service is and what it is used for**: Aronity CRM is an omnichannel customer relationship management (CRM) and marketing automation platform. This plugin connects your WooCommerce store to your Aronity CRM account to store customer contact details, log order purchase history in customer timelines, trigger post-purchase workflows (such as order status updates, WhatsApp notifications, review requests), and send 1-click cart recovery links for abandoned carts.
* **What data is sent**:
  - Customer contact details: Full name, email address, phone number, and billing/shipping country.
  - Order details: Order ID, order status, total amount, line items (product names, quantities), and payment method.
  - Abandoned cart details: Captured customer checkout details (name, email, phone), cart item list, total value, and 1-click cart recovery link.
  - Your Aronity API key and your store's website address, sent with every request to identify your account and store.
* **When data is sent**:
  - When an order reaches any of your selected order statuses (e.g., Processing, Completed, Cancelled, Refunded, On hold).
  - When a store manager manually clicks "Send to Aronity" in the order actions panel.
  - When a shopper enters contact details on checkout and leaves without completing purchase after the configured inactivity delay (e.g., 60 minutes).
  - When clicking "Test connection" in the plugin settings to verify your Aronity API key.
* **Service provider**: Aronity, operated by Wizweb IT Solutions Pvt. Ltd. (https://www.aronity.com).
* **Terms of Service**: https://www.aronity.com/legal/terms-of-service
* **Privacy Policy**: https://www.aronity.com/legal/privacy-policy

== Installation ==

1. Upload the `aronity-for-woocommerce` folder to the `/wp-content/plugins/` directory, or install the .zip directly via **Plugins > Add New > Upload Plugin** in your WordPress admin.
2. Activate the plugin through the **Plugins** screen in WordPress.
3. Navigate to **WooCommerce > Settings > Integration > Aronity**.
4. Enter your Aronity API Key (found in your Aronity account under Settings > API Keys).
5. Click **Test connection** to verify communication, then configure your desired order statuses and abandoned cart settings.

== Frequently Asked Questions ==

= Where do I find my Aronity API Key? =
Log in to your Aronity CRM account, navigate to Settings > API Keys, and copy your private API key.

= How does 1-Click Cart Recovery work? =
When an abandoned cart is detected after your configured inactivity delay (e.g. 20-30 minutes), Aronity generates a secure tokenized recovery link. When clicked (e.g. via WhatsApp or SMS), WooCommerce automatically clears the temporary basket, re-adds the exact items and variations, pre-fills the checkout fields, and redirects the shopper directly to the checkout page.

= Does this plugin slow down the checkout process? =
No. All API communications with Aronity CRM are queued and processed asynchronously in the background via Action Scheduler.

= Is this plugin compatible with WooCommerce HPOS? =
Yes! It is fully certified and compatible with WooCommerce High-Performance Order Storage (HPOS).

== Screenshots ==

1. Aronity for WooCommerce settings screen under WooCommerce > Settings > Integration.
2. Order actions box with manual "Send to Aronity" option and sync status notes.
3. Aronity CRM user portal displaying real-time WooCommerce order and cart sync.

== Changelog ==

= 1.0.4 =
* Fixed 1-click cart recovery links being ignored when opened.
* Fixed the abandoned carts table definition for MySQL versions that do not allow defaults on text columns.
* Plugin URI now points to the live Aronity for WooCommerce page on aronity.com
* Tested with WooCommerce 11.2.
* Clarified in the readme what is sent to Aronity and where to find the API key.

= 1.0.3 =
* WordPress.org review compliance updates.
* Added `Requires Plugins: woocommerce` header for WordPress 6.5+ plugin dependency management.
* Replaced inline JavaScript with external enqueued script (`assets/js/admin-settings.js`) and `wp_localize_script`.
* Strict capability and nonce checks for all AJAX requests and administrative actions.
* Documented external Aronity CRM API services with links to Terms of Service and Privacy Policy.

= 1.0.2 =
* Bidirectional order status sync and status reversal support (e.g. On-Hold back to Processing, or reopened from Cancelled).
* Dedicated deduplication meta `_aronity_last_synced_status` to allow multi-stage transitions without permanent locks.

= 1.0.1 =
* Intelligent Cash-on-Delivery (COD) vs Prepaid stage detection.
* Automated dynamic order status mapping for Aronity CRM Journey Steps (`COD Pending Verification`, `Processing`, `Completed`, `Cancelled`).
* Clarified Aronity lead status setting to support multi-stage pipeline automation without forced overrides.

= 1.0.0 =
* Official release for WordPress.org Plugin Directory.
* Real-time checkout cart capture with tokenized 1-click direct recovery.
* Background customer and order synchronization to Aronity CRM via Action Scheduler.
* Custom lead field mapping for checkout recovery URL (`field_checkout_url`).
* GDPR data export and erasure hooks.
* High-Performance Order Storage (HPOS) and Cart & Checkout Blocks compatibility.
