Connecting a Shop-Script store to ILFF
See also: Delivery widget for the cart · ILFF API · All CMS modules
Download the module ilff-shopscript.zip
The ILFF plugins link your store on Shop-Script (Webasyst) with the ILFF service:
- ILFF delivery methods appear in the checkout: by courier to the door and to a pickup point, with the price and delivery time; the shopper chooses the pickup point on a map;
- an order with ILFF delivery goes to ILFF on its own when it gets the status you chose;
- the tracking number and order status are returned to the store;
- product stock is passed from ILFF to the store;
- cancelling (deleting) an order in the store cancels the request in ILFF.
The store always starts the exchange: the plugins themselves call the ILFF service with the API key, and you do not need to open the store to us.
The archive holds two plugins:
- the store plugin «ILFF: фулфилмент и доставка» (ILFF: fulfilment and delivery): the API key, sending and cancelling orders, tracking and statuses, stock, the product list, the button for choosing a pickup point on a map;
- the shipping plugin «ILFF»: the delivery methods «Курьером до двери» (courier to the door) and «Пункт выдачи» (pickup point) in the checkout.
You need Shop-Script 8 or newer with the one-step checkout (version 2), PHP 7.4 or newer with the curl extension, access to the site files (FTP or the hosting panel), store administrator rights, server access to set up cron and access to the ILFF client account. The connection takes 20–30 minutes.
The plugins and the ILFF client account are in Russian, so their labels are given below as they appear on the screen, with a translation in brackets.
Step 1. Connection in the ILFF client account
Client account → the Интеграции (Integrations) tab → expand the Интернет-магазин (Online store) block.
- Платформа (Platform): choose Shop-Script.
- Адрес магазина (Store address): the site address, for example
shop.ru. - The Заказ с несвязанным товаром ждёт привязки (An order with an unlinked product waits for linking) checkbox: when it is on, an order with a product that is not yet linked to your product in ILFF is not accepted until you link it (step 6). We recommend leaving the checkbox on.
- Press Подключить (Connect). The account creates the connection. It does not call the store at this point: the plugin checks the link at step 3.
The Ключ API (API key) is shown at the top of the Интеграции tab. If it is missing, press Сгенерировать (Generate). You will need the key at step 3. Do not send it to anyone: the ILFF service recognises your store by it. The код клиента (client code) for the widget is in the same place; add the store domain to the домены виджета (widget domains) list.
Step 2. Installing the plugins
- Download the archive
ilff-shopscript.zipfrom the module page on the ILFF site or get it from your manager. - Unpack the archive into the site root (the directory with
index.phpand thewa-appsandwa-pluginsfolders). The directorieswa-apps/shop/plugins/ilffandwa-plugins/shipping/ilffwill appear. - Enable the store plugin: open the file
wa-config/apps/shop/plugins.phpand add this line before the last line);
'ilff' => true,
- Clear the cache: in the Webasyst backend Настройки → Очистить кэш (Settings → Clear cache), or delete the contents of the
wa-cachedirectory. - Open Магазин → Плагины (Store → Plugins): ILFF: фулфилмент и доставка appears in the list. On the first opening the plugin creates its tables (the order queue).
- Add the delivery method: Магазин → Настройки → Доставка → Добавить способ доставки → ILFF (Store → Settings → Shipping → Add shipping method). Enable it and save. The option names («Курьером до двери», «Пункт выдачи», «Почта России») can be changed in its settings. The Почта России до отделения (Russian Post to the post office) checkbox is there too, on by default: a separate «Почта» option with the price «от N ₽» (from N ₽); when it is chosen, the widget opens on the «Почта» tab, the shopper chooses a post office, and the exact price and delivery time appear. Switch the checkbox off if you do not need Russian Post delivery.
Step 3. Store plugin settings
Магазин → Плагины → ILFF: фулфилмент и доставка.
- Ключ API ILFF (ILFF API key): the key from step 1.
- Адрес сервиса ILFF (ILFF service address): already filled in, no need to change it.
- Подсказка городов ILFF (ILFF city suggestion; on by default): the "City" field of the checkout gets its own list of cities from the ILFF directory: first the cities of the chosen region, below them the cities of other regions with the region name. Choosing a city of another region switches the region in the form on its own. While the shopper is typing, delivery is not recalculated, only after a city is chosen from the list or the field is left.
- Код клиента ILFF для виджета (ILFF client code for the widget): the code from the client account. Without the code the button for choosing a pickup point on the map is not shown. Вариант настроек калькулятора (Calculator settings profile) is the profile code from the ILFF client account, for example
site2, if this site has its own delivery settings. Empty means the default settings. Free delivery thresholds («Бесплатно для получателя от суммы товаров») are set in the ILFF client account, and when the goods total reaches the threshold the module shows delivery as «Бесплатно» (Free). - Адрес подсказки городов (City suggestion address): optional. Empty means it is taken from the ILFF service next to the service address.
- Отправлять заказ в ILFF в статусе (Send the order to ILFF in the status): by default «Подтверждён» (processing). The order goes when it moves to this status. If you check the order or wait for payment, choose the status you move the order to after the check.
- Отменять заявку ILFF в статусах (Cancel the ILFF request in the statuses): by default «Удалён» (Deleted) and «Возврат» (Refunded). Moving to such a status cancels the request in ILFF.
- Действия по статусам ILFF (Actions by ILFF statuses). The value «не менять статус» (do not change the status) leaves the order as it is:
| Setting | ILFF statuses | Default |
|---|---|---|
| Передан в службу доставки → действие (handed over to the carrier → action) | Передан в КС | Отправлен (Shipped) |
| Доставлен или выдан → действие (delivered or handed out → action) | Доставлен клиенту, Выдан, Частичная выдача | Выполнен (Completed) |
| Отменён в ILFF → действие (cancelled in ILFF → action) | Отменен, Аннулирован | не менять |
| Возврат или отказ → действие (return or refusal → action) | Возврат принят, Полный отказ | не менять |
The action is performed only if it is available in the current order status.
- Оплата при получении (плагины оплаты) (Cash on delivery, payment plugins): the identifiers of payment plugins separated by commas,
cashby default. Only these methods will have cash on delivery in the request, the other orders are treated as prepaid. - Загружать остатки из ILFF (Load stock from ILFF): free stock is written to the SKU quantity, that is the stock at the ILFF warehouse minus the reserve and the orders that have not reached ILFF yet. Склад магазина для остатков (Store warehouse for stock): if you have several warehouses, choose the one where the ILFF stock is written.
- Press Сохранить (Save). The plugin checks the connection to ILFF at once: on an error you will see «Настройки сохранены, но связи с ILFF нет: …» (settings saved, but there is no connection to ILFF) at the top.
Step 4. Checkout and payment
- The checkout must be one-step (Магазин → Витрина → Оформление заказа, version 2). The «Доставка» (Shipping) step is on and contains the ILFF method.
- The calculation needs an address: region and city. For a courier, also the street with the house number.
- Курьером до двери is shown with the price and delivery time of the cheapest rate (including the Russian Post «онлайн» courier if it is cheaper). If the street is not in the address directory (villages, new streets), the courier price is calculated by city and the address goes into the order as entered. The first calculation for a new city can take 10–15 seconds, repeated ones 1–2 seconds.
- Самовывоз (pickup) is visible at once with the price «от N ₽» and the delivery time of the cheapest point of the city. When this tile is chosen, the ILFF widget opens with a map, a list of points and carriers (if it is closed, the Выбрать пункт выдачи на карте button, choose a pickup point on the map, stays under the tile). After a point is chosen the shipping step is refreshed: «Пункт выдачи: адрес» with the exact price and delivery time, and the Изменить пункт выдачи (change the pickup point) button lets the shopper choose another. Until a point is chosen, the checkout does not let the shopper go further. When the city changes, the chosen point is reset. Courier delivery has no point button. If the shopper's city has no pickup points or post offices, the option is called «…: выберите ближайший на карте» (choose the nearest on the map): the map opens at the address point, the points of neighbouring cities are shown with the distance, new ones are loaded when the map is moved or zoomed, and the price is calculated to the chosen point.
- A cash on delivery payment method (for example, «Наличными при получении», the
cashplugin) must be available for ILFF delivery: Магазин → Настройки → Оплата (Store → Settings → Payment) → the method settings → the shipping methods it is available for. If the «Оплата» (Payment) step is off in the checkout, switch it on in the checkout settings. - Switch off the delivery methods with a fixed price if ILFF does the delivery.
- Place a test order with ILFF delivery, move it to the sending status and make sure the order has arrived in ILFF: the order history will show «ILFF: создана заявка …» (request created).
Step 5. Cron
The plugin task must be run by the system cron of the server every 5–10 minutes:
php /path/to/site/cli.php shop ilffPluginCron
The task:
- resends orders that did not go at once (after a connection failure or from waiting for linking): after 1, 5, 15, 60 and 180 minutes, but not more often than the task runs;
- fetches tracking numbers and statuses: the tracking number is written to the «Трек-номер» field of the order and to the history, and the status is changed by the action from step 3;
- updates stock;
- once a day sends the product list to ILFF and reconciles all stock.
Without cron tracking numbers, statuses and stock will not be updated. Orders go to ILFF at once when the status changes, even without cron.
Step 6. Linking products
In the ILFF client account the Товары магазина (Store products) button in the "Интернет-магазин" block shows the store products sent by the plugin and their link to your products in ILFF. Each Shop-Script SKU is a separate product. The link is matched first by barcode, then by the SKU code.
Shop-Script has no barcode field of its own: create a product feature with the code barcode (or ean, gtin) of the «Строка» (String) type and fill it in for products or SKUs.
| Status | What to do |
|---|---|
| Связан (Linked) | Nothing, the link is saved |
| Подобран (Matched) | Check and confirm |
| Несколько совпадений (Several matches) | Choose the right product manually |
| Не найден (Not found) | Choose a product manually or fill in the barcode or SKU code in the store |
If an order is waiting for linking, a banner with the number of such orders appears at the top of the Интеграции tab, and the "Интернет-магазин" block shows a table with the orders and products. After linking, the plugin resends the order itself.
Order cancellation
Moving an order to a cancellation status (step 3) cancels the request in ILFF until it has been handed over to the carrier; a picked order goes back to storage. If the request is already with a carrier that accepts cancellation (Dalli, 5Post), the cancellation is passed to it and the order returns to the warehouse. With other carriers a request in work is not cancelled on its own: the order history gets the entry «ILFF: Заявка уже в работе…» (the request is already in work), contact your manager.
Updating the plugins
- Download the new archive
ilff-shopscript.zipfrom this page. - Unpack it into the site root over the old files (the directories
wa-apps/shop/plugins/ilffandwa-plugins/shipping/ilff). The settings of the plugins and of the delivery method are kept. - Clear the cache (Настройки → Очистить кэш).
If something does not work
| Message or symptom | Cause and solution |
|---|---|
| «Связи с ILFF нет: Неверный ключ API» (No connection to ILFF: wrong API key) | The key was entered with an error or replaced. Copy the key from the client account and save the settings |
| «Связи с ILFF нет: В личном кабинете ILFF не подключён магазин Shop-Script» (the Shop-Script store is not connected in the ILFF client account) | Step 1 is not done: choose the Shop-Script platform and press «Подключить» |
| «Связи с ILFF нет: Сервис ILFF не ответил» (the ILFF service did not respond) | The store server cannot reach ILFF: check outgoing HTTPS connections to port 8443 and the curl extension in PHP |
| The plugin is missing in «Магазин → Плагины» | The line 'ilff' => true, is not added to wa-config/apps/shop/plugins.php or the cache is not cleared |
| The ILFF delivery method is missing in the checkout | The method is not added or is off (step 2), the region and city are not filled in, or the store plugin has no API key |
| «Нет тарифов» (No rates) or «Курьер» disappears after a point is chosen | Check that the region in the form matches the city (choose the city from the suggestion and the region switches on its own). If the ILFF service responds slowly, repeat the choice in a minute |
| No «Выбрать пункт выдачи на карте» button | The client code for the widget is not entered (step 3) or the ILFF delivery method is off |
| The widget says that points are unavailable | The store domain is not added to the widget domain list in the client account |
| Delivery is «Бесплатно» (Free) everywhere | The delivery cost is zeroed by a discount or a store plugin (for example, a "free shipping" rule). Check the discount rules and plugins |
| No cash on delivery payment method | The payment method is not available for ILFF delivery or the «Оплата» step is off (step 4) |
| An order did not arrive in ILFF | Check the order status and the «Отправлять заказ в ILFF в статусе» setting, and the "waiting for linking" block in the account. The order must have ILFF delivery |
| The tracking number and status do not arrive | Cron is not set up (step 5) |
| Stock in the store differs from stock in the account | The store receives free stock: without the reserve, unsent orders and goods in receiving |