Bliska Paczka Widget

v7.0

Allows user to pick Bliska Paczka point of service on interactive map with several extra features.

See demo page.

Migration from version v6

Migration from version v5

Migration from version v4

Migration from version v3

See options for more details.

Migration from version v2

See options for more details.

Installation

In order to install Bliska Paczka Widget on your web page include following code snippets in head section of your html document:

Script:

<script type="text/javascript" src="https://widget.bliskapaczka.pl/v7.0/main.js"></script>

Stylesheet:

<link rel="stylesheet" href="https://widget.bliskapaczka.pl/v7.0/main.css" />

Bliska Paczka Widget will be available through object assigned to global variable BPWidget.

To initialize widget use method:

 BPWidget::init(element: HTMLElement, options: BPWidgetOptionsObject): void

Widget will be displayed in given html element. Element has to have width and height defined and should be displayed on page when map is initialized.

Example of usage

<div id="bpWidget" style="height: 800px; width: 1024px;"></div>
BPWidget.init(
    document.getElementById('bpWidget'),
    {
        callback: function(point) {
            console.log('point code:', point,code);
            console.log('point operator:', point.operator);
        },
        posType: 'DELIVERY',
        codOnly: false
    }
);

Responsive behavior

Bliska Paczka Widget changes its look depending of given width. Breakpoints: 992px, 768px, 576px.

See our demo for details.

Options


operators

({operator: string, price?: number, checked?: boolean}[]) [optional]

Indicates operators that will be available on widget, by setting 'checked' option you can select which one are 'activated'. Also provides interface for displaying shipment prices for each operator. By default all operators fully supported in this version of widget are available with no prices displayed. You can use this property to display prices, limit end user operator selection options or add operators not supported by default in this widget version.

Names and code names of operators fully supported in this widget version:

Option operators as value takes array of objects with following properties:

Example: [{operator: "RUCH", price: 5}, {operator: "INPOST", price: 5}].


brands

({brand: string, price?: number}[]) [optional]

Indicates brands that will be available on widget, by setting 'checked' option you can select which one are 'activated'. Also provides interface for displaying shipment prices for each brand. By default all brands fully supported in this version of widget are available with no prices displayed. You can use this property to display prices, limit end user brand selection options or add brands not supported by default in this widget version.

Names and code names of operators fully supported in this widget version:

Option brands as value takes array of objects with following properties:

Example: [{brand: "RUCH", price: 5}, {brand: "INPOST", price: 5}].


posType

(string) [optional]

Filter displayed points by scope.

Options: 'DELIVERY', 'POSTING'.


codOnly

(boolean) [optional]

Show only points with cash on delivery available.


showCod

(boolean) [optional]

Show cash on delivery filter in the widget header. If codOnly is true the checkbox is disabled.


callback

(function(pos): void) [optional]

Callback function executed when user pick point on the widget. It is invoked with point object as argument.

Example callback argument:

{
    "code": "AB-234-567",
    "operator": "POCZTA",
    "brand":"ORLEN",
    "description": "Stacja benzynowa",
    "street": "Testowa 2",
    "postalCode": "12-345",
    "city": "Testowe",
    "province": "Test",
    "latitude": "51.08464"
    "longitude": "17.02478",
    "cod":false
    "openingHoursMap": {
        "WEDNESDAY": {
            "from": "09:00",
            "to": "12:00"
            },
        "MONDAY": {
            "from": "09:00",
            "to": "12:00"
        },
        "THURSDAY": {
            "from": "09:00",
            "to": "12:00"},
        "SUNDAY": {
            "from": "02:00",
            "to": "02:22"
        },
        "FRIDAY": {
            "from": "09:00",
            "to": "12:00"
        },
        "TUESDAY": {
            "from": "09:00",
            "to": "12:00"
        }
    }
}

selectedPos

({code: string, operator: string}) [optional]

Point that will be selected on map initialization.

Example: {"code": "123-456", "operator": "RUCH"}.


initialAddress

(string) [optional]

Address that will be visible on map by default. This option is ignored when selectedPos option is present.


readyCallback

(function(): void) [optional]

Callback function executed when map loading is finished.


mapOptions

({center: { lat: number, lng: number}, zoom: number, gestureHandling: boolean}) [optional]

Open street maps map options. Example: center: { lat: 52.226376, lng: 21.009979 }, zoom: 6, gestureHandling: true.


testMode

(boolean) [optional]

Change point source to sandbox-bliskapaczka.pl environment. Default: false

mapOnly

(boolean) [optional]

Allows to show map without search or filters. Default: false

Versioning

In order to automatically follow minor releases use chosen major version in resource url, e.g.

<script type="text/javascript" src="https://widget.bliskapaczka.pl/v3/main.js"></script>
<link rel="stylesheet" href="https://widget.bliskapaczka.pl/v3/main.css" />

Releases