=== ZapOrder – Pedidos pelo WhatsApp, Botão Flutuante e Catálogo for WooCommerce ===
Contributors: wooglobalapps
Tags: whatsapp, pedidos, catalogo, chat, woocommerce
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.3.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Receive orders on WhatsApp ("pedidos pelo WhatsApp"): product button, cart to chat, floating button and catalog mode. No API, no monthly fee.

== Description ==

= Em português =

**ZapOrder** transforma a sua loja WooCommerce em uma máquina de pedidos pelo WhatsApp em dois minutos: botão "Pedir pelo WhatsApp" na página do produto (com variação, quantidade, preço e link na mensagem), envio do carrinho inteiro pelo WhatsApp, botão flutuante de chat em todas as páginas, modo catálogo (sem carrinho e sem checkout) e opção de esconder preços para "pedir orçamento". Textos, cores e modelos de mensagem personalizáveis. Usa o link oficial wa.me: sem API, sem mensalidade, funciona com WhatsApp e WhatsApp Business. Gratuito.

Most small stores in Brazil, Latin America, India, Spain and Portugal close their sales on WhatsApp. **ZapOrder** turns your WooCommerce store into a WhatsApp ordering machine in two minutes.

**Free features**

* **Order on WhatsApp button** on product pages. The message already includes the product, the selected variation (size, color…), quantity, price and link.
* **Send cart via WhatsApp**: the customer sends the full cart (items, quantities and total) to you in one tap. Works with the classic cart and the new Cart block.
* **Floating WhatsApp chat button** on every page.
* **Catalog mode**: remove "Add to cart" and checkout. Customers order only through WhatsApp.
* **Hide prices** for "ask for a quote" stores.
* Buttons on shop and category pages.
* Custom button texts, color and message templates with placeholders: `{product}` `{qty}` `{price}` `{sku}` `{url}`.
* Uses the official `wa.me` link: no API, no monthly WhatsApp fee, works with WhatsApp and WhatsApp Business.
* **WhatsApp Automation (optional, 30 free messages/month)**: connect your WhatsApp by QR Code directly in **WooCommerce → ZapOrder WhatsApp → Automation** to send automatic order-status notifications (Processing, Completed, On hold, Cancelled) and pending Pix reminders (compatible with QRecebe and CheckoutBR).
* **Generate with AI**: describe what you want (a setting, a design change, texts, a custom feature) in the plugin screen and the AI assistant answers in the same chat.
* Compatible with HPOS and the Cart/Checkout blocks.
* Translation ready.

== External services ==

All core ordering features (product button, cart to WhatsApp, floating chat button and catalog mode) use plain `wa.me` links and make **zero** external requests.

This plugin connects to external services **only** when an administrator opts in to one of the two optional tabs:

1. **WooGlobal Apps Service (`https://conexao-support.vercel.app`)**
   * **"Generate with AI" tab**: when you click **Send**, the plugin sends your message, your site address, the email you typed (optional), your site name, language and plugin version, so the answer can be delivered back to your site. While the tab is open (only after you have sent a message), it loads the conversation.
   * **"Automation" tab**: when you click **Connect WhatsApp**, the plugin registers your site (site URL, store name and plugin version) to generate a WhatsApp QR Code and track your monthly free quota (30 messages/month). While connected and enabled, the plugin checks connection status on the Automation tab and sends automatic order-status messages, pending Pix reminders and test messages (recipient phone number and message text) through this proxy.
   * **Uninstall**: when you delete the plugin, it asks the service to delete your site's chat conversation and disconnect/remove its WhatsApp automation instance.
   * Terms: https://wooglobal-apps.vercel.app/terms.html — Privacy policy: https://wooglobal-apps.vercel.app/privacy.html

2. **AgenteZap (`https://agentezap.online`)**
   * Used server-side by the WooGlobal Apps proxy to deliver WhatsApp messages and manage QR Code sessions **only** when you connect WhatsApp on the optional **Automation** tab.
   * Also linked from the Automation tab if you choose to upgrade beyond the 30 free automated messages per month.
   * Website & terms: https://agentezap.online

Nothing is sent from your storefront, from your customers, or before you click **Send** (Generate with AI) or **Connect WhatsApp** (Automation).

== Support & free setup ==

ZapOrder works fully on its own: every feature is free and nothing is locked or required.

If you want a hand, the plugin screen (**WooCommerce → ZapOrder WhatsApp**) has a **Generate with AI** tab (see "External services"), a **Help** tab with quick tips and a **Hire us** tab. The "Talk to us on WhatsApp" and "Hire on WhatsApp" buttons are plain links: they open WhatsApp with a short message that contains only the plugin name and version (or the service you clicked). Nothing is sent automatically and no store data is shared.

* **Free setup:** we install and configure ZapOrder on your store for free.
* **Custom work** (optional): automatic order-status messages, abandoned cart recovery via WhatsApp, multiple agents / department routing, custom button and message design. See [our services](https://wooglobal-apps.vercel.app/br/contratar.html?plugin=zaporder).
* Questions and bug reports: [support forum](https://wordpress.org/support/plugin/zaporder/).

== Installation ==

1. Install and activate WooCommerce.
2. Upload the `zaporder` folder to `/wp-content/plugins/` or install it from **Plugins → Add New**.
3. Activate ZapOrder.
4. Go to **WooCommerce → ZapOrder WhatsApp**, enter your number with country code (e.g. 5511999998888) and save.

== Frequently Asked Questions ==

= Do I need the WhatsApp Business API? =

No. ZapOrder uses the free `wa.me` click-to-chat link. Any WhatsApp or WhatsApp Business number works.

= Does it work with variable products? =

Yes. The message includes the selected attributes, quantity and the variation price. If no option is selected, the customer is asked to choose one first.

= Can I disable the normal checkout? =

Yes. Turn on **Catalog mode**: the Add to cart buttons and the checkout page are removed, and customers order through WhatsApp.

= Does it collect any data? =

No store or customer data is collected. Clicking the button opens WhatsApp with the message pre-filled. The only connection to an external server is the optional "Generate with AI" tab, and only when an administrator clicks Send (see "External services").

= What can I ask in "Generate with AI"? =

Anything related to your store and this plugin: settings, design changes, texts and translations, or a custom feature. The answer appears in the same chat, usually within a few hours.

== Screenshots ==

1. Order on WhatsApp button on the product page.
2. Cart sent to WhatsApp with items and total.
3. Settings page with the free setup help card.
4. Hire us tab: free installation and implementation services on WhatsApp.

== Changelog ==

= 1.3.2 =
* Removed custom headers (`X-WP-Token` and `Idempotency-Key`) that were rejected by WordPress Playground's CORS proxy, keeping `Authorization: Bearer` plus `_wp_token` query authentication and JSON `idempotency_key`.

= 1.3.1 =
* Added proxy-safe site token fallback (`X-WP-Token` header and `_wp_token` query parameter) so WhatsApp QR Code connection and Generate with AI work in WordPress Playground and restrictive hosts that strip `Authorization` headers.

= 1.3.0 =
* New optional **Automation** tab: connect your WhatsApp by QR Code and get 30 free automated messages per month.
* Automatic WooCommerce order-status WhatsApp notifications for Processing (paid), Completed, On hold and Cancelled orders, with customizable templates (`{order_id}`, `{customer_name}`, `{total}`, `{status}`, `{store_name}`, `{items}`).
* Automatic pending Pix reminder: schedules a one-time WhatsApp reminder for unpaid Pix orders (QRecebe or any gateway with "pix" in its ID or title), including the Pix copy-and-paste code when available.
* Phone number extraction compatible with WooCommerce `billing_phone` and CheckoutBR `_billing_cellphone`, with configurable default country code (DDI).
* Built-in test message sender in the Automation tab and updated Portuguese (Brazil) translations.

= 1.2.3 =
* Fixed numeric SKUs with leading zeros when reading `data-sku` in the product button script.
* Updated Portuguese (Brazil) translations for the cart SKU and unit/subtotal lines.
* Updated support links and AI assistant triage copy.

= 1.2.2 =
* Cart WhatsApp message now includes each item's dynamic SKU (including product variations), unit price and line subtotal — works in both Classic Cart and Cart Block.
* Variable product pages now also fill the selected variation's SKU dynamically when `{sku}` is used in the product message template.

= 1.2.1 =
* Plugin name, tags and description now use the Portuguese terms Brazilian stores search for (pedidos pelo WhatsApp, botão flutuante, catálogo). No functional changes.

= 1.2.0 =
* Generate with AI tab: describe what you need and the AI assistant answers in the plugin screen.

= 1.1.0 =
* Welcome screen, Help and Hire us tabs, free setup help links, pt_BR translation; new plugin name.

= 1.0.0 =
* First release.
