<script id="ISDEKscript" type="text/javascript" src="https://your.site/path-of-widget-on-your-site/widjet.js" charset="utf-8"></script>And also copy the service.php file to your website, in which you can make settings in accordance with your integration data. For example, in lines 11 and 14 indicate the tariffs used:
/** Настройте приоритет тарифов курьерской доставки */ /** Set up the priority of courier delivery tariffs */ array(233, 137, 139, 16, 18, 11, 1, 3, 61, 60, 59, 58, 57, 83), /** Настройте приоритет тарифов доставки до пунктов выдачи */ /** Set the priority of delivery tariffs to pick-up points */ array(234, 136, 138, 15, 17, 10, 12, 5, 62, 63),And in lines 17 and 20, indicate the account for the integration in order to receive the shipping cost in accordance with your contract:
/** Вставьте свой аккаунт\идентификатор для интеграции */ /** Put your account for integration here */ 'ACCOUNT_FROM_INTEGRATION', /** Вставьте свой пароль для интеграции */ /** Put your password for integration here */ 'SECURE_PASSWORD_FROM_INTEGRATION'To display the widget on your site, you need to create a javascript handler for the widget:
<script type="text/javascript"> var ourWidjet = new ISDEKWidjet ({ defaultCity: 'Omsk', //default city to display with pickups points cityFrom: 'Moscow', // city from which orders will be sent lang: 'eng', // set the language of the widget country: 'Россия', // you can select the country for which to display the list of pickup points link: 'forpvz', // id of the HTML element into which the widget will be written path: 'https://widget.cdek.ru/widget/scripts/', //library directory servicepath: 'http://yoursite.net/service.php' //link to service.php file on your site }); </script>
And also on the page it is necessary to place an element into which the card with the points of issue of orders will be inscribed. The element requires a height.
<div id="forpvz" style="width:100%; height:600px;"></div>
Examples of using the widget: list of examples (RU)
The history of changes of the widget can be viewed in the file: module changelog
Some of the widget's capabilities are presented below. More detailed possibilities can be found by, downloading the documentation for the widget.
Number of goods: 1 pcs.
Weight of goods: 2 kg.