Widget Developer Page

How to install BOX NOW Map Widget

  1. Paste the BOX NOW Map Widget JavaScript code into the checkout page (or any other page where you want to display the BOX NOW Map Widget).
  2. Create new HTML button with class attribute boxnow-map-widget-button to open BOX NOW Map Widget. For example:
    <a href="javascript:;" class="boxnow-map-widget-button">Open widget</a>
  3. Create function for accept data from selected locker (id, address, name, etc.)

BOX NOW Map Widget Javascript Code

The most important is variable _bn_map_widget_config. There you can setup all required options.

Examples

Documentation

parentElement required

Please fill CSS selector for Map Widget container. For example, just create <div id="boxnowmap"></div> and fill #boxnowmap. The BOX NOW map widget will be placed inside this element.

afterSelect required for type:iframe and type:popup

Function that is triggered when the lock is selected. Included one parameter (object) contains all information about locker (properties boxnowLockerPostalCode, boxnowLockerAddressLine1 and boxnowLockerId are the most important).

partnerId optional

Please use your partnerId

type optional

Use iframe, popup or navigate. Default is iframe.

gps optional

Use it if you want to change the user's location request immediately after displaying the map. Possible options are true or false. Default is true.

autoclose optional

Use it when you want to change what happens after you select a locker. The default value is false, which means that the map will not be hidden when the locker is selected. The possible values are true or false. If the value is true then 'autoselect' parameter is required and 'autoselect' value should be false.

autoselect for type:iframe optional
for type:popup required

The possible values are true or false. For type:iframe the default value is true. If value is true you can select a locker immediately after clicking on a locker on the map or in the list. If value is false, you can select a locker only after clicking the 'select locker' button. For type:popup, value is required and should be false.

buttonSelector optional

You can change the default class name to open the BOX NOW Map Widget. Default is .boxnow-map-widget-button.

zip optional

If you have set gps=false, you can use this parameter to suggest a location on the map. The value can be a ZIP or part of a general address.