B2B Personal Cabinet Development on 1C-Bitrix
A corporate buyer comes to the cabinet not for beautiful interface — he needs to find an order from three months ago in 2 minutes, download a waybill, and check if he's within credit limit. If the cabinet doesn't provide this, he calls the manager. This is the metric of failure: number of calls on questions that should be solved independently.
Principal Differences of B2B Cabinet from B2C
In retail cabinet user sees only his orders. In B2B:
- Multiple employees of one company with different roles
- Orders created on behalf of company, not individual
- Credit limit and debt — shared for company
- Documents (invoices, waybills) tied to legal entity
- Order approval before confirmation
Standard bitrix:sale.personal.orders covers none of these scenarios.
Managing Company Users
Central entity — Company, linked to Bitrix users via HighLoad-block b2b_company_users. Fields: UF_COMPANY_ID, UF_USER_ID, UF_ROLE, UF_ACTIVE, UF_CREATED_AT.
Roles set via module constants:
-
ROLE_OWNER— full rights, manages employees and details -
ROLE_BUYER— creates and sees company orders -
ROLE_ACCOUNTANT— documents and finance only, no order creation -
ROLE_VIEWER— history view only
Employee Invite: owner enters email → token generated → email sent via CEvent::Send() with B2B_COMPANY_INVITE template → link creates Bitrix user (or links existing) → record created in b2b_company_users.
Orders: What's Needed Beyond Standard
Company Order List. Not user's — company's. CSaleOrder::GetList() with UF_COMPANY_ID filter (custom order field). Filter by status, date, managing manager. Search by order number and article in contents — via CSaleBasket::GetList() with subsequent JOIN.
Approval Statuses. Add custom statuses to b_sale_status: APPROVAL_PENDING (awaiting approval), APPROVED (approved), REJECTED (rejected). Status transitions — via OnSaleStatusOrderChange event handlers. On status change send notification via CEvent::Send().
Order Comments. High-load communication element: buyer writes wish ("deliver to warehouse #2"), manager replies. Implement via HighLoad-block order_comments: UF_ORDER_ID, UF_USER_ID, UF_TEXT, UF_CREATED_AT, UF_IS_INTERNAL (manager comment, invisible to buyer).
Documents from 1C
Integration scheme:
- Configure HTTP-service in 1C (or regular XML export) with documents per counterparty
- Bitrix agent (
CAgent::AddAgent) polls service every 2-4 hours - Result written to HighLoad-block
b2b_documents:UF_COMPANY_ID,UF_DOC_TYPE(invoice, waybill, reconciliation),UF_NUMBER,UF_DATE,UF_AMOUNT,UF_FILE_ID(orUF_EXTERNAL_URL) - In cabinet — list with filters, PDF download
If 1C sends PDF directly — cache in /upload/b2b/docs/{company_id}/ with name by document number. If sends metadata only — on "Download" click request 1C and stream file via PHP without disk save (space economy).
Financial Summary
"Finance" block on cabinet main page — aggregated data:
- Current credit limit and used amount (progress bar)
- Overdue debt with date
- Order amount for current month
Source — b2b_credit_status HighLoad-block, syncs from 1C. If data older than 6 hours — show "Data updating" warning.
If overdue above threshold — show banner in cabinet header. "Create Order" button blocks via cart component check.
Notifications
Set up two channels:
Email: via Bitrix mail events (CEventType, CEvent). Events: B2B_ORDER_CREATED, B2B_ORDER_STATUS_CHANGED, B2B_ORDER_APPROVED, B2B_DOCUMENT_READY. Templates editable in admin panel.
In-cabinet notifications: unread counter. HighLoad-block b2b_notifications: UF_USER_ID, UF_TYPE, UF_TEXT, UF_LINK, UF_IS_READ, UF_CREATED_AT. AJAX request every 30 seconds or WebSocket (module pull).
Timeline
| Block | Timeline |
|---|---|
| Roles and companies architecture | 2-3 weeks |
| Company order management | 2-3 weeks |
| Documents and 1C integration | 2-4 weeks |
| Finance block | 1-2 weeks |
| Order approval | 2-3 weeks |
| Notifications | 1-2 weeks |
| Testing | 2-3 weeks |
Total: 12-20 weeks. Less with ready cabinet scaffold. More with non-standard approval logic or complex 1C exchange.







