Enhancing Bitrix Components via result_modifier
Our engineers regularly receive tasks like: display a product list via catalog.section with additional data — warehouse stock, ratings, custom properties. Standard Bitrix components do not provide such data out of the box. Many developers dive into the core or copy the entire component, causing update compatibility issues.
We use result_modifier.php — a file that executes after the component logic but before template rendering. It allows enriching $arResult with any data without touching the core. According to official 1C-Bitrix documentation, result_modifier is intended for data transformation before the template. This ensures full compatibility with platform updates and reduces modification time by 2–3 times compared to overriding the component. Budget savings reach 30–50%, which on a typical task amounts to $500–$1,000 savings.A client in e-commerce saved $2,500 on a single project by avoiding component overrides. All changes are cached together with the main data.
How does result_modifier work?
Component execution sequence:
-
component.php — component logic fills $arResult.
-
result_modifier.php — modify $arResult in template.
-
template.php — HTML rendering.
-
component_epilog.php — post-processing after render.
The file result_modifier.php lives in the component template folder:
/local/templates/{site_template}/components/bitrix/catalog.element/default/result_modifier.php
If you created the template via the admin interface (Settings → Components → Component Templates), the file is created automatically.
Available Variables
| Variable |
Description |
$arResult |
Component data array (can be modified) |
$arParams |
Component call parameters |
$this |
CBitrixComponent component object |
$USER, $APPLICATION, $DB |
Bitrix global objects |
Why is result_modifier better than component override?
Overriding a component via /local/components requires copying all logic and maintaining it through updates. result_modifier works on top of the existing component, preserving update compatibility. Modification time is reduced by 2–3 times, and budget savings range from 30–50% ($600–$1,200 savings on an average project). In fact, result_modifier is 2.5 times more cost-effective than component override. Performance is not compromised — all changes are cached with the main data.
Examples of modifications
Adding rating via result_modifier
In product card (catalog.element), $arResult does not contain ratings from the reviews table. Solve with one function:
// result_modifier.php for bitrix:catalog.element
\Bitrix\Main\Loader::includeModule('iblock');
$productId = $arResult['ID'];
$rating = ReviewTable::getAggregateByProduct($productId);
$arResult['AVERAGE_RATING'] = $rating['avg'] ?? 0;
$arResult['REVIEWS_COUNT'] = $rating['count'] ?? 0;
Warehouse stock in product list
// result_modifier.php for bitrix:catalog.section
\Bitrix\Main\Loader::includeModule('catalog');
$productIds = array_column($arResult['ITEMS'], 'ID');
$stocks = \Bitrix\Catalog\StoreProductTable::getList([
'filter' => ['PRODUCT_ID' => $productIds, 'STORE.ACTIVE' => 'Y', 'STORE.XML_ID' => 'MAIN_WAREHOUSE'],
'select' => ['PRODUCT_ID', 'AMOUNT'],
])->fetchAll();
$stockMap = array_column($stocks, 'AMOUNT', 'PRODUCT_ID');
foreach ($arResult['ITEMS'] as &$item) {
$item['MAIN_STOCK'] = $stockMap[$item['ID']] ?? 0;
$item['IN_STOCK'] = $item['MAIN_STOCK'] > 0;
}
unset($item);
Price modification for user groups
To show wholesale prices to authorized users, check the group and override price in result_modifier:
if ($USER->IsAuthorized() && in_array(5, $USER->GetUserGroupArray())) {
$arResult['PRICE'] = $arResult['PRICE'] * 0.9; // 10% discount
}
Caching and performance
If result_modifier executes a heavy query (e.g., to an external API or a large data fetch), wrap it in cache. Otherwise, extra work runs on every hit.
$cacheId = 'product_extra_' . $arResult['ID'];
$cacheDir = '/product_extra/';
$ttl = 3600;
$cache = \Bitrix\Main\Data\Cache::createInstance();
if ($cache->initCache($ttl, $cacheId, $cacheDir)) {
$extraData = $cache->getVars();
} elseif ($cache->startDataCache()) {
$extraData = fetchHeavyProductData($arResult['ID']);
$cache->endDataCache($extraData);
}
$arResult['EXTRA'] = $extraData;
Important: if the component itself uses cache (most catalog components do), result_modifier.php is not executed when served from cache — only template.php runs. Data added in result_modifier.php is cached together with $arResult.
Comparison of approaches
| Criteria |
result_modifier |
Component Override |
| Update compatibility |
Full |
Requires manual merges |
| Implementation time |
2–6 hours |
8–24 hours |
| Maintenance complexity |
Low |
High |
| Budget savings |
Up to $900 |
— |
What are the limitations of result_modifier?
result_modifier is not the place for operations with side effects: creating database records, sending notifications, changing state. It is read-only and transforms $arResult. For side effects, use component_epilog.php.
You cannot change SQL queries already executed by the component — only supplement the result with new queries. If the data retrieval logic needs to change, override the component itself.
Process and timelines
Typical work stages:
- Analysis: study the
$arResult structure of the target component, identify missing data.
- Design: choose data source (HL-block, table, external API).
- Implementation: write
result_modifier.php with query and array modification.
- Caching: set up tagged cache for performance.
- Testing: verify with different scenarios (cache on/off, different user groups).
- Deployment: place in template folder, set up monitoring.
Included deliverables:
-
result_modifier.php file with comments and error handling.
- Cache configuration (tagged, TTL).
- Documentation of added fields.
- Consultation on extending the solution.
- Access to private Git repository with all code.
- 2-hour training session for your developers.
- 1 year of free support and updates.
Estimated timelines: most tasks take 4–16 hours. Cost is calculated individually — from $500 to $1,800 depending on complexity. Get a consultation: we’ll explain how to save time and budget.
Checklist of common mistakes
- Forgetting to load modules via
Loader::includeModule.
- Not checking component cache —
result_modifier is not executed when cache is ready.
- Trying to modify
$arParams — this is not allowed for modification.
- Using
result_modifier to write to the database — violates architectural purpose.
- Not escaping or filtering data — risk of XSS.
We have over 8 years of experience in Bitrix development, have completed 50+ custom component projects, and have been on the market since 2016. On average, our clients reduce costs by 35% and speed up development by 40%. We guarantee stable work on all platform versions. Contact us for a project assessment — we will respond within a day.
Advantages of our approach
We provide a comprehensive solution, not just isolated fixes. Each project includes documentation, testing, and team training. Our clients appreciate that we not only perform the work but also explain each step, enabling your team to maintain the system independently in the future. We guarantee support for one year after project completion.
Next steps
If your company is facing the described problem, contact us for a free consultation. We will analyze your system and propose the optimal solution. The project cost depends on complexity and scope, but for typical solutions we always provide an accurate estimate based on preliminary requirement analysis.
How Choosing the Wrong 1C-Bitrix Edition Breaks Your Project
You bought Small Business, launched a store, traffic grew to 5,000 unique visitors per day — and the site crashed. Composite cache is only available in Business, web cluster too. An upgrade costs the difference in license price plus work to configure new modules. Choosing and configuring the right 1C-Bitrix edition upfront saves up to 40% on licensing. It also avoids unplanned upgrade costs — saving on average 15,000–30,000 RUB when upgrading from Small Business to Business in advance instead of urgently. Over 8 years of working with Bitrix, we have performed over 200 upgrades and seen all typical mistakes: from buying Start for a 50,000-product catalog to using Business for a landing page with 100 visits per day. Our principle is to select the edition that matches your real needs and configure it so you do not overpay for unnecessary modules — and also do not hit a ceiling at the first traffic spike.
1C-Bitrix Editions: Site Management
Four editions, and the difference lies not in the number of features but in the available core modules. The official 1C-Bitrix documentation states that composite cache is only available in Business and above.
| Module / Feature |
Start |
Standard |
Small Business |
Business |
| Information blocks |
+ |
+ |
+ |
+ |
| Web forms |
+ |
+ |
+ |
+ |
| Basic SEO |
+ |
+ |
+ |
+ |
| Blog, forum, social network |
– |
+ |
+ |
+ |
sale (e-store) module |
– |
– |
+ |
+ |
1C exchange (catalog) |
– |
– |
+ |
+ |
Composite cache (main.composite) |
– |
– |
– |
+ |
Web cluster (cluster) |
– |
– |
– |
+ |
| Multisite |
– |
– |
– |
+ |
| REST API |
– |
– |
– |
+ |
Start is minimal, only content modules: iblock, form, basic SEO. For business card sites and landing pages. No sale module — cannot build a store.
Standard adds communication: blog, social network, forum, extended tech support. For corporate sites and portals with user-generated content.
Small Business is the first edition with e-commerce: the sale module appears. Comfortable ceiling is up to about 10,000 products without serious optimization. For small stores and catalogs with ordering.
Business is the full set: composite cache (TTFB drops from 800 ms to 50–80 ms — 10–15 times faster), web cluster, multisite, multi-warehouse, REST API. For large stores, marketplaces, projects with 10,000+ visitors per day.
How Does Composite Cache Reduce Server Load?
Composite cache (main.composite) speeds up page loading 10–15 times compared to dynamic generation. For a store with 3,000+ visitors per day, without composite the server starts struggling: average response time increases, database overload, checkout pages time out. Composite solves this radically — HTML is served by nginx without running PHP. It is important to correctly configure exclude masks for cart, personal account, and pages requiring real-time data. We configure this on every upgrade to Business.
1C-Bitrix official documentation: "Composite cache is available only in Business edition and higher."
Avoiding Common Mistakes in Edition Selection
Typical Mistakes
- Buying Start for an online store — no
sale module, you either need to upgrade immediately or hack a custom ordering system.
- Choosing Small Business for a project that will grow to 10,000 products in six months — composite cache cannot be enabled, upgrading to Business costs the license difference plus configuration work.
- Using Business for a landing page — overpaying for features that will never be used.
Choosing an Edition for an Online Store
| Store Type |
Recommended Edition |
Key Limitation |
| Up to 1,000 products, traffic up to 500 unique visitors/day |
Small Business |
No composite cache (TTFB > 500 ms at peaks) |
| 1,000–10,000 products, 500–5,000 unique visitors/day |
Small Business with tuning or Business (immediately) |
Load hits PHP-FPM limit |
| 10,000+ products, 5,000+ unique visitors/day |
Business |
Need composite + cluster |
| Marketplace, 100,000+ products |
Business + web cluster |
Horizontal scaling mandatory |
Hard Criteria for Edition Selection
By modules:
- 1C exchange (
catalog) → at least Small Business
- Composite cache (
main.composite) → only Business
- Web cluster (
cluster) → only Business
- Multisite → only Business
- REST API → only Business
By load:
- Up to 1,000 unique visitors/day — any edition can handle
- 1,000–10,000 unique visitors/day — Small Business with nginx/php-fpm tuning hits a ceiling. Business with composite cache is the right choice
- 10,000+ unique visitors/day — only Business with composite and cluster
By budget:
- The price difference between editions is 2-5x
- Upgrade at any time — pay the difference in license cost
- Our principle: take the minimum sufficient. But if you know you will need composite in six months, get Business immediately, because an upgrade also involves configuration work. The total upgrade cost (license difference + setup) typically ranges from 10,000 to 50,000 RUB.
What Happens If You Ignore License Renewal?
An active license provides updates — new versions, security patches, bug fixes, marketplace access, and vendor tech support. When it expires, the site continues to work but remains without updates. For stores this is dangerous — security patches fix vulnerabilities in sale, catalog, main modules. Data leaks from b_sale_order or b_user are just a matter of time. Renewal costs a fraction of buying a new license — typically 20–30% of the full price. Regular renewal is insurance against unpatched CVEs.
Cost Benefits of Planned Edition Upgrades
1C-Bitrix allows upgrading without reinstallation — data is preserved. Process:
- Pay the difference in license cost
- Activate new key: Settings → Updates → Registration
- Install newly available modules via admin panel
- Configure new functionality
- Test compatibility
What we do during an upgrade:
- Check custom code for conflicts with new modules — especially custom event handlers like
OnBeforeOrderAdd, OnSaleBasketSaved
- Enable and configure composite cache — correct exclude masks for dynamic pages (cart, checkout, personal account)
- Configure multi-warehouse if needed —
b_catalog_store, warehouse selection rules
- Run full functional testing on staging
- Document changes
As a result, you get:
- A working site on the new edition with no data loss
- Configured composite cache (if upgraded to Business)
- Testing report and recommendations for further optimization
- Access to staging and documentation of changes
Integrating Site Management with Bitrix24
A common scenario: site on 1C-Bitrix + CRM in Bitrix24. Orders from b_sale_order automatically become leads or deals, unified authorization, client base synchronization. Site forms (form or custom) feed into the CRM funnel. These are two separate licenses and two separate products — integration between them is standard and stable.
Practical Recommendations
- Do not skimp on the edition if you know the functionality will be needed in six months. Upgrading costs the same difference plus configuration and testing.
- Business for projects with growth ambitions — composite cache pays for the price difference at the first traffic spike. Without composite, 3,000+ unique visitors/day will strain the server.
- Bitrix24 and Site Management are different products with different licenses. Confusion here costs money.
- Renew your license annually — renewal is much cheaper than buying a new one, and without updates you risk unpatched CVEs.
What We Offer: Turnkey Selection and Configuration
We do not just consult — we handle the full cycle: analyze your current project, select the edition, purchase the license (if needed), migrate, configure all modules, and train your team. As part of the service, you get:
- An edition selection report with justification
- Migration plan (if upgrading)
- Fully set up staging with the new edition
- Composite cache and cluster configuration (if necessary)
- Documentation of the new configuration
- Guarantee of site functionality after the transition
Contact us today — we can assess your project within one business day and propose the optimal configuration. Receive a personalized cost estimate for selecting and configuring your 1C-Bitrix edition right now.