ARVAS PRODUCT SYNC FOR WOOCOMMERCE 1.0.0
INSTALLATION GUIDE (LITE, FREE)
=========================================

This is the free Lite edition: the complete import, without the Pro extras.
The Pro edition adds image matching, category departments, exclusions, the GTIN
repair tool and a server cron script. A one-off 99 euro including one year of
updates and support: https://verkoop.arvashosting.eu

REQUIREMENTS
- WordPress 6.4 or newer
- WooCommerce 8.0 or newer (tested up to 11.0)
- PHP 7.4 or newer
- Access to the server holding the POS export (SFTP/FTPS/FTP/HTTPS)


STEP 1 - INSTALL THE PLUGIN
---------------------------
1. In WordPress go to Plugins > Add New > Upload Plugin.
2. Choose arvas-product-sync.zip and click Install Now.
3. Already installed? Choose "Replace current with uploaded".
4. Activate the plugin.
5. Go to WooCommerce > Arvas Sync.

On activation the plugin scans the installation: WooCommerce version, existing
brand taxonomies, existing product attributes, other import plugins, and whether
products already exist. The result appears under "Environment".


STEP 2 - CONNECT TO THE POS SERVER
----------------------------------
Does the web shop run on the SAME server as the POS export?
   Choose "On THIS server" and enter the absolute path, for example:
   /home/user/winstore
   A folder is fine; the plugin will pick the newest file.

Does the till run on ANOTHER server? (most common)
   Choose "On ANOTHER server" and fill in:

   Protocol : SFTP if the account has SSH, otherwise FTPS
   Host     : the IP address or hostname of the POS server
   Port     : 22 for SFTP, 21 for FTPS/FTP
   Path     : the path AS THE FTP ACCOUNT SEES IT, so not a URL
              and usually not the full server path
   Username and password for the account
   URL      : leave EMPTY unless you use HTTPS

   Unsure about the path? Use "Browse remote folder": enter / and click "Show
   folder". You will see where the account lands and exactly how files are named.

   Then click "Test connection only". It fetches the file without importing
   anything.

KEEPING THE PASSWORD OUT OF THE DATABASE (optional)
   Add to wp-config.php:
   define( 'ARVAS_WOO_SYNC_REMOTE_PASS', 'the-password' );
   This constant takes precedence over the input field.


STEP 3 - REVIEW THE SETTINGS
----------------------------
Product structure  : All variable - Colour and Size as variations
Parent SKU         : Model name from the feed
Batch size         : 40
Time budget        : 20 seconds
Safety threshold   : 40 percent
Dry run            : ON while testing

If another import plugin already runs on the same file, disable that schedule.
The plugin warns about this under "Environment".


STEP 4 - TEST WITHOUT RISK
--------------------------
1. Leave Dry run ON.
2. Enter a few article numbers under "Only these article numbers", comma
   separated.
3. Click "Test import now (dry run, writes nothing)".
4. Review the report: counts, intended actions, and whether existing products
   are picked up instead of recreated.


STEP 5 - FIRST REAL IMPORT
--------------------------
1. Untick Dry run.
2. Click "Run real import now" (with the test article numbers still filled in).
3. Check in WooCommerce:
   - the product shows as a Variable product
   - all sizes and colours appear as variations
   - stock and price match the till
   - the EAN appears in the GTIN field
   - the brand is visible
   - the category is correct (Women/Men plus subcategory)
4. All good? Clear the "Only these article numbers" field.
5. Click "Run real import now" again. The plugin works block by block and
   schedules follow-up runs itself until the whole catalogue is done. Track this
   with the progress bar.


STEP 6 - RUNNING AUTOMATICALLY
------------------------------
The plugin schedules a 30 minute WP-Cron itself. WP-Cron only fires when there
are visitors on the site, so on a quiet shop a sync may not run at all.

The Pro edition ships a server cron script with locking and logging that runs
outside the web root, so the sync always runs on time.

IMPORTANT: turn Dry run OFF. If it stays on, everything runs correctly but
nothing is written.

STEP 7 - CATEGORIES AND MENU
----------------------------
Products are placed in the category supplied by the POS feed.

The Pro edition adds a department above that (Women > T-shirt, Men > T-shirt),
can exclude brands and categories, and includes a button to rebuild the
structure entirely.

The navigation menu is not updated automatically. Build it under Appearance >
Menus after the import has run.


TROUBLESHOOTING
---------------
The source path does not work
   The settings page shows diagnostics with what PHP actually sees. Watch for
   open_basedir (PHP may not read outside the web root) and read permissions.

SFTP times out
   The account most likely has no SSH access. Use FTPS on port 21.

File not found while the connection works
   The path is too long. FTP accounts are locked into their home folder. Use
   "Browse remote folder" to see the correct path.

The import appears stuck
   Look at the progress bar, not the report: the report is a snapshot. If the
   bar does not advance, check the server cron and make sure Dry run is off.

Everything is created as new, nothing updated
   That indicates duplicates. Stop the import and check whether the existing
   products still have their SKU.

GTIN fields stay empty
   If the till supplies no EAN for those articles, the field stays empty. The
   Pro edition includes a check and a button to fill in missing codes.


SUPPORT
-------
Arvas Beheer B.V. - https://arvashosting.eu
