Connecting a CS-Cart store to ILFF
See also: Delivery widget for the cart · ILFF API · All CMS modules
Download the module ilff-cscart.zip
The add-on "ILFF delivery and fulfilment" links your CS-Cart store and the ILFF service:
- ILFF methods appear in the checkout: courier to the door, a pickup point chosen on a map and Russian Post, with the price and delivery time;
- an order with an ILFF delivery method goes to ILFF on its own when it gets the status you chose;
- the ILFF tracking number becomes a shipment of the order: the shopper receives a shipment email and sees the tracking number in their account;
- the order status changes by the ILFF status;
- stock, weight and dimensions of products are passed from ILFF to the store;
- cancelling an order in the store cancels the request in ILFF.
The store always starts the exchange: the add-on itself calls the ILFF service with the API key, and you do not need to open the store to us.
You need:
- CS-Cart 4.21 (tested on CS-Cart 4.21.2, the Russian build);
- PHP 8.1 or newer with the curl extension;
- the main store currency is the Russian rouble, and the RUB currency is in the currency list: ILFF calculates delivery and order amounts in roubles;
- ILFF methods work only within Russia;
- store administrator rights, access to the server cron or the hosting scheduler and to the ILFF client account.
The connection takes 15–20 minutes.
The add-on has an English version, and its labels are given below as in English. The ILFF client account is in Russian, so its labels are given 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 CS-Cart.
- Адрес магазина (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 5). We recommend leaving the checkbox on.
- Press Подключить (Connect). The account creates the connection. It does not call the store at this point: the add-on 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 pickup point widget is in the same place; add the store domain to the домены виджета (widget domains) list.
Step 2. Installing the add-on
- Download the archive
ilff-cscart.zipfrom the module page on the ILFF site or get it from your manager. Do not unpack the archive. - In the CS-Cart admin panel open Add-ons → Manage add-ons, press + (upload and install an add-on) and choose the archive.
During installation the add-on itself creates the shipping methods ILFF courier, ILFF pickup point and Russian Post (ILFF) with realtime rates. ILFF calculates their price.
Step 3. Add-on settings
Open Add-ons → Manage add-ons, find the add-on ILFF delivery and fulfilment and open its Settings.
Connection with ILFF
- API key: the key from step 1.
- Service URL: already filled in, no need to change it.
- Client code (widget): the code from the client account. Without the code the pickup point map is not shown.
- Calculator settings variant: the variant 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. - City suggestions URL: optional, usually leave it empty.
Orders
- Send the order to ILFF in statuses: "Processed" by default. The order goes when it moves to one of the ticked statuses. An order in the "Open" status does not go to ILFF: move it to "Processed" once you have checked it.
- Cancel the ILFF request in statuses: "Canceled" by default. Moving a sent order to such a status cancels the request in ILFF.
- Cash on delivery payment methods: tick the methods with which the shopper pays on receipt. Such orders go to ILFF with cash on delivery, the others are treated as prepaid.
Order statuses by ILFF statuses. "- do not change -" leaves the status as it is:
| Setting | ILFF statuses | Default |
|---|---|---|
| Order status for "Handed to the carrier" | Передан в КС (handed over to the carrier) | Complete |
| Order status for "Delivered" | Доставлен клиенту, Выдан, Частичная выдача (delivered, handed out, partially handed out) | Complete |
| Order status for "Cancelled" | Отменен, Аннулирован (cancelled, voided) | Canceled |
| Order status for "Returned" | Возврат принят, Полный отказ (return accepted, full refusal) | do not change |
CS-Cart has no separate "Shipped" status, so an order handed over for delivery becomes "Complete" by default. If you have created your own status, choose it here.
Stocks and weights
- Get stocks from ILFF: free stock is written to the product quantity, that is the stock at the ILFF warehouse minus the reserve and the orders that have not reached ILFF yet. Goods in the receiving area of the warehouse are not part of the stock until they are put away. Products without inventory tracking are not changed.
- Get product weights and dimensions from ILFF: the weight and dimensions measured at the ILFF warehouse are written to products and variations.
- Get weight and dimensions of the packed order: the weight, dimensions and number of packages of the picked order are shown in the ILFF block of the order.
Save the settings and press Check connection in the Exchange state block: "Connection with ILFF is OK." appears. If there is no connection, the reason is shown in the same place (see "If something does not work").
The Exchange state block shows the ILFF shipping methods, the order queue, the time of the last exchange runs, the exchange task URL and the error log. Press Send products to ILFF: the products go to ILFF for linking (step 5).
Step 4. Shipping methods and what the shopper sees
Administration → Shipping & taxes → Shipping methods: you can rename ILFF methods and change their order and description; do not set a price for them, ILFF calculates it. Switch off a method you do not need. Switch off your own shipping methods with a fixed price if ILFF does the delivery. An ILFF method can also be created manually: realtime rate calculation with the service "ILFF: courier", "ILFF: pickup point" or "ILFF: Russian Post".
The shopper in the checkout:
- ILFF courier: the price and delivery time. The price is calculated by the city of the shopper's address, the street goes to ILFF with the order.
- ILFF pickup point: before a point is chosen, "Choose a pickup point on the map, from N ₽" and the button Choose a pickup point on the map. Choosing this method opens the map on its own. After a point is chosen, the address of the point is shown under the method, the method shows the exact price and delivery time, and the button becomes Choose another pickup point.
- Russian Post (ILFF): Russian Post to the shopper's address, if the ILFF service calculates Russian Post for your store.
- On the courier tab of the widget the shopper can choose a courier carrier: the "ILFF courier" method is selected with the price of that carrier.
- Without a chosen point an order with the "ILFF pickup point" method is not placed: "Choose an ILFF pickup point on the map." appears.
If the shopper's city has no pickup points, the widget shows the nearest points of neighbouring cities with the distance; the price is calculated to the chosen point. An ILFF method that does not deliver to the shopper's address is not shown in the list.
Place a test order with an ILFF method, move it to the sending status and make sure the order has arrived in ILFF.
Step 5. Linking products
In the ILFF client account the Товары магазина (Store products) button in the "Интернет-магазин" block shows the store products sent by the add-on and their link to your products in ILFF. The link is matched by SKU, the CS-Cart product code (CS-Cart has no barcode field).
| 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 product code in the store |
A product with variations (the Product variations add-on: size, colour) is passed as variations: each has its own code, and stock and orders go by variation.
If an order is waiting for linking, a banner with the number of such orders appears at the top of the Интеграции tab. After linking, the add-on resends the order itself.
The order in the store
The order page in the CS-Cart admin panel has an ILFF block in the right column: the delivery type, the ILFF request number, the exchange state ("sent", "waiting for product binding", "in queue"), the ILFF status, the tracking number, with the checkbox on the weight, dimensions and number of packages, and the exchange error if there was one.
When a tracking number appears in ILFF, the add-on creates a shipment of the order: the ILFF carrier, the tracking number and the tracking link in the comment. The shopper receives a shipment email and sees the tracking number in their store account.
Order cancellation
Moving an order to a cancellation status 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 ILFF block of the order shows a reply that the request is already in work, contact your manager.
The exchange task
The exchange task must be run every 15–60 minutes. The Exchange state block of the add-on settings shows the exchange task URL with a secret token. Add it to the server cron or the hosting scheduler, for example:
*/15 * * * * wget -q -O - "<exchange task URL>" >/dev/null 2>&1
Do not publish the URL: without the right token the task does not run.
The task resends orders that did not go at once (after 1, 5, 15, 60 and 180 minutes), fetches tracking numbers and statuses, updates stock and weight, and once a day checks the connection, sends the product list and reconciles all stock. Orders go to ILFF at once when the status changes, even without the task. The time of the last runs is shown in the "Exchange state" block; the Run exchange now button is there too.
Updating and removing
Updating: upload the new add-on archive the same way as on installation (Add-ons → Manage add-ons → +). The settings and data are kept.
Removing (Add-ons → Manage add-ons, the ILFF add-on → Uninstall): the ILFF shipping methods are switched off (your orders refer to them), and the ILFF data in the orders stays.
If something does not work
| Message or symptom | Cause and solution |
|---|---|
| "ILFF API key is not set." | Enter the key from the client account and save the settings |
| "No connection with ILFF: wrong API key" | The key was entered with an error or replaced. Copy the key from the client account and save the settings |
| "No connection with ILFF: the store is not connected in the ILFF client account" | Step 1 is not done: choose the "CS-Cart" platform and press «Подключить» |
| "No connection with ILFF: the ILFF service did not respond" | The site server cannot reach ILFF: check outgoing HTTPS connections to port 8443 and the curl extension |
| ILFF methods are missing in the checkout | The address is not in Russia, the address has no city, the methods are switched off or no ILFF service is chosen for the method |
| No "ILFF pickup point" or the map is not shown | The client code for the widget is not entered (step 3) |
| The map opens but the points do not load | The store domain is not added to the widget domain list in the ILFF client account |
| An order did not arrive in ILFF | Check the order status and the "Send the order to ILFF in statuses" setting, the ILFF block on the order page (an exchange error) and the "waiting for linking" banner in the account |
| The tracking number and status do not arrive | The exchange task is not set up: see the time of the last runs in the "Exchange state" block |
| Stock in the store differs from stock in the account | The store receives free stock: without the reserve, unsent orders and goods in receiving |
The add-on writes exchange errors to the log var/ilff/ilff.log in the store folder, without the API key and shopper data; the log is also visible in the "Exchange state" block. For other questions contact your ILFF manager.