Skip to main content

Version Pro Updated

Pro feature

This page documents a capability of the MHM Rentiva Pro add-on. It is not part of the free Lite edition on WordPress.org and requires Pro installed alongside Lite plus a valid licence. See Editions β€” Lite vs Pro for the full split, or get Pro at wpalemi.com/rentiva.

Purpose

This page describes the technical architecture and data entry rules of the admin interfaces that manage Rentiva's vehicle transfer operations (Airport VIP, Intercity, etc.).

πŸ›£οΈ Transfer Admin Panels

The Transfer module operates on a location-based network structure, distinct from standard vehicle rental. The TransferAdmin class centrally controls the screens (Locations, Routes, Stats) where this network is managed.


πŸ—οΈ Architecture Components​

The module uses three main components for data entry and visualization:

  1. Stats Cards: Top panel showing location, route, and latest operation data.
  2. Location Manager: Definition of transfer points such as airports, hotels, and ports.
  3. Route Configurator: Distance, duration, and pricing rules between two locations.

πŸ“Š Transfer Stats Cards​

The render_transfer_stats() method, located at the top of the admin panel, presents real-time operational data:

  • Total Locations: Active transfer points in the rentiva_transfer_locations table.
  • Active Routes: Defined and priced valid routes.
  • Latest Operation: Date of the most recent booking of type transfer.

Location Types​

The system supports the following internal types, which change the iconography displayed on the dashboard:

  • Airport: Airport transfer points.
  • Hotel: Accommodation facilities.
  • Port: Harbor and cruise terminals.
  • Station: Train and bus terminals.
  • City Center: City center points.

Location Form Fields​

As of v4.23.0, a city field has been added to the location form. This field is used for city-based filtering in the vendor marketplace integration:

FieldTypeDescription
nameVARCHAR(255)Location name
typeENUMairport, hotel, port, station, city_center
cityVARCHAR(100)City where the location is situated (v4.23.0)
lat / lngDECIMALCoordinates

Route Form and Pricing Fields​

A max_price field was added to the route form in v4.23.0. In the vendor marketplace, vendors set their own prices within the min_price/max_price range defined by the admin:

FieldTypeDescription
origin_idBIGINTOrigin location
destination_idBIGINTDestination location
base_priceDECIMAL(10,2)Base price
min_priceDECIMAL(10,2)Minimum vendor price
max_priceDECIMAL(10,2)Maximum vendor price (v4.23.0)
distance_kmFLOATDistance (km)
duration_minINTEstimated duration (min)

Vendor Vehicle Meta Box (VehicleTransferMetaBox.php)​

When editing a vendor's vehicle in the admin panel, VehicleTransferMetaBox displays the vendor's city information. This allows the admin to see which city's routes the vendor can access.


Data Saving and Security​

All form operations are handled asynchronously and securely (nonce-protected) via admin_post hooks:

// Example: hooks triggered during route saving
add_action('admin_post_mhm_save_route', array(self::class, 'handle_save_route'));
add_action('admin_post_mhm_delete_route', array(self::class, 'handle_delete_route'));

πŸ“¦ Database Backward Compatibility (DB Fallback)​

Transfer tables operate with the modern rentiva_ prefix, but also automatically detect legacy mhm_ tables from older systems via the resolve_table_name() method and preserve data.

Section Summary​

  • Transfer panels are designed with a stats-first approach.
  • The city field in the location form is required for vendor marketplace integration.
  • The min_price/max_price fields in the route form define the vendor price range.
  • VehicleTransferMetaBox shows city information when editing a vendor vehicle.
  • All data entry is performed atomically through the TransferAdmin class.

Changelog​

DateVersionNote
23.04.20264.27.2English translation added.
27.03.20264.23.0City field added to location form, max_price field added to route form, VehicleTransferMetaBox vendor city info added.
19.03.20264.21.2Page updated to reflect TransferAdmin stats cards and modern location structure.