Download the PHP package keirontw/sylius-relay-point-plugin without Composer

On this page you can find all versions of the php package keirontw/sylius-relay-point-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sylius-relay-point-plugin

Sylius Relay Point Plugin

CI PHP

Carrier-agnostic relay point ("point relais") selection for the Sylius 2.x checkout.

Any carrier — French or international — plugs in by implementing a single PHP interface. Geocoding is equally swappable: Addok (French BAN, default, no API key), Nominatim, Google Maps, or Photon.


Screenshots

List + map Point selected Checkout context

Features


Requirements


Installation

Register the plugin in config/bundles.php:

Import plugin routes in config/routes.yaml:


Configuration

Create config/packages/keirontw_sylius_relay_point.yaml:

bpost: bpost does not expose a public API for parcel point search. Access requires a verified business partner agreement via the OSP portal. Contact bpost at https://www.bpost.be/en/business. The BpostProvider skeleton is ready and only needs the correct endpoint and field mapping once credentials are obtained.

Colis Privé: the relay point search WSDL URL and method name must be confirmed with Colis Privé technical support before enabling this provider. The ColisPriveRelayProvider skeleton is ready.


Checkout integration

Automatic Twig Hook (recommended)

The plugin auto-registers itself in the sylius_shop.checkout.select_shipping hook via PrependExtensionInterface. No template changes are required — the widget appears automatically when the customer selects a shipping method whose code is listed in shipping_method_codes.

Override the hook priority if needed:

Manual embed (alternative)

For custom checkout flows that do not use Twig Hooks:

Register the Stimulus controller

Install the npm package:

Add the entry to your assets/controllers.json:

Without npm: copy assets/shop/controllers/relay-point-picker_controller.js into your project's assets/controllers/ and import it in your entrypoint.

Widget events

The Stimulus controller dispatches events that bubble to window:

Event When event.detail
relay-point-picker:selected Customer clicks a point in the list or map { point }
relay-point-picker:confirmed Customer clicks "Confirm" { point }
relay-point-picker:error Network or API error { message }

When selectUrl is provided, the plugin automatically POSTs to the session on confirm. Listen to relay-point-picker:confirmed in your Stimulus controller to trigger the next checkout step:

Handle errors from the widget:

Order completion — built-in subscriber

When apply_relay_point_to_order: true (the default), the plugin registers RelayPointOrderSubscriber which:

  1. Runs on the Sylius order completion event
  2. Reads RelayPointSessionStorage::get($order->getTokenValue())
  3. If a relay point is found, updates the shipping address (street, postcode, city, countryCode, company = relay point name)
  4. Clears the session entry

No code change is needed. To disable it:

To extend the behaviour (e.g. store the relay point ID on a custom entity field), disable the built-in subscriber and write your own:


Customising the widget

CSS framework (Tailwind or Bootstrap)

The widget ships with a Tailwind-based layout by default, but the classes are not hardcoded in the template: every element resolves its class list through the relay_ui_class() Twig function, backed by Keirontw\SyliusRelayPointPlugin\Ui\RelayPointUiClasses. If your Sylius shop theme is still on Bootstrap, switch the theme in config — no template change needed:

This also covers the HTML the widget generates client-side (list items, the Leaflet popup, the carrier filter, opening hours). The Stimulus controller receives the active theme via data-relay-point-picker-theme-value and resolves the same semantic keys against its own UI_CLASSES map (assets/shop/controllers/relay-point-picker_controller.js) — the two class maps are kept manually in sync, so if you add a new element to the template, mirror the key in both RelayPointUiClasses and UI_CLASSES.

CSS variables (below) remain the recommended way to adjust colors/radius on either theme — you don't need to touch the class maps for a simple palette change.

CSS variables (theming — no Twig change needed)

All CSS is scoped to .relay-picker. Override the custom properties in your stylesheet:

Twig blocks (structural overrides — via {% embed %})

Use {% embed %} to override individual sections without duplicating the whole template:

Available blocks:

Block Contains
relay_styles <style> tag with CSS variable defaults
relay_search_bar Search input, submit button, sort control
relay_filter Carrier filter (hidden when only one carrier)
relay_grid Two-column map + list layout
relay_list Scrollable relay point list
relay_map Leaflet map container
relay_selected_summary Selected point detail panel
relay_confirm_button Confirm CTA inside the summary panel

Full template override

Copy the template to your bundle override path — Symfony will use it automatically:


Adding a custom carrier

Implement RelayPointProviderInterface and tag the service. No YAML mapping needed — autoconfiguration applies the tag via _instanceof.

The provider is immediately visible in the registry — no further config needed.


Adding a custom geocoding provider


Troubleshooting

Widget does not appear at checkout

Geocode returns no result / map is blank

Search returns an empty list

Relay point not saved to the order


Licence

MIT. See LICENSE.


All versions of sylius-relay-point-plugin with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-soap Version *
sylius/sylius Version ^1.9
symfony/http-client Version ^5.4 || ^6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package keirontw/sylius-relay-point-plugin contains the following files

Loading the files please wait ...