Integration of 1C-Bitrix with Barcode Scanners
Imagine: at a warehouse, a manager scans a box barcode, but the system can't find the item—though the barcode exists, it's linked to the wrong product. Or the scanner inputs the code but the field is out of focus, losing the data. We've encountered this dozens of times over 10+ years of integration experience and 50+ successful projects. The solution lies in correctly handling scanning on the Bitrix side, not the scanner itself. Our experience shows that 90% of issues are resolved by setting the suffix and focus.
A barcode scanner is the simplest peripheral: it emulates a keyboard and inputs the scanned code into the active field. The real issue is what the system does with that code: search for a product, add it to an order, verify a position during picking. Integration is primarily about proper scanning handling on the Bitrix side, not configuring the scanner itself. We guarantee that after our setup, the system will work without failures.
Scanner Types and Connection Methods
| Type | Connection | Keyboard Emulation | Application |
|---|---|---|---|
| USB HID | USB | Yes | Checkout, receiving |
| Bluetooth HID | Bluetooth | Yes | Mobile station |
| COM-port | RS-232 | No, direct port work | Legacy equipment |
| 2D imager (Honeywell, Symbol) | USB/BT | Yes | QR + barcode |
| Built-in into TSD | USB/WiFi | Via device API | Warehouse |
For most Bitrix tasks: USB HID scanner Bitrix works best—they connect without drivers. No special Bitrix-side configuration is needed—just handle input in the form correctly. However, COM ports require direct work with the port via API—this is more complex, but our certified expertise allows us to implement it in 2 days.
How to Find a Product by Barcode in Bitrix?
Barcodes in Bitrix are stored in the table b_catalog_product_barcode. Bitrix API Reference: b_catalog_product_barcode table Each product can have multiple barcodes (e.g., different packages: single item and a box of 12 with different EANs).
PHP code for barcode lookup
public static function findByBarcode(string $barcode): ?array { $result = \Bitrix\Catalog\EO_ProductBarcode_Collection::wakeUp( \Bitrix\Catalog\ProductBarcodeTable::getList([ 'filter' => ['=BARCODE' => $barcode], 'select' => ['PRODUCT_ID', 'BARCODE'], ]) ); $row = $result->fetch(); if (!$row) return null; // Load product data from catalog $product = \CIBlockElement::GetByID($row['PRODUCT_ID'])->GetNext(); return [ 'product_id' => $row['PRODUCT_ID'], 'name' => $product['NAME'], 'sku' => $product['PROPERTY_ARTICLE_VALUE'], 'price' => \CCatalogProduct::GetOptimalPrice($row['PRODUCT_ID'])['PRICE']['PRICE'] ?? 0, 'stock' => \CCatalogProduct::GetByID($row['PRODUCT_ID'])['QUANTITY'], ]; } If the barcode is not found in b_catalog_product_barcode, we search in the infoblock property PROPERTY_BARCODE (some projects store barcodes as a property). We unify through a single search method. Our experience shows that 30% of projects store barcodes only in properties—this is twice as slow as the barcode table.
Adding to Cart by Barcode
A quick-add component for checkout or B2B sections facilitates quick add to cart functionality.
JavaScript for quick add
// Input handler for search field const barcodeInput = document.getElementById('barcode-input'); barcodeInput.addEventListener('keydown', (e) => { if (e.key === 'Enter') { const barcode = e.target.value.trim(); if (!barcode) return; fetch('/api/catalog/by-barcode/', { method: 'POST', headers: {'Content-Type': 'application/json', 'X-Bitrix-Csrf-Token': BX.bitrix_sessid()}, body: JSON.stringify({barcode}) }) .then(r => r.json()) .then(data => { if (data.error) { showError('Product not found: ' + barcode); return; } addToCart(data.product_id, 1); barcodeInput.value = ''; barcodeInput.focus(); }); } }); Key point: the barcode input field must always be in focus. For checkout, we implement autofocus with setInterval—the scanner may input a code at any moment. Without this, 80% of scans would be ignored. Get in touch—we'll implement this turnkey in 7–9 days.
Verifying Positions During Order Picking
During order picking in the warehouse: the manager opens the order in the Bitrix admin panel, scans each item's barcode. The system highlights the found row in the order and checks a 'picked' checkbox. This process is 3x faster than manual verification.
Custom page at /bitrix/admin/order_assembly.php:
PHP AJAX handler for scanning
// AJAX handler for scanning if ($_REQUEST['action'] === 'scan_barcode') { $barcode = trim($_REQUEST['barcode']); $orderId = (int)$_REQUEST['order_id']; $product = BarcodeService::findByBarcode($barcode); if (!$product) { echo json_encode(['status' => 'not_found', 'barcode' => $barcode]); exit; } // Find the product in order items $order = \Bitrix\Sale\Order::load($orderId); $basket = $order->getBasket(); foreach ($basket as $item) { if ($item->getProductId() === $product['product_id']) { // Update picked counter AssemblyProgressTable::increment($orderId, $product['product_id']); echo json_encode(['status' => 'ok', 'item_id' => $item->getId()]); exit; } } echo json_encode(['status' => 'not_in_order', 'product' => $product['name']]); exit; } Inventory via USB Scanner
For office inventory without a TSD: a special page with a table where the manager scans barcodes with a fixed count. Each scan is an AJAX request that increments the item counter. At the end of the session, compare with stock in b_catalog_store_product and export discrepancies. Our solution speeds up inventory by 3x compared to manual counting, saving up to $10,000 annually for a mid-size warehouse (5000 SKUs). This is a key part of Bitrix warehouse management and warehouse automation Bitrix.
How to Implement Barcode Scanner in Bitrix (Step-by-Step)
- Connect the barcode scanner: choose USB HID scanner Bitrix for easiest setup.
- Set scanner suffix Enter: configure the scanner to send Enter after each barcode.
- Implement product lookup by barcode: use the
b_catalog_product_barcodetable (see code above). - Create a quick-add-to-cart component with autofocus.
- Build an order picking with scanner interface.
- Develop inventory with scanner module and reports.
- Test with a real scanner and train employees.
What to Do If the Scanner Adds Extra Characters?
Some scanners by default add characters after the barcode (Tab, Enter + Carriage Return). Scanner settings are usually changed by scanning a configuration barcode from the manufacturer's manual. For Bitrix, we recommend: scanner suffix Enter, no prefix, no CR. If characters persist, reflash the scanner using the provided configuration barcodes. This resolves 95% of issues instantly.
Deliverables (What You Get)
- Development of API to search product by barcode (1 day)
- Quick-add-to-cart component with autofocus (1-2 days)
- Order picking interface with scanner and progress tracking (2-3 days)
- Inventory module with discrepancy reports (2 days)
- Testing with real scanner (1 day)
- Documentation on scanner setup and employee training
- 1 month support after launch
Timelines
| Stage | Duration |
|---|---|
| Product search API by barcode | 1 day |
| Quick add to cart component | 1–2 days |
| Order picking interface with scanner | 2–3 days |
| Inventory module | 2 days |
| Testing with real scanner | 1 day |
| Total | 7–9 days |
Why Choose Us
With 10+ years of experience, 50+ successful barcode integrations, and a 5-year track record on the market, we guarantee quality and deadlines. Our turnkey solutions start from $2,500 and typically pay for themselves within 3 months through error reduction and speed gains. Consider the barcode integration cost savings: a typical project pays for itself quickly.
Order a turnkey integration—we'll evaluate your project in 1 day. Contact us for a consultation.







