Developer notes
Data model
Section titled “Data model”| Table | Contents |
|---|---|
?:kv_vrb_sections + ?:kv_vrb_section_descriptions |
Sections (steps): position, status, plan ids (CSV); title and description per language |
?:kv_vrb_fields + ?:kv_vrb_field_descriptions |
Fields: section, type (T text, A text area, S drop-down, M multiple choice, C checkbox, D date, F file), required, position, status, plan ids, condition (cond_field_id, cond_value), min_len, max_len, format, file types / size / count, is_document, vsp_map; label, help, placeholder and options per language |
?:kv_vrb_applications |
One row per vendor (company_id): plan, applicant user, language, submitted, updated (by), declined_at, purged_at |
?:kv_vrb_answers |
company_id + field_id → value (multiple choice as a JSON list) and a label snapshot |
?:kv_vrb_files |
Uploaded files: vendor, field, original name, storage path (custom_files storage), size |
Flow and endpoints
Section titled “Flow and endpoints”- Storefront form: template hook
vendors:apply_fields(post) inside the core formapply_for_vendor_form; data fromcontrollers/frontend/companies.post.php(GETcompanies.apply_for_vendor). Field names:kv_vrb[<field_id>], fileskv_vrb_files[<field_id>][]. Steps, conditions and client checks:js/addons/kv_vendor_registration_builder/func.js(uses the core form validator per step andce.formpre_apply_for_vendor_form). - Validation:
controllers/frontend/companies.pre.php(POSTcompanies.apply_for_vendor) runs before the core controller; on errors it saves the posted data and redirects back to the form. - Storing: core hook
update_company(actionadd, storefront area) stores the answers and files for the new company in the same request. - Admin:
kv_vendor_registration_builder.form|section|field(builder),.manage(list),.export(CSV),.download?file_id=, POST.update_section|delete_section|update_field|delete_field|update_answers|delete_file|purge|cleanup. The Application tab:controllers/backend/companies.post.php+ hookcompanies:tabs_extra. Privilegesview_kv_vrb/manage_kv_vrb(section Vendors); the vendor panel has no access. - Console:
php admin.php --dispatch=kv_vendor_registration_builder.cleanup(privacy cleanup).
Used (same arguments in 4.17.2 and 4.21.2): update_company, delete_company (removes answers and files), change_company_status_before_mail (New → Disabled starts the retention countdown; → Active/Pending stops it), before_dispatch (hourly cleanup in the admin area).
Own hook: kv_vendor_registration_builder_notify_pre($data, $rules) before the e-mail event kv_vendor_registration_builder.submitted is dispatched.
Full page cache (4.21)
Section titled “Full page cache (4.21)”companies.apply_for_vendor is not a cacheable dispatch, so the form and the values restored after an error come from the visitor’s own request. The add-on prints nothing on cacheable pages and writes nothing on storefront GET requests; the cleanup mark uses files in var/kv_storage while the full page cache is on.
License check
Section titled “License check”License\Client checks the license from the admin panel or cron only. Gated: the custom fields on the storefront form, their validation and storing, and the e-mails of new applications. Not gated: the admin builder, list, Application tab, CSV export, downloads and the privacy cleanup.
Not in 1.0.0
Section titled “Not in 1.0.0”Saving a half-finished application to continue later, vendor-side editing of the answers after approval, per-storefront forms on Multi-Vendor Ultimate (one form for all storefronts), REST API.
File map
Section titled “File map”app/addons/kv_vendor_registration_builder/ addon.xml, init.php, func.php Tygh/Addons/KvVendorRegistrationBuilder/ Config.php settings Form.php sections, fields, plans Answers.php visibility rules, validation, storage, display Documents.php uploads, protected storage, downloads Applications.php application rows, list, CSV, retention Service.php storefront flow, admin edit, Vendor Storefront Pro prefill Notifier.php, ApplicationDataProvider.php e-mail event StorageData.php, License/, Upgrade/Synchronizer.php controllers/frontend/companies.pre.php, companies.post.php controllers/backend/kv_vendor_registration_builder.php, companies.post.php, kv_vendor_registration_builder_license.php schemas/menu/menu_multivendor.post.php, schemas/permissions/*, schemas/notifications/events.post.phpdesign/backend/templates/addons/kv_vendor_registration_builder/ views (form, section, field, manage), hooks, components, licensevar/themes_repository/responsive/templates/addons/kv_vendor_registration_builder/ hooks/vendors/apply_fields.post.tpl, components/field.tpljs/addons/kv_vendor_registration_builder/func.js, backend.jsvar/langs/en/addons/kv_vendor_registration_builder.po