=== BAS Exchange for WooCommerce ===
Contributors: catcodestudio
Tags: bas, commerceml, erp, stock sync, import
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Exchange between WooCommerce and BAS over CommerceML 2: categories, products, properties, pictures, prices and stock from BAS.

== Description ==

Connect your WooCommerce store to a **BAS** configuration that has exchange with a website through the standard **CommerceML 2** protocol. BAS starts the exchange itself and sends the catalog, prices and stock to the store — no manual CSV exports.

**What comes from BAS**

* Groups → product categories, with the whole tree and renames.
* Items → products: name, SKU, description (plain text or HTML), weight, pictures (main image and gallery).
* Properties → global WooCommerce attributes, usable in layered-navigation filters.
* Prices from the price type you choose (for example "Retail").
* Stock: total quantity or per-warehouse quantities, "in stock / out of stock" set automatically.
* Items marked as deleted in BAS → moved to drafts or trash, as you choose.

**How the exchange works**

* One address, user and password to paste into BAS; answers exactly as the CommerceML 2 protocol expects (checkauth, init, file, import).
* Large catalogs are imported in steps: the store answers "progress" and BAS repeats the request, so no request runs into the server timeout.
* Files may come in parts and as one zip archive with pictures.
* Every product and category keeps its BAS id: renaming in BAS updates the same product, never creates a duplicate. A product BAS sends for the first time can be linked to an existing one by SKU.
* You decide which fields BAS may overwrite (name, description, SKU, categories, pictures, attributes) — the rest stays editable on the site.
* Manual import: upload import.xml / offers.xml / a zip in the admin and watch the step-by-step import — for the first load and for checking a problem file.
* Exchange log in the admin and in WooCommerce → Status → Logs.
* HPOS compatible. English, Ukrainian and Russian interface.


== Installation ==

1. Upload the plugin and activate it (WooCommerce must be active).
2. WooCommerce → BAS Exchange → Connection: copy the exchange address, user and password.
3. In BAS open the website exchange settings (CommerceML protocol) and paste the three values.
4. Run the exchange in BAS. The result of every step is in WooCommerce → BAS Exchange → Log and manual import.

== Frequently Asked Questions ==

= Where do I find the address for BAS? =

WooCommerce → BAS Exchange → Connection. It looks like https://your-store/bas-exchange/ — BAS adds the protocol parameters to it by itself.

= BAS says "failure" on the first step =

The user or password does not match the Connection tab. Check them with the curl command shown on that tab: the answer must start with "success".

= The import stops on a large catalog =

Lower "Seconds per import step" on the Connection tab below your server's request timeout. BAS repeats the request until the whole file is imported.

= Will the exchange overwrite descriptions I wrote on the site? =

Only the fields ticked in Catalog → "BAS may update". Untick "Description" and BAS fills it only for new products.

= I already have products on the site =

Keep "Match by SKU" on: products with the same SKU are linked to BAS instead of being duplicated.

= Can I try without BAS? =

Yes. Export import.xml and offers.xml from BAS (or any CommerceML 2 files) and upload them on the "Log and manual import" tab.

== Screenshots ==

1. Connection tab: the exchange address, user and password to paste into BAS, and a curl command to check the address.
2. Catalog tab: matching by SKU, status of new products, the fields BAS may update and the price type.
3. Log and manual import: upload files from BAS by hand and follow every exchange step.

== Changelog ==

= 1.0.0 =
* First release: catalog, properties, pictures, prices and stock from BAS over CommerceML 2, manual import, exchange log.
