Skip to main content

Architecture

Developer reference: This section is for theme and plugin developers extending Booking Engine Connector.

Reference diagrams use Mermaid. PHP namespaces live under BookingEngineConnector\.


Overview

The plugin:

  1. Loads the PSR-4 autoloader (includes/), defines BEC_* constants, runs bootstrap.php (database migrations), then Plugin::instance()->init().
  2. On activation: incremental migrations, default options (sync interval, fallback/checkout defaults), schedules WP-Cron.
  3. On plugins_loaded: template helpers, text domain, registration of search/front/admin/sync/CPT/field registries/shortcodes/Elementor query hook.

Elementor Pro (Loop Grid)

BookingEngineConnector\Elementor\AvailabilityQueryFilter registers Elementor’s action elementor/query/{query_id} (default query id bec_available_only, overridable via bec_elementor_availability_query_id). It narrows the Loop Grid using QuoteService::getQuote() and the current SearchContext.

Developer filters: bec_elementor_availability_query_id, bec_elementor_available_post_ids, bec_elementor_availability_max_units.

User-facing setup: Elementor — hide units with no availability.


Bootstrap & module registration


Layered architecture


Sync sequence


Front flow — query string → quote → CTA or fallback

URL parameters include bec_checkin, bec_checkout, optional occupancy keys (See SearchContext).

Shortcodes reuse the same services (SearchForm, CheckoutUrlService, QuoteService, etc.).


Kross provider internals


Directory mind map


Concept map

AreaResponsibility
Remote inventoryProviderInterface::fetchRemoteUnits()
Persisted posts/metaSyncService + canonical core fields + optional mapped meta
Booking contextSearchContext built from bec_* query args
ExtensibilityFilters/actions prefixed bec_*