=== CatCode Migrator from Horoshop and Prom for WooCommerce ===
Contributors: catcodestudio
Tags: migration, import, horoshop, prom.ua, woocommerce
Requires at least: 6.2
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Move a shop from Horoshop or Prom.ua to WooCommerce through their official APIs: catalogue, photos, customers and order history.

== Description ==

The plugin reads the old shop through its API and writes the data into WooCommerce. The old shop is only read, nothing in it is changed.

Every run has three steps:

1. **Read.** Everything selected is downloaded and kept aside. Nothing is written to the store yet.
2. **Check.** Counters and sample rows show what was found.
3. **Write.** Categories, products, customers and orders are created in batches of a few seconds, so a large catalogue does not depend on one long request. A repeated run updates what was already moved instead of duplicating it.

Horoshop and Prom.ua are third-party services. This plugin is an independent integration and is not affiliated with, endorsed by, or sponsored by Horoshop or EVO (Prom.ua).

**Free:**

* Categories with nesting.
* Up to 50 products per run: names, descriptions, prices, sale prices, stock, SKU, barcode, brand, photos.
* Existing products are matched by SKU; a second run updates, not duplicates.

**Pro (licence from catcode.com.ua, 7-day trial available):**

* The whole catalogue.
* Characteristics as product attributes (Horoshop characteristics; Prom — from the shop's YML export).
* Modifications as variations of one variable product.
* Customers (registered users / Prom clients) — without passwords and without e-mails.
* Order history — without e-mails and without stock deduction; the original number, payment, delivery and waybill are kept in the order note.
* Undo of a run: everything the run created is deleted.

== Installation ==

1. Upload the plugin and activate it.
2. Go to WooCommerce → Migration from Horoshop / Prom.
3. Horoshop: in the Horoshop admin open Settings → Admins, add an administrator for the API, and enter the shop address, login and password. Prom.ua: create an API token in the seller cabinet (Settings → API management) and paste it; optionally paste the YML export link for characteristics.
4. Press "Save and check connection", then "Read data", check the counters, then "Write into this store".

== External services ==

The plugin connects to the services the shop is moving from, and to the CatCode licence server.

* **Horoshop API** (`https://<your-shop-domain>/api/`): when an administrator checks the connection or reads data, the plugin sends the API login and password to `auth`, then requests `pages/export`, `catalog/export`, `users/export`, `orders/get` and `orders/get_available_statuses`. Only reading functions are called. Horoshop: https://horoshop.ua/ — terms https://horoshop.ua/ua/terms/ .
* **Prom.ua public API** (`https://my.prom.ua/api/v1/`): with the API token of the seller, the plugin reads `groups/list`, `products/list`, `clients/list` and `orders/list`. If a YML export link is set, that file is downloaded. API documentation: https://public-api.docs.prom.ua/ .
* **Product images** are downloaded from the URLs the source API returns.
* **CatCode licence server** (`https://catcode.com.ua/wp-json/catcode/v1/license` and `/trial`): when a key is activated, verified (once a day) or released, the key and the site address are sent; when a trial is requested, the e-mail entered and the site address are sent. Privacy policy: https://catcode.com.ua/privacy/ .

Nothing is sent anywhere until an administrator saves the connection and starts a run or a licence action.

== Frequently Asked Questions ==

= Is anything changed in the old shop? =

No. Only reading API functions are used.

= Will customers get e-mails? =

No. While a run writes, e-mails are muted, and imported orders are marked as having their stock already deducted and their sales already counted.

= What happens if I run it twice? =

Every source record is remembered. A second run updates products and categories it moved before (or only adds new ones, if you switch updating off). Orders are never imported twice.

= Horoshop exports characteristics as codes. =

The Horoshop API returns characteristic codes rather than their titles. Common codes are translated automatically; add your own as "code = Title" lines in the settings.

= Can I undo a run? =

Yes, in Pro: "Undo this run" deletes what that run created. Records it only updated are left as they are. Photos and brands it downloaded or created are removed as well, unless another product still uses them.

== Changelog ==

= 1.0.0 =
* First release: Horoshop and Prom.ua → WooCommerce — categories, products, photos, characteristics, variations, customers, order history, undo of a run.
