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.



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. For type:iframe, the default value is true, which means that the map will be hidden when the locker is selected. The possible values are true or false.

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=false and type=iframe. The default value is true.

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=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.