1. Go to this page and download the library: Download serdominus/elit-econnector library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
serdominus / elit-econnector example snippets
use Elit\EConnector\ElitConnector;
use Elit\EConnector\SendBasketItem;
use Elit\EConnector\Exception\ElitException;
// Ініціалізація (testMode: true = тестовий сервер)
$connector = new ElitConnector(
company: ElitConnector::COMPANY_CZ,
login: 'your_login',
password: 'your_password',
testMode: false
);
// Отримати інформацію про товар
$item = $connector->getItem('NET 12 N 7439');
echo $item->description;
// Отримати ціну та залишки
$infoList = $connector->getItemInfo('NET 12 N 7439', qty: 1);
// Відправити замовлення
$success = $connector->sendBasket([
new SendBasketItem('NET 12 N 7439', 2, 'MY-REF', false, '2024-12-31'),
]);
new SendBasketItem(
no: 'NET 12 N 7439', // Артикул (обов'язково)
quantity: 2, // Кількість (обов'язково)
yourReference: 'MY-REF-001', // Примітка, макс. 20 символів
cashAndCarry: false, // Самовивіз
requestedDeliveryDate: '2024-12-31' // Бажана дата доставки
);
use Elit\EConnector\Exception\ElitException;
use Elit\EConnector\Exception\AuthException;
try {
$item = $connector->getItem('SOME-ITEM');
} catch (AuthException $e) {
// Неправильні облікові дані або недостатньо прав
echo "Авторизація: " . $e->getMessage();
} catch (ElitException $e) {
// Інші помилки API
echo "Помилка API: " . $e->getMessage();
}
// Тестовий
$connector = new ElitConnector('ELIT_CZ', 'login', 'pass', testMode: true);
// Production
$connector = new ElitConnector('ELIT_CZ', 'login', 'pass', testMode: false);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.