Developer notes
Store Locator Pro extends the core store_locator tables. It never changes their structure.
| Table | Content |
|---|---|
?:kv_sloc_stores |
One row per core store location: zipcode, email, website, hours (JSON), special_days (JSON), timezone, services (CSV of ids), business_type, has_page, featured, updated_at |
?:kv_sloc_store_descriptions |
meta_title, meta_description, hours_note per language |
?:kv_sloc_services, ?:kv_sloc_service_descriptions |
Services (icon, position, status, name per language) |
?:kv_sloc_geocache |
Address search answers (30 days) and the per-IP hourly counters |
Hours JSON: {"1":[["09:00","13:00"],["14:00","18:00"]], ..., "7":[]}. Keys are ISO weekdays (1 = Monday), with up to 3 ranges a day. 24:00 means midnight. A closing time before the opening time means past midnight.
Special days JSON: [{"from":"2026-12-24","to":"2026-12-24","closed":false,"hours":[["09:00","13:00"]],"label":"Christmas Eve"}].
The store photo is an image pair of object type kv_sloc_store.
PHP API
Section titled “PHP API”use Tygh\Addons\KvStoreLocatorPro\Stores;use Tygh\Addons\KvStoreLocatorPro\Hours;
$stores = Stores::storefrontList(); // active, visible stores of the current storefront, with extra data$store = Stores::storefrontOne($store_location_id); // or null$extra = Stores::extra([$id1, $id2], CART_LANGUAGE); // extra data onlyStores::save($id, ['hours' => 'Mo-Fr 09:00-18:00'], 'en'); // partial updates are fine
$week = Hours::parseSchemaOrg('Mo-Fr 09:00-18:00; Sa 10:00-14:00');$text = Hours::formatSchemaOrg($week);$state = Hours::status($week, $specials, new DateTimeImmutable('now', new DateTimeZone($store['tz'])));fn_kv_store_locator_pro_storefront_on() tells whether the storefront features are on (enabled and licensed).
Hooks used
Section titled “Hooks used”store_locator_get_store_location_post, store_locator_update_store_location_post, store_locator_delete_store_location_post (core store locator), google_sitemap_generate_link_get_object_link and google_sitemap_generate_sitemap_for_storefront_after_items (sitemap).
The admin form tab uses the template hook store_locator:tabs_content and a store_locator.post.php backend controller. The add-on fields are posted as kv_sloc[...].
Storefront
Section titled “Storefront”- Controller
kv_stores, with modesdirectory,view(store_location_id) andgeocode(JSON,Cache-Control: no-store). - SEO object type
y(store pages) and the custom rulestoresforkv_stores.directory. - Templates:
addons/kv_store_locator_pro/views/kv_stores/{directory,view}.tpl,components/{finder,store_card}.tpl,blocks/{finder,store_hours,vendor_locations}.tpl. - Browser data:
<script type="application/json" class="kv-sloc__data" data-no-defer>inside each[data-kv-sloc]root.js/addons/kv_store_locator_pro/func.jsreads it.Tygh.kvStoreLocatorPro.status(store)exposes the open/closed calculation. - Styling: every class starts with
kv-sloc. Set--kv-sloc-accenton.kv-sloc, .kv-sloc-pagein your theme to change the accent colour.
Full page cache (4.21)
Section titled “Full page cache (4.21)”kv_stores.directory and kv_stores.view are added to the cacheable dispatches. Their HTML holds no visitor data: open state, distances and the visitor position are calculated in the browser, and the browser asks for the location only after a click. The geocode endpoint is never cached, and the kv_sloc_geocache table is ignored as a cache tag.
Multi-Vendor
Section titled “Multi-Vendor”fn_kv_store_locator_pro_can_edit()shows and saves the tab only for the vendor’s own locations (4.17 core opens any location’s form for a vendor; 4.21 core denies it).featuredand the creation of services (CSV import) are administrator-only (Config::isVendor()).- Of the
kv_sloccontroller, vendors may use onlygeocode.services,update_services,delete_serviceandm_deleteare administrator-only (schemas/permissions/vendor_multivendor.post.php), and the controller refuses vendor POSTs as well.
php81 tests/unit.php/php83 tests/unit.php: hours, special days, status, markup, icons.node tests/js-status.mjs: the browser status logic against the same cases.node tests/e2e/e2e.mjs <store>: storefront, address search against a local mock (refuses to run unless the setting points at 127.0.0.1), admin form and services, and the vendor panel.