=== Skarb CRM for WooCommerce ===
Contributors: skarb
Tags: abandoned cart, crm, marketing automation, whatsapp, order tracking
Requires at least: 6.3
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

Abandoned cart recovery, marketing consent at checkout, "Shipped" and "Out for delivery" statuses and tracking for WooCommerce stores on Skarb.

== Description ==

[Skarb](https://skarb.com.br) is a CRM and marketing automation platform for online stores: e-mail and WhatsApp journeys, campaigns, sign-up forms and delivery tracking.

Skarb already connects to WooCommerce through the WooCommerce REST API (orders, customers, products and coupons). This plugin adds what the REST API does not have:

* **Abandoned cart recovery.** When a shopper types an e-mail or phone number at checkout and does not finish the purchase, the cart is sent to Skarb, which runs the store's recovery journey by e-mail or WhatsApp. The link in the message offers the same cart back (products, variations and quantities); after the shopper confirms, it opens the checkout.
* **Marketing consent at checkout.** An optional, unticked box ("I want to receive news and offers by e-mail and WhatsApp"). The exact sentence, date and IP are saved on the order as proof, and Skarb records the opt-in.
* **"Shipped" and "Out for delivery" order statuses.** Skarb follows the parcel at the carrier and moves the order along (when the store turns this on in Skarb). Both statuses count as paid in WooCommerce reports.
* **Tracking in My Account and in e-mails.** The tracking code and a "Track your order" button on the order page, in the orders list and in the customer e-mails.
* **Skarb forms on your site.** Pop-ups and sign-up forms built in Skarb, turned on from Skarb with one click.

Works with the classic checkout and the block checkout, and with High-Performance Order Storage (HPOS).

There is nothing to configure in WordPress: connect the store in Skarb and the plugin receives its settings automatically.

A Skarb account is required.

== Installation ==

1. Install and activate the plugin (Plugins → Add New → search for "Skarb").
2. Click **Connect to Skarb** (on the Plugins screen or in WooCommerce → Skarb). No account yet? Create one there — the trial is free.
3. In Skarb, click **Connect WooCommerce** (your store address is already filled in) and approve the access WooCommerce asks for. The plugin is configured automatically.
4. WooCommerce → Skarb shows "Connected" and what is on.

Already connected the store in Skarb before installing the plugin? Nothing to do: Skarb finds the plugin within the hour, or click **Configure plugin now** in Skarb → Platform.

== Frequently Asked Questions ==

= Do I need a Skarb account? =

Yes. The plugin connects WooCommerce to Skarb; without an account it does nothing.

= When is a cart considered abandoned? =

When there is no order from that shopper for the time set in Skarb (60 minutes by default) after the last change in the cart. Carts that become orders are never sent. Saved carts are deleted after 30 days.

= Does the plugin send e-mails to my customers? =

No. Messages are sent by Skarb, following the journeys the store turned on there. Changing the order status to "Shipped" or "Out for delivery" does not send any WooCommerce e-mail.

= My site has WP-Cron disabled. =

Carts are checked every five minutes by WP-Cron. If it is disabled, make sure a server cron calls wp-cron.php — Skarb also asks for waiting carts regularly.

= Can I remove the connection? =

Yes: WooCommerce → Skarb → "Remove the connection from this site", and remove the store in Skarb. Uninstalling the plugin deletes its table and settings.

== External services ==

This plugin connects to **Skarb** (https://skarb.com.br), the service the store subscribes to. It only talks to Skarb after the store was connected in Skarb, which sends the plugin the address it should use (app.skarb.com.br).

* **Abandoned carts:** when a cart with a contact has no order after the waiting time, the plugin sends to Skarb the contact typed at checkout (e-mail, phone, name), the cart items (product, variation, quantity, price, image), the total, the currency and the recovery link. Every request is signed with a secret shared with Skarb.
* **Connect button:** "Connect to Skarb" opens app.skarb.com.br with this store's address, so the sign-up or log-in screen can fill it in. Nothing is sent before you click it.
* **Connection check:** when Skarb configures the plugin, the plugin sends a signed test request with the site address and the plugin version.
* **Skarb forms:** when the store turns forms on in Skarb, the storefront loads the script https://app.skarb.com.br/captura.js with the store's public key. The script shows the forms the store built in Skarb and sends what visitors fill in to Skarb.
* Skarb reads orders and customers, and writes order statuses and tracking, through the WooCommerce REST API with the key the store owner approved.

Skarb terms of use: https://skarb.com.br/termos/
Skarb privacy policy: https://skarb.com.br/privacidade/

== Privacy ==

The plugin adds a suggested text to Settings → Privacy, and its saved carts to Tools → Export Personal Data and Tools → Erase Personal Data.

== Screenshots ==

1. The Skarb page under WooCommerce: the connection and what is turned on. Settings are changed in Skarb.
2. The optional, unticked marketing consent box at checkout.
3. The "Out for delivery" status in the WooCommerce orders list.

== Changelog ==

= 1.0.4 =
* Text domain changed to skarb, the plugin slug.

= 1.0.3 =
* The cart recovery link asks the shopper to confirm before the cart is rebuilt.

= 1.0.2 =
* Plugin renamed to Skarb CRM for WooCommerce.

= 1.0.1 =
* Admin CSS and JS are enqueued; the connect notice can be dismissed.
* The consent box is read with the checkout nonce checked.
* Translations come from translate.wordpress.org.

= 1.0.0 =
* First release: abandoned carts, marketing consent at checkout, "Shipped" and "Out for delivery" statuses, tracking in My Account and e-mails, Skarb forms on the site.
