Widget Developer Page

How to install BoxNow Map Widget

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

BoxNow Map Widget Javascript Code

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



parentElement required

Please fill CSS selector for Map Widget container. For example, just create <div id="boxnowmap"></div> and fill #boxnowmap. The BoxNow 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 yes or no. Default is yes.

autoclose optional

Use it when you want to change what happens after you select a locker. For type:iframe, the default value is yes, which means that the map will be hidden when the locker is selected. For type:popup, autoclose is always yes. The possible values are yes or no. The default value is yes.

autoselect optional

Selects a locker immediately after clicking on a locker on the map or in the list (not after clicking on the "select locker" button). Requires autoclose=no and type=iframe. The possible values are yes or no. The default value is yes.

buttonSelector optional

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

zip optional

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