=== WAGate for WooCommerce ===
Contributors: wagate
Tags: whatsapp, woocommerce, order notifications, abandoned cart, marketing
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 0.9.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Send automatic WhatsApp messages for WooCommerce events through your WAGate account.

== Description ==

WAGate for WooCommerce connects your store to your WAGate WhatsApp Business
account and sends WhatsApp messages automatically when orders are placed, paid,
completed, cancelled or refunded — using your own Meta-approved WhatsApp message
templates.

* One-click "Connect with WAGate" — no API keys to copy.
* Order lifecycle notifications out of the box.
* Map each store event to a WhatsApp template (with variables like order number,
  total and customer name) from your WAGate dashboard.
* Abandoned-cart recovery, review requests and AI replies are configured in
  WAGate (rolling out in stages).

Messages are sent from *your* connected WhatsApp number through WAGate. You need
a WAGate account with a connected WhatsApp number and at least one approved
template.

== Installation ==

1. Upload the `wagate-for-woocommerce` folder to `/wp-content/plugins/`, or
   install the zip via Plugins → Add New → Upload.
2. Activate the plugin.
3. Go to WooCommerce → WAGate and click **Connect with WAGate**.
4. Approve the connection in WAGate, then map your order events to templates in
   the WAGate dashboard under Integrations.

== Frequently Asked Questions ==

= Do I need a WAGate account? =
Yes. You can create one during the connection flow. You also need a connected
WhatsApp number and at least one approved template in WAGate.

= Why didn't a message send? =
Proactive WhatsApp messages require a Meta-approved template, and the customer's
billing phone must be a valid number. Check WooCommerce → Status → Logs (source
"wagate") for details.

== Changelog ==

= 0.9.0 =
* The plugin now speaks your language: the admin screens (and the checkout + My Account opt-in text) follow your WordPress panel language, with full translations for Hebrew, French, Russian and Arabic — right-to-left included.
* Easier opt-in field mapping: clearer inline messages instead of pop-ups, a field key you typed is added automatically when you press Save, and a brand-new field is ready to save right away.

= 0.8.0 =
* Live template previews: WAGate can show your WooCommerce message templates filled with real data from your most recent order (new secure /sample-order endpoint). Only the customer's first name is included in the preview.

= 0.7.3 =
* After activating the plugin you now land straight on the WAGate settings page, ready to connect your store.

= 0.7.2 =
* Field mapping now shows the actual values found in each field as checkboxes, so you can tick which one means "subscribed" instead of guessing.
* Add the same field key across several places at once (order, account and checkout) with checkboxes.

= 0.7.1 =
* Field mapping now supports MULTIPLE fields at once (an order field, an account field, a checkout field) — a customer counts as subscribed if any of them is positive.
* Pick the "subscribed" value from checkboxes of the actual values found in your field, instead of typing them.
* Removed the unused Advanced settings box.

= 0.7.0 =
* WhatsApp marketing opt-in: a consent checkbox at checkout (classic + block checkout, editable label, optional pre-check) - only customers who tick it join your WAGate marketing audience.
* Use a field you already collect: instead of our checkbox, scan your store for an existing consent field (another plugin's newsletter/SMS checkbox, a custom checkout field, or user meta), map which value means "subscribed", and WAGate reads it - no duplicate checkbox.
* One-click import of everyone who already consented in the mapped field, with consent recorded.
* My Account: customers can opt in or out of WhatsApp updates any time; the toggle reflects their real WAGate subscription status (a STOP reply shows as opted out).

= 0.6.0 =
* Marketing Hub support: WAGate can import your past customers into its subscriber lists (new HMAC-verified /customers endpoint) and auto-subscribe new customers from incoming orders.

= 0.5.0 =
* Live product answers for the WAGate AI assistant: a new HMAC-verified /product-lookup endpoint returns price, stock and link for the products a customer asks about.
* Security: order lookups by order number now also require the requester's phone to match the order's billing phone.

= 0.4.0 =
* Branded admin dashboard: real WAGate logo, modern light UI, toggle switches.
* One-click "Check for updates" button.
* Footer credit to Activated Digital.

= 0.3.0 =
* New settings dashboard: send a test WhatsApp, a live activity feed, and 7/30-day stats.
* Abandoned-cart recovery: captures the phone at checkout and sends a WhatsApp nudge with a one-click link back to the cart.
* New-order WhatsApp alerts to the store owner.
* Tested with WordPress 7.0.

= 0.2.0 =
* Automatic updates: the plugin updates itself from WAGate — no manual re-upload.
* Brand icon shown in the Plugins screen and update card.

= 0.1.0 =
* Initial release: one-click connect + order lifecycle events.
