Developer notes
| Item | Value |
|---|---|
| Add-on id | kv_theme_forge |
| Theme | kv_forge (child of responsive), installed from var/themes_repository/kv_forge |
| Built with | Kavio theme kit 1.x (kv-files.json in the theme lists every file with its hash and the kit version) |
| CSS prefix | fg- (theme), kv- (kit) |
design/themes/kv_forge/css/kit/{fonts,base,features,addons}.less(kit layer),css/skin/skin.less(Forge),styles/data/{Hi-Vis,Workshop,Signal,Steel}.less(styles).- Block templates:
blocks/products/kv_rows.tpl(list rows / row cards section),blocks/products/kv_quick_order.tpl(quick order pad),blocks/categories/kv_plates.tpl(department plates),blocks/static_templates/kv_trade_actions.tpl(header quick order and account links),blocks/product_list_templates/kv_rows.tpl(“List rows” product list view), plus the kit’sblocks/menu/kv_mega.tpl,blocks/categories/kv_search.tplandblocks/wrappers/kv_gate.tpl. - Partials
templates/addons/kv_theme_forge/partials/:kv_rows(rows on the stock product form: thecommon/product_data.tplcaptures, so labels, add-to-cart hooks and add-on buttons keep working),kv_stock,kv_breaks,kv_price,kv_qb,kv_taxtog. - Hook files in
templates/addons/kv_theme_forge/hooks/:products/main_info_title.pre(brand line),products/main_info_title.post(codes strip, key points),products/main_price.override(price excl./incl. tax and the quantity-discount table; products with options keep the core price),products/main_price.post(the table for products with options),products/product_detail_bottom.post(stock lines, quote bar),products/image_wrap.post(spec plate),categories/view_description.post(product count, tax switch). Core and add-on templates are not overridden. - Add-on:
func.php(Forge data),controllers/frontend/kv_theme_forge.php(quick order endpoints),Tygh/Addons/KvThemeForge/Theme/Kit.php(install, licence gate, admin notice, upgrade refresh),Theme/Demo.php(demo content),License/,Upgrade/Synchronizer.php,js/addons/kv_theme_forge/{kit,theme}.js.
Hooks and data
Section titled “Hooks and data”| Hook | Use |
|---|---|
before_dispatch (storefront) |
kit: assigns $kv_theme while the add-on is enabled, the storefront runs kv_forge and the licence is active |
gather_additional_products_data_post |
$product.fg: brand, mpn, ean, chips, plate (features), px / lp (unit and list price excl./incl. tax via fn_get_taxed_and_clean_prices), tax, tiers (fn_get_product_prices: the core usergroup rules), stock, sku |
get_product_data_post |
products.view: fg.quote (quote request dispatch), fg.branches (Warehouses add-on amounts) |
get_products_views_post, get_products_layout_post |
“List rows” view active and default unless the shopper picked a view or the category has its own views |
get_categories_post |
fg_lead (first sentence of a top-level category description) |
Every storefront hook returns at once unless the storefront runs the licensed theme.
Quick order endpoints
Section titled “Quick order endpoints”GET index.php?dispatch=kv_theme_forge.sku&q=<text>returns{"q", "cur": [symbol, after, decimals, decimal separator, thousands separator, coefficient], "items": [{"exact", "id", "sku", "name", "url", "ex", "in", "tiers": [[qty, ex, in]], "stock", "opts", "min", "step", "buy"}]}: storefront product search (fn_get_products, all availability rules), up to six items, exact SKU first. Catalogue data and the customer’s core prices only.GET index.php?dispatch=kv_theme_forge.accountreturns{"user": false}for guests; for signed-in customers{"user": true, "order": {"id", "lines": [{"id", "sku", "qty"}]}}(last order, active products), sent withCache-Control: private, no-store.- Lines go into the cart with the core
checkout.add(product_data[<id>][amount]) over$.ceAjax, so cart rules, promotions and notifications are the core ones.
Full page cache
Section titled “Full page cache”The theme prints nothing visitor-specific into cached markup. The tax choice and the list/grid choice live in the
browser (localStorage, html[data-fg-tax]). The quick order pad loads customer data (CSV upload, reorder) only from
the account endpoint after the page has loaded.
Customising
Section titled “Customising”Use a child theme or the Theme editor’s custom CSS. Upgrades replace only theme files you have not changed. Design
tokens are LESS variables (@kv_*, @fg_*) set by each style file, for example @fg_section_rule (Workshop: a
hazard-stripe gradient), @fg_bw (plate outline width) and @fg_stripe_a / @fg_stripe_b (hazard stripes).