=== Pinzell Frete – CEP shipping table for WooCommerce Brazil ===
Contributors: rgcglobalnet
Tags: frete, correios, cep, shipping, woocommerce
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Requires Plugins: woocommerce
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Brazilian shipping from your own price table by CEP range, weight and class. Delivery time, tracking code. Block checkout and HPOS ready.

== Description ==

Pinzell Frete adds a **shipping method to WooCommerce shipping zones** whose prices come from **a table that you write**: CEP range, shipping class, weight range, price, price per extra kilogram and delivery time in business days. It makes **no remote request** and needs no account with any carrier or platform.

It is made for stores that ship from Brazil and that want predictable, fast, offline rates, for example a local delivery area, a regional price list, or a price list negotiated with a carrier.

* **Rate table by CEP range.** Each row has a name, CEP from/to, an optional shipping class, weight from/up to, fixed price, price per extra kg and delivery days (from/to). Several rows can match, so the customer can choose between, for example, "Econômico" and "Expresso".
* **Weight and shipping classes.** The weight of the cart is read in the unit set in WooCommerce and converted to kilograms. A row with a shipping class applies when at least one item in the cart has that class.
* **Handling fee** (fixed in R$ and in %) and an option to round the weight up to the next whole kilogram.
* **Delivery time** shown in the rate name ("PAC (4 to 6 business days)"). Can be turned off.
* **Import and export CSV** (Excel-friendly, semicolon separated, decimal comma accepted). Cells that could be read as spreadsheet formulas are neutralised on export.
* **Works in shipping zones**, so you can use it together with free shipping, local pickup and any other method. Taxes: taxable or not taxable.
* **Tracking code on the order.** Add a tracking code and an optional link on the order screen. The customer sees it in My Account, on the order page and in the order e-mails. Codes in the Correios format get a link to the public tracking page of the Correios.
* **Block checkout and classic checkout.** Rates are calculated on the server, so both work. Declared compatible with the Cart and Checkout blocks and with **HPOS** (custom order tables).
* **Translations:** Português do Brasil, English and Español.

= What this plugin does not do =

The free plugin does **not** ask the Correios or any carrier for live prices: the prices are the ones you type in the table. If you want live quotes, Pinzell Frete Pro (a separate add-on) connects to Melhor Envio, SuperFrete or Frenet with **your own account token**.

= Free vs Pro =

| Feature | Free | Pro |
| --- | --- | --- |
| Rate table by CEP, weight and shipping class, CSV import/export | Yes | Yes |
| Delivery time, handling fee, tracking code on the order | Yes | Yes |
| Block checkout, classic checkout, HPOS | Yes | Yes |
| pt_BR, en, es | Yes | Yes |
| Live quotes from Melhor Envio, SuperFrete or Frenet (your own token) | – | Yes |
| Free-shipping rules (minimum order, CEP range, shipping class, cheapest rate only) | – | Yes |
| Estimated delivery date in business days with your holidays | – | Yes |
| "Calculate shipping" box (CEP) on the product page | – | Yes |
| Links and a copy-ready shipping data block on the order screen to buy the label | – | Yes |

Pinzell Frete Pro is sold separately at https://rgcglobalnet.com/pinzell-frete/. Everything listed as Free is complete and has no time limit.

= External services =

The free plugin does not connect to any external service. The only remote request it can lead to is a link that the customer or the shop manager clicks:

* **Correios tracking page** (`https://rastreamento.correios.com.br/`). Only when someone clicks a tracking link for a code in the Correios format; the code is the only data in the link. Nothing is sent by the plugin. Terms and privacy: https://www.correios.com.br/

Pinzell Frete is independent: it is not made, endorsed or supported by Correios, Melhor Envio, SuperFrete, Frenet or any other carrier or platform.

= Credits =

* The CEP-to-state ranges are based on the public CEP ranges of the Correios as listed in Wikipedia ("Código de Endereçamento Postal"); they are used only to show the state when the customer has not chosen one.
* Pinzell is a product line of RGC GLOBAL NET SERVICES SLU (Spain).

== Installation ==

1. Install and activate the plugin (WooCommerce 9.0 or later is required).
2. Go to WooCommerce → Settings → Shipping, open a shipping zone for Brazil and choose "Add shipping method" → "Pinzell Frete".
3. Edit the method, add your rows (or import a CSV) and save.
4. Add a product to the cart, enter a CEP of the zone and check the rates in the cart and in the checkout.

== Frequently Asked Questions ==

= Does it calculate Correios prices by itself? =

No. The free plugin uses the prices you write in the table (for example copied from your Correios contract or from a quote). Pinzell Frete Pro can ask Melhor Envio, SuperFrete or Frenet for live prices with your own token.

= How do the CEP ranges work? =

Write the first and last CEP of the range, with 8 digits (01310100) or with the hyphen (01310-100). A row applies when the destination CEP of the cart is inside the range. Rows are checked in order and the first matching row of each name is used, so put specific rows (a shipping class or a short range) before general ones.

= What does "From kg" mean? =

The row applies from that weight (inclusive) up to "Up to kg" (inclusive; 0 means no limit). The price is the fixed price plus "R$ per extra kg" for each kilogram above "From kg".

= Can I import my table from Excel? =

Yes. Save it as CSV (semicolon or comma separated). The columns are: name, CEP from, CEP to, shipping class, from kg, up to kg, price, price per extra kg, days from, days to. The first line may be a header.

= Does it work with the block checkout and HPOS? =

Yes. The rates are calculated on the server, so both the Cart/Checkout blocks and the classic shortcodes work, and the plugin only uses the WooCommerce order API (no direct database access to orders).

= What happens when no row matches the CEP? =

The method gives no rate. WooCommerce then shows the "no shipping options" message or the other methods of the zone.

= Where do I add the tracking code? =

In the order screen, in the "Tracking" box. The customer sees it in My Account and in the order e-mails.

= Is it translated? =

Português do Brasil, English and Español.

== Screenshots ==

1. The rate table in the shipping method settings.
2. The rates in the block checkout, with the delivery time.
3. The tracking box in the order screen.

== Changelog ==

= 1.0.0 =
* First release.

== Upgrade Notice ==

= 1.0.0 =
First release.
