Download the PHP package keirontw/relay-point-bundle without Composer

On this page you can find all versions of the php package keirontw/relay-point-bundle. 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 relay-point-bundle

Keirontw Relay Point Bundle

Carrier-agnostic relay point ("point relais") selection for any Symfony project — no e-commerce framework required. Provides a search/geocoding API, a session-backed selection store, and a ready-to-embed Stimulus widget.

Supported carriers: Mondial Relay, Chronopost, Shop2Shop, Colissimo, InPost, Colis Privé, DPD, DHL, Packeta, PostNL, Bpost, GLS.

Installation

Register the bundle in config/bundles.php (skip this step if you use Symfony Flex and it was added automatically):

Import the shop routes in config/routes.yaml:

Configuration

Create config/packages/keirontw_relay_point.yaml and enable the carriers you need. Every carrier is disabled by default; only enabled: true carriers get wired into the container.

See src/DependencyInjection/Configuration.php for the full tree (every carrier's required options) and src/Provider/** for the corresponding provider implementation.

To plug your own backend instead of Addok/Nominatim/Google/Photon, set geocoding.provider: custom and alias the interface yourself:

To add a carrier the bundle doesn't ship, implement Keirontw\RelayPointBundle\RelayPoint\RelayPointProviderInterface — it's autoconfigured and auto-tagged, no manual service registration needed.

Frontend assets

The widget is a Stimulus controller. Wire it depending on your asset pipeline:

AssetMapper — nothing to do. If symfony/asset-mapper is installed, the bundle registers its assets/shop directory (under the keirontw_relay_point namespace) automatically via prependExtensionConfig. The controller is picked up by symfony/stimulus-bundle's auto-discovery like any other mapped asset.

Webpack Encore — copy assets/shop/controllers/relay-point-picker_controller.js into your own assets/controllers/ and register it in your assets/controllers.json (or symfony_ux autodiscovery if you vendor it via a package).

The widget also expects Leaflet (L global) to be loaded on the page for the map panel.

Embedding the widget

Include the template wherever you want the picker to render (checkout step, an admin order edit page, anywhere):

methodCodes should be the subset of your configured shipping_method_codes that are actually active for the current order/cart (e.g. the customer's chosen shipping method, if it's a relay-point one). The widget only searches carriers whose method code is in that list.

See the docblock at the top of templates/shop/relay_point_picker.html.twig for the full list of optional variables (pre-filled address, CSS variable theming) and the Twig blocks you can override via {% embed %}.

Reading the customer's selection

The bundle does not assume any order/cart model — you decide when and how to persist the selection. The widget POSTs to keirontw_relay_point_shop_select on every pick, which stores it in the session via RelayPointSessionStorage.

Option A — automatic, via the built-in checkout listener

Implement RelayPointAddressApplierInterface once in your app:

Then point the bundle at your own checkout-completed event:

The bundle registers RelayPointCheckoutListener as a kernel.event_listener for that event class. It reads the session selection, calls your applier, and clears the session — you never touch RelayPointSessionStorage directly. Your RelayPointAddressApplierInterface implementation must be the only service implementing the interface (or aliased explicitly) so autowiring can find it.

Option B — manual

Skip the config above and read the storage yourself wherever you need it:

SelectedRelayPoint (returned by ->get()) exposes: id, name, street, postcode, city, countryCode, latitude, longitude, carrierCode, shippingMethodCode, distanceInMeters, openingHours.

Development

License

MIT


All versions of relay-point-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-soap Version *
symfony/framework-bundle Version ^6.4 || ^7.0
symfony/http-client Version ^6.4 || ^7.0
symfony/twig-bundle Version ^6.4 || ^7.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/relay-point-bundle contains the following files

Loading the files please wait ...