Installation
Requirements
Section titled “Requirements”- CS-Cart or Multi-Vendor 4.17.2 – 4.22.x (CS-Cart, CS-Cart Ultimate, Multi-Vendor, Multi-Vendor Ultimate).
- PHP 7.4 or newer (as your CS-Cart version allows).
- MySQL or MariaDB (standard for CS-Cart).
- Inventory tracking switched on (Settings → General) and products with tracked stock.
- A cron job for the daily snapshot (any hosting control panel can add one).
Install
Section titled “Install”- In the admin panel open Add-ons → Manage add-ons.
- Click the + button (Upload & install add-on) and choose the file
kv_inventory_analytics-1.0.0.zip. - The add-on installs and switches on. A new menu item appears under Products → Inventory analytics.
- Open the add-on settings (Add-ons → Manage add-ons → Inventory Analytics & Stock Valuation → Settings) and enter your license key on the License tab. If you bought on the CS-Cart Marketplace, the license number you enter in Add-ons → Manage is used automatically.
- Check the cost sources on the Cost sources tab (see Configuration).
- Open Products → Inventory analytics and click Take snapshot now. The first snapshot reads your sales history (365 days by default), so it can take a minute on a large store; the progress bar shows how far it is.
- Add the cron line from the Snapshots and cron tab (see below). Run it every 15 minutes.
Daily snapshot (cron)
Section titled “Daily snapshot (cron)”The reports read a snapshot that is taken once a day. Add one of these lines to your hosting cron, every 15 minutes (the exact lines with your paths and cron password are shown on the Snapshots and cron tab):
*/15 * * * * php /path/to/your/store/admin.php --dispatch=kv_inventory_analytics.cron*/15 * * * * wget -q -O /dev/null "https://your-store.example/admin.php?dispatch=kv_inventory_analytics.cron&cron_password=YOUR_CRON_PASSWORD"- The HTTP variant uses the core cron password (Settings → Security settings → Cron password). Each HTTP run works for up to 25 seconds, a console run for up to 15 minutes.
- The snapshot works in chunks of 500 products. When a run reaches its time limit, the next run continues where it stopped. Once the snapshot of the day is complete, further runs end at once until the next day, so frequent runs cost nothing.
- A snapshot that is still unfinished when the day changes is completed first (under its own date), then the new day’s snapshot starts.
- Two runs never overlap: a second run while one is working returns “locked”.
- If a snapshot is still unfinished after 2 hours, or no snapshot was completed yesterday or today, the report pages and the Snapshots and cron tab show a warning.
Privileges
Section titled “Privileges”| Action | Privilege |
|---|---|
| Open the reports, export CSV, save filters | View reports |
| Take a snapshot from the admin panel | Manage catalog |
On Multi-Vendor, vendor administrators see the reports of their own products when Vendors see inventory reports of their own products is on (default). Vendors can never take a snapshot or run the cron.
Upgrading
Section titled “Upgrading”Upload the new zip over the installed add-on (Add-ons → Manage add-ons → +) or use the Upgrade Center package. The add-on brings its tables, settings and texts up to date on the next admin page view; snapshots, stockout history and saved filters are kept.
Uninstalling
Section titled “Uninstalling”Uninstalling removes the add-on tables (snapshots, stockout history, saved filters) and settings. Your products, orders and the data of other add-ons are never touched. If you only want to pause it, disable the add-on instead: all data is kept.