Developer notes
File map
Section titled “File map”| Path | Purpose |
|---|---|
app/addons/kv_eu_product_safety_gpsr/addon.xml |
Settings, tables, uninstall function |
app/addons/kv_eu_product_safety_gpsr/func.php |
Hook handlers |
Tygh/Addons/KvEuProductSafetyGpsr/Config.php |
Settings, licence gate (Config::isOn()) |
Tygh/Addons/KvEuProductSafetyGpsr/Manufacturers.php |
Manufacturer records, brand links, completeness |
Tygh/Addons/KvEuProductSafetyGpsr/Products.php |
Product data, manufacturer resolution, storefront view data |
Tygh/Addons/KvEuProductSafetyGpsr/Notice.php |
Notice images per language |
Tygh/Addons/KvEuProductSafetyGpsr/License/ |
Domain-bound licence client |
Tygh/Addons/KvEuProductSafetyGpsr/Upgrade/Synchronizer.php |
Self-healing upgrades |
controllers/backend/kv_eu_product_safety_gpsr.php |
Manufacturers, notice, checklist pages |
controllers/backend/products.post.php |
Product editor tab data |
controllers/frontend/kv_eu_product_safety_gpsr.php |
Legal guarantee page |
var/themes_repository/responsive/templates/addons/kv_eu_product_safety_gpsr/ |
Card, tab, checkout card, footer, page |
Tables
Section titled “Tables”| Table | Columns |
|---|---|
?:kv_gpsr_manufacturers |
manufacturer_id, company_id, name, legal_name, address, email, url, outside_eu, rp_name, rp_address, rp_email, is_default, status, updated_at |
?:kv_gpsr_brand_links |
variant_id (brand feature variant), manufacturer_id |
?:kv_gpsr_products |
product_id, manufacturer_id, gtin, mpn, type_batch, doc_url, garan_years, garan_brand, garan_model, updated_at |
?:kv_gpsr_product_texts |
product_id, lang_code, safety_info |
Images: core image pairs with the object types kv_gpsr_garan (object id = product id) and kv_gpsr_notice (object id = ?:languages.lang_id).
Manufacturer resolution
Section titled “Manufacturer resolution”Product choice → brand link of the product’s “Brand” feature value → default manufacturer of the product’s company (vendor / storefront) → shared default. Disabled manufacturers are skipped.
Core hooks used
Section titled “Core hooks used”| Hook | Use |
|---|---|
get_product_data_post |
Adds $product.kv_gpsr (storefront only, add-on on and licensed) |
update_product_post |
Saves the editor tab (product_data[kv_gpsr]) and the GARAN image |
delete_product_post, clone_product |
Removes / copies the product data and the GARAN image |
delete_company |
Removes the manufacturers of a deleted vendor or storefront |
dispatch_before_display |
Checkout card data and the footer link mode |
Template hooks: products:product_detail_bottom (card), checkout:final_section_customer_notes (pre, checkout card), index:footer (post, own footer line), kv_returns_portal:footer_links (post, link inside the withdrawal strip), admin products:tabs_content (post). Product tab: blocks/product_tabs/kv_gpsr_safety.tpl (created on install, removed on uninstall).
Template variables
Section titled “Template variables”$product.kv_gpsr: manufacturer (name, legal_name, address, email, url, outside_eu, rp_name, rp_address, rp_email, source), identifiers (label, value), safety_info, doc_url, garan (years, brand, model, image), notice, notice_image (url, width, height), years, card, tab, has_warnings.
Caching
Section titled “Caching”The product page main block adds the add-on tables to its update handlers and a cache key with the licence state and settings (schemas/block_manager/blocks.post.php). Nothing is written at storefront runtime.
Licence gate
Section titled “Licence gate”Config::isOn() = enabled and License\Client::isActive(). Storefront output only; admin and data always work.