=== Dutiwise ===
Contributors: webkoding
Tags: woocommerce, customs, import duty, ddp, vat
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 1.1.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Import duty, VAT/GST and clearance fee estimates at checkout for WooCommerce. Charge them (DDP) or show them (DAP), from your own rate tables.

== Description ==

Customers abroad who are surprised by a customs bill on delivery refuse parcels, open disputes and do not come back. Dutiwise estimates the import charges of each order from the HS code and country of origin of every product and from rate tables you keep per destination, and shows them before payment.

**Two modes, per store or per destination**

* **DDP (delivered duty paid):** the estimate is added to the order as a fee, so the customer pays it at checkout and you settle customs with your carrier.
* **DAP (delivered at place):** the estimate is shown in cart and checkout as information only, with a note that the carrier may collect it on delivery.

**What it calculates**

* **Customs duty** from your duty table: HS code prefixes (2 to 10 digits), optionally per country of origin. The longest matching code wins. A fallback rate or "no estimate" for codes without a row.
* **Duty-free threshold** (de minimis) and an optional **flat fee for low-value goods** instead of the rate, charged per 6-digit code, per cart line or per unit.
* **Duty on goods only or on goods plus shipping** (CIF).
* **Import VAT or GST** with a default rate, rates per country (for example `DE 19, FR 20`), a threshold, and whether shipping and duty are part of its base. When WooCommerce already charges tax on the order, import tax is left out so the customer does not pay twice.
* **Carrier clearance fees** from your carrier's rate card: a fixed amount plus a percentage of duty and tax, per shipping method and goods value band.
* **Exchange rate per rule**, so thresholds and fees can be entered in the destination's currency.

**Where it appears**

* Classic and block **cart and checkout**, with an expandable "How this is estimated" breakdown.
* The **order**: the estimate is stored with it and shown on the order screen, in the customer's account and in order emails.
* An optional **"Duties included at checkout" badge** on product pages for DDP destinations, also as the `[landedcost_badge]` shortcode.

**Your data**

* **HS code and country of origin** fields on every product and variation (variations inherit from their parent), plus a Products screen to fill them in for 30 products at a time, with a "Without HS code" filter.
* **Rules** per destination or group of destinations (`EU` stands for all member states). Paste duty rows straight from a spreadsheet.
* An **Overview** with a setup checklist and a **test calculator** to check typical orders before you enable a rule.
* Local pickup and virtual products are left out. Shipments inside one rule's destinations (such as within the EU) are not treated as imports.

**No external calls.** The plugin does not contact any service. You enter and maintain the rates; every rule records its source and the date it was last verified.

Estimates only. The merchant is responsible for verifying tariff codes, rates and thresholds.

**Dutiwise Pro.** This plugin is complete on its own. [Dutiwise Pro](https://webkodingtheme.com/plugins/landedcost) is a separate paid plugin that adds starter tariff tables, CSV import and export of HS codes, bulk editing and a report of collected charges.

== Installation ==

1. Install and activate WooCommerce.
2. Plugins → Add New → search for "Dutiwise" → Install → Activate.
3. Dutiwise → Settings: choose the country you ship from and the mode (DAP or DDP).
4. Enter HS codes and countries of origin on your products, or under Dutiwise → Products.
5. Dutiwise → Rules → Add rule: destinations, duty rates, VAT or GST, thresholds, clearance fees and the exchange rate. Tick "Enabled" once you have verified it.
6. Dutiwise → Overview: try a few orders with the test calculator.

== Frequently Asked Questions ==

= Is this customs or legal advice? =

No. The plugin calculates with the rates, thresholds and fees you enter, nothing else. It does not know the tariff of any country and does not classify products. Verify every rate with the customs authority of the destination or your broker before you charge customers. The amount customs actually bills can differ.

= Does it update tariffs automatically? =

No. It makes no external calls. You maintain the tables, and each rule shows when it was last verified and links to its source.

= What happens when a product has no HS code, or its code has no rate? =

With "Give no estimate" nothing is charged; the customer sees that import charges may be due on delivery. With "Use the default rate", that rate is applied.

= Should I use DDP or DAP? =

Use DDP only when your carrier lets you pay duties and taxes as the sender (often called DDP or "duties paid" service). Otherwise use DAP, which only informs the customer.

= Does it work with the block checkout? =

Yes. The estimate and its breakdown appear in the Cart and Checkout blocks as well as the classic shortcode pages. The plugin declares compatibility with High-Performance Order Storage.

= Are excise, anti-dumping duties or trade preferences covered? =

Only as far as you enter them as a rate for a code and an origin. Alcohol, tobacco and similar goods need a specialist.

= Can I use a different currency for a destination? =

Yes. Each rule has a currency and an exchange rate from your store currency. Thresholds and fixed fees of the rule are in its currency; amounts charged are in your store currency.

= What does Dutiwise Pro add? =

Starter tables for the EU, the UK, Canada and Australia (thresholds, VAT or GST and common duty rates, added as disabled rules for you to verify), CSV import and export of HS codes, HS code and origin in the WooCommerce bulk editor, and a report of charges collected per country with a CSV download. Pro is a separate plugin that needs this one; everything described above is in this free plugin.

= What does the plugin store? =

Three database tables for rules, duty rows and clearance fees; one option for the settings; the HS code and origin as product meta; and the estimate with each order. Nothing is sent anywhere. When you delete the plugin, its tables, settings and HS codes are removed only if you ticked that option in the settings; estimates stored with orders stay.

== Screenshots ==

1. Block checkout in DDP mode: the estimate is charged as a fee, with its breakdown.
2. Block checkout in DAP mode: the estimate is shown, not charged.
3. A rule: destinations, duty rates, VAT or GST, thresholds, clearance fees and source.
4. HS codes and countries of origin for 30 products at a time.
5. Overview with the setup checklist and the test calculator.

== Changelog ==

= 1.1.1 =
* Product and variation fields verify the WooCommerce form nonce and edit capability before saving.

= 1.1.0 =
* First WordPress.org release. Formerly sold as LandedCost.
* Option, table, meta and hook names now use the `landedcost_` prefix. Data of the earlier build is taken over on activation. The badge shortcode is now `[landedcost_badge]`.

= 1.0.0 =
* First release.
