boxnowLogoPopup

Try out the

BOX NOW App!

BoxNow

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-widget-button to open BOX NOW 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.)

BOX NOW Map Widget Javascript Code

<div id="boxnowmap"></div>
<script type="text/javascript">
  var _bn_map_widget_config = {
      partnerId: 123,
      parentElement: "#boxnowmap",
          afterSelect: function(selected){
          alert(selected.boxnowLockerPostalCode);
          alert(selected.boxnowLockerAddressLine1);
          alert(selected.boxnowLockerId);
      }
  };
  (function(d){var e = d.createElement("script");e.src = "https://widget-cdn.boxnow.hr/map-widget/client/v5.js";e.async = true;e.defer = true;d.getElementsByTagName("head")[0].appendChild(e);})(document);
</script>

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

Examples

  1. Example 1
  2. Example 2
  3. Example 3
  4. Example 4
  5. Example 5

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