1. Home
  2. Docs
  3. API documentation
  4. partner API
  5. Destination widget

Destination widget

As an alternative to integrating our API, you can contact customer support to request a
URL of a ready-made widget that you can embed into your check-out page. This widget
is communicating with our API and includes the same data you can access via GET /
destination.

See an example of a successful integration:

<?php echo file_get_contents('https://example.com/abc'); ?>

Insert this code with the url provided to you by our customer support into the body
section of your check-out page where the widget should be displayed.
Note: in order for this action to function properly, the page needs to be a .php file
By embeding the code, you download following resources from our serves:

  • HTML and CSS code of the widget
  • ‘HERE Map’ scripts necessary for displaying the map
  • Necessary scripts provided by Boxnow needed for the widget to function.
#boxnow_integration.active

By default, the div #boxnow_integration encompassing the entire widget is set to display: none;
To activate the widget, either assign the class .active to the element #boxnow_integration (i.e. via Javascript / jQuery), or include in your CSS file the following to display the widget:

#boxnow_integration.active {
display: block !important;
}

Removing the class (e.g. hiding the widget) is taken care of by the embedded
scripts.

?zip=
var userZipCode

On page load, the widget is listening for a URL parameter ?zip= and JS variable
userZipCode. If either one includes address located in Greece, it will automatically
fill in the content into the map search and will center the map around the provided
location. If both are provided, the variable userZipCode will be used.

window.boxnowLockerId

After selecting a locker, a window variable window.boxnowLockerId will be
created and will store the ID of the selected locker that you can pass with your
delivery request.