=== CostHarbor Supplier Updates for WooCommerce ===
Contributors: spguard
Tags: woocommerce, csv, pricing, cost of goods, inventory
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Requires Plugins: woocommerce
Stable tag: 0.1.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Generate a WooCommerce catalog template, enter supplier costs, and preview guarded cost and price updates before applying them.

== Description ==

CostHarbor Supplier Updates for WooCommerce generates an editable catalog CSV template and safely imports supplier cost updates for products and variations. Every import is previewed before Apply, with dangerous regular-price changes warned and invalid rows blocked.

Supplier Cost is retained by CostHarbor and synchronized through WooCommerce's public native Cost of Goods methods when available. Applied Supplier Cost and calculated Regular Price changes can be rolled back, and CSV or store data is never sent to an external server.

It matches both product and variation SKUs. It never creates products. Invalid, duplicate, and unmatched rows are blocked. Large proposed price changes are highlighted using a configurable threshold. Every apply stores the prior supplier cost and regular price for rollback.

All processing and data storage stays in WordPress and WooCommerce. The plugin sends no telemetry, analytics, CSV content, or store data to external services.

== Installation ==

1. Install and activate WooCommerce.
2. Upload the `costharbor-supplier-updates` folder or ZIP through Plugins > Add New > Upload Plugin.
3. Activate CostHarbor Supplier Updates for WooCommerce.
4. Open WooCommerce > CostHarbor Supplier Updates for WooCommerce.
5. Upload a CSV and map its SKU and Supplier Cost columns.

== Frequently Asked Questions ==

= Does it change products immediately after upload? =

No. There is no direct apply path. You must create and review a preview, then explicitly apply safe rows.

= How do I create my first supplier CSV? =

Open WooCommerce > CostHarbor Supplier Updates for WooCommerce and select Download catalog template. Fill the Supplier Cost column for the product and variation SKUs you want to update, save the CSV, then upload it and build a Preview before applying anything. A blank template is also available.

= Does it create products for unknown SKUs? =

No. Unknown SKUs are blocked and skipped.

= Are variation SKUs supported? =

Yes. Matching uses WooCommerce's public SKU lookup, which includes variations.

= Where is supplier cost stored? =

The plugin keeps its own product metadata as the durable source of truth. If the installed WooCommerce exposes its public Cost of Goods methods, the value is also synchronized through those methods. No private WooCommerce metadata is accessed.

= What does rollback change? =

Only the CostHarbor Supplier Updates for WooCommerce cost and the regular price that the selected import changed. It does not restore titles, stock, sale prices, or unrelated metadata.

= What CSV formats are supported? =

Comma, semicolon, tab, and pipe delimiters are detected. UTF-8 is preferred; common legacy encodings are converted when PHP's multibyte extension is available. Files are limited to 10 MB and 10,000 data rows.

= Does the plugin contact external servers? =

No. Version 0.1.3 has no external requests, telemetry, analytics, or remote imports.

== Privacy ==

CostHarbor Supplier Updates for WooCommerce processes CSV content locally and stores import summaries, rollback snapshots, and supplier cost metadata in the site's WordPress database. It does not transmit data externally. Import history is retained for the 20 most recent imports. By default, uninstalling preserves supplier costs and import history as business data while removing temporary data. Administrators can explicitly opt into permanent data deletion before uninstalling.

== Screenshots ==

1. Download a catalog or blank template, understand the required columns, and upload only when the supplier costs are ready.
2. Map the required SKU and Supplier Cost columns; upload and mapping still do not change products.
3. Choose markup or target margin and set the Regular Price warning threshold; v0.1.3 updates both Supplier Cost and calculated Regular Price.
4. Review old and proposed costs and prices; warnings will apply if approved, while invalid, duplicate, and unmatched rows are blocked.
5. Confirm the applied totals and roll back the latest Supplier Cost and Regular Price changes when needed.

== Changelog ==

= 0.1.3 =
* Added downloadable catalog and blank CSV templates.
* Added first-run guidance and clearer CSV requirements.
* Clarified Supplier Cost, native COGS synchronization, and Regular Price behavior.
* Improved validation explanations and WordPress.org documentation.

= 0.1.2 =
* Rename the plugin and adopt the `costharbor-supplier-updates` slug and plugin-specific prefixes.
* Remove unnecessary manual text-domain loading.

= 0.1.1 =
* Preserve business data on uninstall by default and add an explicit permanent-deletion setting.
* Strengthen CSV validation, monetary input validation, and price threshold tests.

= 0.1.0 =
* Initial release with guarded CSV import, preview, apply, history, and rollback.
