=== Cerquito – Print on Demand for Online Stores ===
Contributors: cerquitomx
Tags: print on demand, woocommerce, dropshipping, fulfillment, orders
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Requires Plugins: woocommerce
Stable tag: 1.3.2
WC requires at least: 7.0
WC tested up to: 11.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Print on demand for your online store: paid orders with Cerquito products go to production and the tracking number returns to your store.

== Description ==

Cerquito connects your WooCommerce store to Cerquito, the network that makes your orders at independent print shops in Mexico. This plugin requires WooCommerce.

* Simple connection: paste the key from your Cerquito dashboard. No WooCommerce API keys to copy.
* Only orders that contain at least one Cerquito product are sent to Cerquito. Your other orders never leave your site.
* Once an order is paid, Cerquito receives it and sends it to production. Cash on delivery, on-hold and unpaid orders are not produced.
* When the order ships, Cerquito marks it as shipped in your store, saves the tracking number and adds a note for your customer.
* When your customer receives the parcel, Cerquito leaves the order as delivered in your store, with a private order note.
* Test orders: the order action "Mark as Cerquito test order" keeps your own test order from reaching a print shop.
* If a customer changes the address or the items of an order that a print shop already has, Cerquito stops the job and alerts its team.
* Products created by Cerquito are tagged "Produced by Cerquito" in your product list.
* Settings screen at WooCommerce > Cerquito: connection status, test connection, disconnect, and the last 20 events.
* Compatible with High-Performance Order Storage (custom order tables).
* The interface is in English, with a complete Spanish (Mexico) translation used for every Spanish locale.

Cerquito makes no delivery-date or sales promises. Timing depends on the print shop and the carrier. A Cerquito account is required to use the plugin.

== Installation ==

1. Upload the `cerquito` folder to `/wp-content/plugins/`, or install the .zip from Plugins > Add New > Upload Plugin.
2. Activate it. WooCommerce 7.0 or later must be active, and your store needs https, prices in Mexican pesos (MXN) and permalinks other than Plain.
3. In your Cerquito dashboard open Stores and choose Connect WooCommerce. Copy the connection key (it works once and expires in one hour).
4. In your store open WooCommerce > Cerquito, paste the key and press Connect.
5. Press Test connection to confirm.

If you used an earlier version installed from the folder `cerquito-woocommerce`, deactivate and delete that copy after activating this one. Your connection is kept.

== Frequently Asked Questions ==

= What data is sent to Cerquito? =

Only for orders with at least one Cerquito product: order number and status, totals, payment method, lines (SKU, quantity, price), and the buyer name, e-mail, phone and shipping address. Product names, customer notes, coupons and card data are never sent.

= Do I need WooCommerce API keys? =

No. The plugin and Cerquito sign their messages with a secret that belongs to your store and is created when you connect.

= What about cash on delivery orders? =

They are not produced: WooCommerce puts them in Processing with no payment made, so Cerquito holds them until they are paid.

= How do I disconnect? =

WooCommerce > Cerquito > Disconnect. Deleting the plugin also removes the saved key.

= Is the plugin available in Spanish? =

Yes. Every Spanish locale (es_MX, es_ES, es_AR and others) shows the bundled Spanish (Mexico) translation.

== External services ==

This plugin connects to the Cerquito service (https://cerquito.com), which makes and ships the orders. Without that service the plugin does nothing. Every call uses https and is signed with a secret that belongs to your store alone.

1. **Cerquito API, at vjtvejrlcamvqavfmsqw.supabase.co (Cerquito's functions hosted on Supabase).**
   * When: (a) when you press Connect (sent: the connection key you pasted, your store address, store name, currency, administrator e-mail, plugin version and a new secret shared only by your store and Cerquito); (b) every time an order that contains a Cerquito product changes status, is paid, cancelled or refunded; (c) when you press Test connection; (d) when you press Disconnect or delete the plugin.
   * What is sent in (b): order number and status, dates, totals, payment method, the lines (SKU, quantity, price), the test-order mark if you set it, and the buyer's name, e-mail, phone and shipping address. Product names, customer notes, coupons and card data are never sent. Orders with no Cerquito product are not sent.
   * Privacy policy: https://cerquito.com/aviso-de-privacidad/
2. **Your own store, called by Cerquito.** Cerquito calls /wp-json/cerquito/v1/ on your site (signed) to read orders that contain Cerquito products, mark them shipped or delivered, and create the products you publish from Cerquito.
3. **Product images.** When you publish a product from Cerquito, your store downloads its images from the https address Cerquito gives (Cerquito's storage on supabase.co).

== Screenshots ==

1. The Cerquito screen in WooCommerce: connection status, the Test connection and Disconnect buttons, and the recent activity log.
2. Connecting a store: paste the connection key from your Cerquito dashboard and press Connect.
3. Recent activity: the last 20 events, such as orders sent to Cerquito, shipped and delivered.

== Changelog ==

= 1.3.2 =
* Translation files are no longer bundled with the plugin; translations come from translate.wordpress.org.
* Contributor account changed to the Cerquito account.

= 1.3.1 =
* Orders are sent to Cerquito at the end of the request that changed them, instead of waiting for the next site visit to run the scheduler. Retries still use the scheduler.

= 1.3.0 =
* Renamed for WordPress.org (slug cerquito). The plugin is now "Cerquito – Print on Demand for Online Stores"; existing connections, the REST routes and the saved settings are unchanged.
* The readme is now in English.
* Product lookup no longer bypasses query filters.
* Removed the redundant call to load the translation files; the bundled Spanish (Mexico) translation still loads for every Spanish locale.
* Tested with WordPress 7.1 and WooCommerce 11.2.

= 1.2.0 =
* New signed route /wp-json/cerquito/v1/delivered: when the print shop confirms delivery (or the waiting period passes with no confirmation), Cerquito leaves the order as delivered in your store and adds a private order note.
* Test orders: new order action "Mark as Cerquito test order" (and remove the mark). A marked order does not reach a print shop unless test orders are allowed for your store. A payment method never counts as a test.
* If the address or the items of an order that a print shop already has are changed, Cerquito stops the job and alerts its team.
* WordPress.org readme: external services section listing the data sent, and the WooCommerce requirement declared.

= 1.1.0 =
* Cerquito can now create and update the variable products (Color and Size) you publish from Cerquito in your store; they stay drafts until you publish them. Signed route /wp-json/cerquito/v1/products.

= 1.0.0 =
* First release: key-based connection, signed order delivery with retries, tracking written back to the store, settings screen, "Produced by Cerquito" tag, Spanish and English.

== Upgrade Notice ==

= 1.3.2 =
Packaging update for WordPress.org; no change to how the plugin works.

= 1.3.1 =
Orders reach Cerquito right away on quiet stores.

= 1.3.0 =
New WordPress.org name and folder (cerquito). Install it and deactivate the old cerquito-woocommerce copy. Deleting the old copy runs its uninstall, which removes the saved connection: connect again from Cerquito afterwards (one new key).

= 1.2.0 =
Needed to mark orders as delivered, for test-order control and so Cerquito can stop a job when an order is changed.

= 1.1.0 =
Needed to publish products from Cerquito and for the missed-order check.

= 1.0.0 =
First release.
