Widget 2.0
    • PPL Access Point Widget — Implementation Guide for E-shops
    • 1. Quick Start — Integration in 5 Minutes
    • 2. Embedding the Widget into a Page
    • 3. Static HTML Integration
    • 4. Integration: Vanilla JavaScript
    • 5. Integration: PHP
    • 6. Integration: React
    • 7. Complete API Reference
    • 8. Advanced Scenarios
    • 9. Communication Channels Overview
    Switch to czech

    5. Integration: PHP

    The widget is purely frontend — PHP generates HTML with configuration and client-side JavaScript captures the user's selection.

    5.1 PHP with Inline Widget#

    Minimal variant — all default configuration is inherited from the admin based on api-key:
    If you need to override some admin settings for a specific page (e.g. center the map on the customer's address), use the config attribute:
    Important: The json_encode() function generates JSON with double quotes. The config attribute is wrapped in single quotes, so you must escape using htmlspecialchars($config, ENT_QUOTES) to prevent XSS and broken HTML.

    5.2 PHP Modal in Checkout with Cart Data#

    Only parameters that differ from the default admin configuration belong in config — typically cart data and optionally the customer's dynamic country:

    5.3 Processing the Selection on the Server#

    The widget is purely frontend. Client-side JavaScript captures the KM code (e.detail.code) of the selected point and inserts it into a hidden form field. When the form is submitted, the server receives the KM code as a regular POST parameter:
    Modified at 2026-04-22 11:59:46
    Previous
    4. Integration: Vanilla JavaScript
    Next
    6. Integration: React
    Built with