Developer notes
| Item | Value |
|---|---|
| Add-on id | kv_theme_pantry |
| Theme | kv_pantry (child of responsive), installed from var/themes_repository/kv_pantry |
| 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 | pt- (theme), kv- (kit) |
design/themes/kv_pantry/css/kit/{fonts,base,features,addons}.less(kit layer),css/skin/skin.less(Pantry),styles/data/{Market,Greenhouse,Citrus,Deli}.less(styles),media/images/pantry/*.svg(aisle and recipe illustrations).- Block templates:
blocks/categories/kv_bubbles.tpl(aisle bubbles / aisle list),blocks/products/kv_pt_grid.tpl(grid section),blocks/products/kv_recipe_list.tpl(shop the recipe),blocks/static_templates/kv_slot_pill.tpl,blocks/static_templates/kv_top_note.tpl, plus the kit’sblocks/menu/kv_mega.tplandblocks/wrappers/kv_gate.tpl. - Hook files in
templates/addons/kv_theme_pantry/hooks/:products/list_price_block.pre(unit line, stickers on cards),products/product_multicolumns_list_control.post(Add button in grids that hide it, by re-capturing the stock add-to-cart block),products/main_info_title.pre,products/product_detail_bottom.pre,products/product_tabs.post(product page),categories/view_subcategories.override(sub-aisle bubbles; empty without the design, so the stock list renders),checkout/minicart_product_info.postandcheckout/minicart.post(hidden data spans inside the cart block for the steppers and the basket bar),index/scripts.pre(texts and URLs for theme.js). Core and add-on templates are not overridden. - Add-on:
Tygh/Addons/KvThemePantry/Theme/Kit.php(install, licence gate, admin notice, upgrade refresh),License/,Upgrade/Synchronizer.php,controllers/frontend/kv_theme_pantry.php(stepper quantity),js/addons/kv_theme_pantry/{kit,theme}.js.
Hooks and data
Section titled “Hooks and data”| Hook | Use |
|---|---|
before_dispatch (storefront) |
assigns $kv_theme while the add-on is enabled, the storefront runs kv_pantry and the licence is active |
gather_additional_products_data_post |
$product.kv_pt (pack, unit divisor, stickers, origin, storage, shelf life, allergens) from features with the codes PACK_SIZE, ORIGIN, STORAGE, SHELF_LIFE, ALLERGENS, ORGANIC, LOCAL, VEGAN, FAIRTRADE (one query per product list) |
get_product_data_post |
products.view only: $product.kv_pt_nutrition from the feature group with the code NUTRITION |
get_categories_post |
kv_pt_art (produce icon matched by the category name) for categories without an image |
dispatch_before_display, update_addon_status_post |
kit: admin notice and status |
Every data hook returns at once unless the storefront runs the licensed theme; the data depends on the catalogue only.
Cart, steppers and the full page cache
Section titled “Cart, steppers and the full page cache”The theme prints nothing visitor-specific into cached markup. The steppers and the basket bar read hidden spans that
the theme adds inside the core cart block (cart_status_*, rendered per visitor and re-rendered after every cart
change; an ESI fragment with the 4.21 full page cache). − / + post dispatch=kv_theme_pantry.qty (cart_id,
amount, redirect_url, result_ids=cart_status*): the controller changes only a line of the visitor’s own cart
(never bundle children), recalculates and saves the cart and redirects like the stock add to cart, so the core
re-renders the cart blocks. POST only, only while the licensed design is on.
Free-delivery figures: the threshold setting (primary currency) and the subtotal are rendered by the cart block hook
(common/price.tpl formats them in the visitor’s currency). When the Free Shipping Progress Bar add-on renders its
bar in the mini cart, the basket bar shows that message and percentage; when that add-on’s own sticky bar is on, the
basket bar shows no second progress line.
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_*, @pt_*) set by each style file.