Skip to content

Developer notes

Technical reference for developers who customize Hungary Pick-up Points.

Item Value
Add-on id kv_hu_pickup_points
Function prefix fn_kv_hu_pickup_points_
Language variables kv_hu_pickup_points.*
CSS scope .kv-hup, .kv-hu-pickup-points
PHP namespace Tygh\Addons\KvHuPickupPoints
Shipping services module kv_hu_pickup_points, codes foxpost_apm and mpl_pickup
Class Role
Client\BaseClient, Client\Api HTTP (cURL, TLS verification, timeouts), HTTP Basic + api-key; the FoxWeb calls: POST /api/parcel, POST /api/label/{size}, GET /api/tracking/{barcode}, DELETE /api/parcel/{barcode}, GET /api/address
Feed, Points Download of the two public lists, parsers (parseFoxpost, parseMpl), the cache (refused when empty or below half of the cache), search (words, bounding box, distance), server-side validation of the chosen point, cart and order storage
Shipments Parcel creation (row first, per-order lock, lost answer = state R), cash on delivery, label, tracking mapping, cancel, CSV export
RateCalculator, Tygh\Shippings\Services\KvHuPickupPoints The merchant’s own price per method; no HTTP while the cart is priced
Installer The two shipping services
Accounts, Secret, Config, Access Credentials sealed with AES-256-GCM, settings, who may see and act
Queue, Jobs, Log Job queue (create_label, track, sync_points), event log with masking
Table Purpose
?:kv_hu_pickup_points_cache Both point lists (carrier, id, type, address, coordinates, opening hours)
?:kv_hu_pickup_points_order_points The point chosen for an order
?:kv_hu_pickup_points_shipments Foxpost parcels, label PDF, tracking state
?:kv_hu_pickup_points_accounts, _log, _jobs Credentials per company, log, queue

PHP: get_order_info (attaches kv_hup_point), place_order, place_suborders, delete_order, change_order_status_post (parcel at a chosen order status), template_document_order_context_init (point text on invoices), init_templater_post (upgrade synchronizer). Storefront template hooks: checkout:shipping_method.post (the picker), orders:totals_shipping.post (point on the order page), index:scripts / index:styles (checkout only). Admin: orders:tabs_extra.

The request fields come from the FoxWeb OpenAPI document (tests/fixtures/foxpost-openapi.json, notes/API-NOTES.md). Not documented there, so not relied on: the shape of a parcel item in the create answer (the barcode is read from clFoxId, barcode or clFox), a lookup of a parcel by reference after a lost answer, a tracking URL pattern. The point lists are open files of the carriers, not documented APIs: the parsers are strict and a bad download keeps the cache. MPL’s API needs a contract and is not used. The Foxpost test environment could not be used without a merchant account: the tests run against a mock built from the document (“live check pending”).

The base URL (API and both lists) can be overridden for tests in config.local.php (development only):

$config['kv_hu_pickup_points_base_url'] = 'http://127.0.0.1:11872';

node tests/mock-server/server.js 11872 starts a local stand-in; node tests/e2e/e2e.mjs --root <store dir> --mock http://127.0.0.1:11872 runs the HTTP end-to-end test and refuses a store whose config.local.php does not point at that mock; php tests/unit.php runs the unit tests.

Admin templates live in design/backend/templates/addons/kv_hu_pickup_points/, storefront templates in the responsive theme repository. Do not edit them in a store; they are replaced on update.