Skip to content

Developer notes

Technical reference for developers who customize Vendor Import Portal.

Item Value
Add-on id kv_vendor_import_portal
Function prefix fn_kv_vendor_import_portal_
Language variables kv_vendor_import_portal.*
CSS scope .kv-vip
PHP namespace Tygh\Addons\KvVendorImportPortal
Edition Multi-Vendor only (core_edition MULTIVENDOR)

PHP: delete_company (removes the vendor’s jobs, files, templates and limits), delete_product_post (image address map). The writes go through core fn_update_product() and fn_update_image_pairs(), so every hook of other add-ons (premoderation, vendor plans, SEO, full page cache tags, Vendor Plan Limits) runs as in the vendor panel. Undo of created products uses fn_tools_update_status().

Template hook: Add-ons, Manage and settings use the licence blocks generated by the license client.

None.

Table Contents
?:kv_vimp_jobs One row per import: company, state (M mapping, D checked, Q queued, R running, C completed, F failed, X cancelled, V undoing, U undone), frozen config, counters, cursor, worker lease, undo window
?:kv_vimp_job_rows Row messages: row number, level, action, product code, error code, field (no cell contents)
?:kv_vimp_undo Per product: kind (created / updated) and the previous and written values of the changed fields
?:kv_vimp_templates Mapping templates per vendor
?:kv_vimp_limits Limits and policy: company 0 = global, other rows = vendor overrides (NULL = inherit)
?:kv_vimp_images Image address hashes per product (identical links are not downloaded again)
?:kv_vimp_audit Audit log

Config (settings, limits), Access (who sees what; asVendor() runs core code with the vendor’s identity), Reader + Xlsx (file to work file), Mapper (mapping and transforms), Catalog (scoped lookups), Importer (one row, dry or real), Jobs (lifecycle, undo, retention, cron), UrlGuard + Fetcher (downloads), Files (private folder), ImportException.

var/kv_vimp/<job>/<24 hex>.jsonl: one JSON object per data row, {"n": source row, "c": [cells]}. The cursor is cursor_row and cursor_offset in the job row.

php admin.php --dispatch=kv_vendor_import_portal.cron --key=<key> or index.php?dispatch=kv_vendor_import_portal.cron&key=<key> (JSON summary, never cached). The vendor page calls kv_vendor_import_portal.step (POST, JSON) while it is open.

tests/unit.php (no store needed), tests/store/cli.php (store-booted checks), tests/e2e/e2e.mjs (HTTP, two vendors), tests/lifecycle.sh.

The add-on prints only in the administration and vendor panels, which are never cached. Imported products are saved through core functions, so core cache tags are invalidated as for any product save.